Crates.io | sagacity |
lib.rs | sagacity |
version | 0.1.2 |
source | src |
created_at | 2024-10-08 20:08:50.986663 |
updated_at | 2024-10-11 03:08:59.822652 |
description | A Rust-based project for conversing with your codebase and handling codebase contextualization |
homepage | |
repository | |
max_upload_size | |
id | 1401643 |
size | 95,003 |
Sagacity is a Rust-based command-line tool that leverages AI to assist developers in exploring and understanding their codebase through natural language queries. It automatically indexes the codebase and generates concise summaries for each file, allowing users to ask questions and receive relevant information based on the code context.
You can install Sagacity using Cargo, the Rust package manager:
cargo install sagacity
Sagacity requires an API key from Anthropic to leverage their AI models. You can obtain an API key by creating an account on the Anthropic website and following their instructions.
Once you have an API key, you need to add it to your .zshrc
file (or the appropriate shell configuration file for your system). Add the following line, replacing <YOUR_API_KEY>
with your actual API key:
export ANTHROPIC_API_KEY="<YOUR_API_KEY>"
Sagacity will automatically read the API key from this environment variable.
After installation, you can run Sagacity from the command line:
sagacity
This will start the interactive CLI, where you can navigate through different options using the arrow keys and Enter.
The main menu provides the following options:
In the chat mode, you can ask questions about your codebase in natural language. The AI will provide relevant information based on the indexed files and your queries. You can also use the following commands during the chat session:
/exit
: Return to the main menu./clear
: Clear the conversation history./help
: Display the chat commands help./save
: Save the current conversation./load
: Load a previously saved conversation.After receiving a response from the AI, you can choose to copy the response to the clipboard or save it to a file for future reference.
Contributions to Sagacity are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the project's GitHub repository.
Sagacity is licensed under the MIT License.