Codebuff is an AI-powered coding assistant that helps developers build apps faster and easier. It provides an interactive command-line interface for natural language interactions with your codebase.
- AI-powered code generation and modification
- Real-time, interactive command-line interface
- Support for multiple programming languages
- File management and version control integration
- Web scraping capabilities for gathering external information
- Terminal command execution for various development tasks
- Knowledge management system for project-specific information
Codebuff uses advanced AI models to understand and generate code based on natural language instructions. Here's a brief overview of its operation:
-
Project Analysis: Codebuff analyzes your project structure and files to gain context.
-
User Interaction: You interact with Codebuff through a command-line interface, providing instructions or queries in natural language.
-
AI Processing: Codebuff processes your input, considering the project context and your instructions.
-
Code Generation/Modification: Based on its understanding, Codebuff generates new code or suggests modifications to existing files.
-
Real-time Feedback: Changes are presented to you in real-time, allowing for immediate review and further refinement.
-
Knowledge Accumulation: Codebuff learns from interactions and stores project-specific knowledge for future use.
To get started with Codebuff, follow these steps:
-
Install Codebuff globally using npm:
npm install -g codebuff -
Navigate to your project directory in the terminal.
-
Run Codebuff:
codebuff -
Interact with Codebuff using natural language commands. For example:
- "Add a new function to handle user authentication"
- "Refactor the database connection code for better performance"
- "Explain how the routing system works in this project"
-
Review the suggested changes and approve or modify them as needed.
-
Use the built-in commands for navigation and control:
- Type "help" or "h" for a list of available commands
- Use arrow keys to navigate through command history
- Press Ctrl+U to undo changes and Ctrl+R to redo
- Press Esc to toggle the menu or stop the current AI response
If you want to set up Codebuff for local development:
-
Install Bun: Follow the Bun installation guide
-
Install direnv: This manages environment variables automatically
- macOS:
brew install direnv - Ubuntu/Debian:
sudo apt install direnv - Other systems: See direnv installation guide
- macOS:
-
Hook direnv into your shell:
- For zsh:
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc && source ~/.zshrc
- For bash:
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc && source ~/.bashrc
- For fish:
echo 'direnv hook fish | source' >> ~/.config/fish/config.fish && source ~/.config/fish/config.fish
- For zsh:
-
Restart your shell: Run
exec $SHELL(or manually kill and re-open your terminal). -
Install Docker: Required for the web server database
-
Clone and navigate to the project:
git clone <repository-url> cd codebuff
-
Set up Infisical for secrets management:
npm install -g @infisical/cli infisical login
When prompted, select the "US" region, then verify setup:
infisical secrets
-
Configure direnv:
direnv allow
This automatically manages your PATH and environment variables. The
.envrcfile is already committed to the repository and sets up the correct PATH to use the project's bundled version of Bun. -
Install dependencies:
bun install
-
Start the development services:
Terminal 1 - Backend server:
bun run start-server
Terminal 2 - Web server (requires Docker):
bun run start-web
Terminal 3 - Client:
bun run start-client
After direnv setup, you can run tests from any directory:
bun test # Runs with secrets automatically
bun test --watch # Watch mode
bun test specific.test.ts # Run specific test fileIf direnv isn't working:
- Ensure it's properly hooked into your shell (see Prerequisites step 3)
- Run
direnv allowin the project root - Check that
.envrcexists and has the correct content - Restart your terminal if needed
-
NPM Package: The npm package contained in this project is licensed under the MIT License. See the LICENSE file in the npm package directory for details.
-
Other Project Components: All other parts of this project, including but not limited to server-side code and non-public client-side code, are proprietary and confidential. No license is granted for their use, modification, or distribution without explicit permission from the project owner.