|
1 | | -# cerebras-coding-agent |
2 | | -A Cerebras AI LLM coding agent for the command line |
| 1 | +# Cerebras Coding Agent |
| 2 | + |
| 3 | +``` |
| 4 | + ██████╗ ██████╗ ██████╗ ███████╗██████╗ |
| 5 | +██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗ |
| 6 | +██║ ██║ ██║██║ ██║█████╗ ██████╔╝ |
| 7 | +██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗ |
| 8 | +╚██████╗╚██████╔╝██████╔╝███████╗██║ ██║ |
| 9 | + ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ |
| 10 | + |
| 11 | + Cerebras Agent - Your AI coding assistant |
| 12 | +``` |
| 13 | + |
| 14 | +A local agent for code development using the Cerebras API. This tool allows you to interact with your codebase through natural language, helping you understand, modify, and extend your code more efficiently. |
| 15 | + |
| 16 | +## Features |
| 17 | + |
| 18 | +- Code generation and modification based on natural language instructions |
| 19 | +- Repository analysis and question answering |
| 20 | +- Interactive command-line interface |
| 21 | +- Automatic error detection and fixing |
| 22 | +- Support for multiple programming languages and frameworks |
| 23 | +- Proper handling of project file structures |
| 24 | + |
| 25 | +## Installation |
| 26 | + |
| 27 | +### From PyPI (Recommended) |
| 28 | + |
| 29 | +```bash |
| 30 | +pip install cerebras-agent |
| 31 | +``` |
| 32 | + |
| 33 | +### From Source |
| 34 | + |
| 35 | +```bash |
| 36 | +# Clone the repository |
| 37 | +git clone https://github.com/jio-gl/cerebras-coding-agent.git |
| 38 | +cd cerebras-coding-agent |
| 39 | + |
| 40 | +# Option 1: Use the installation script |
| 41 | +./install.sh |
| 42 | + |
| 43 | +# Option 2: Use the installation script with virtual environment |
| 44 | +./install.sh --venv |
| 45 | + |
| 46 | +# Option 3: Manual installation |
| 47 | +pip install -e . |
| 48 | +``` |
| 49 | + |
| 50 | +## Configuration |
| 51 | + |
| 52 | +1. Get a Cerebras API key from [Cerebras Cloud](https://cloud.cerebras.ai/) |
| 53 | + |
| 54 | +2. Create a `.env` file in your project root: |
| 55 | +```bash |
| 56 | +CEREBRAS_API_KEY=your_api_key_here |
| 57 | +``` |
| 58 | + |
| 59 | +3. Alternatively, set your API key as an environment variable: |
| 60 | +```bash |
| 61 | +export CEREBRAS_API_KEY=your_api_key_here |
| 62 | +``` |
| 63 | + |
| 64 | +## Usage |
| 65 | + |
| 66 | +### Command Line Interface |
| 67 | + |
| 68 | +```bash |
| 69 | +# Start the agent in interactive mode |
| 70 | +cerebras-agent |
| 71 | + |
| 72 | +# Ask a specific question about the repository without making changes |
| 73 | +cerebras-agent --ask "How does this codebase handle authentication?" |
| 74 | +cerebras-agent -a "How does this codebase handle authentication?" |
| 75 | + |
| 76 | +# Prompt the agent to perform changes in the repository |
| 77 | +cerebras-agent --agent "Add error handling to all database functions" |
| 78 | +cerebras-agent -g "Add error handling to all database functions" |
| 79 | + |
| 80 | +# Specify a repository path (default: current directory) |
| 81 | +cerebras-agent --repo /path/to/your/repo |
| 82 | +cerebras-agent -r /path/to/your/repo |
| 83 | +``` |
| 84 | + |
| 85 | +### Interactive Commands |
| 86 | + |
| 87 | +Once in the interactive mode, you can use the following commands: |
| 88 | + |
| 89 | +- **`<prompt>`**: Enter any natural language prompt to generate code changes |
| 90 | +- **`ask <question>`**: Ask a question about the repository without making changes |
| 91 | +- **`checkpoint`**: Show current checkpoint and change history |
| 92 | +- **`revert <number>`**: Revert to a specific checkpoint number |
| 93 | +- **`help`**: Show available commands |
| 94 | +- **`exit`**: Exit the program |
| 95 | + |
| 96 | +## Development |
| 97 | + |
| 98 | +1. Clone the repository: |
| 99 | +```bash |
| 100 | +git clone https://github.com/jio-gl/cerebras-coding-agent.git |
| 101 | +cd cerebras-coding-agent |
| 102 | +``` |
| 103 | + |
| 104 | +2. Install development dependencies: |
| 105 | +```bash |
| 106 | +pip install -e ".[dev]" |
| 107 | +``` |
| 108 | + |
| 109 | +3. Run tests: |
| 110 | +```bash |
| 111 | +./run_tests.sh |
| 112 | +``` |
| 113 | + |
| 114 | +4. Run integration tests (requires API key): |
| 115 | +```bash |
| 116 | +export CEREBRAS_API_KEY=your_api_key_here |
| 117 | +./run_integration_tests.sh |
| 118 | +``` |
| 119 | + |
| 120 | +## License |
| 121 | + |
| 122 | +This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. |
| 123 | + |
| 124 | +## Contributing |
| 125 | + |
| 126 | +Contributions are welcome! Please feel free to submit a Pull Request. |
0 commit comments