CLI installation
The Codebuff CLI provides an interactive terminal interface for AI-powered coding.Install globally
Install Codebuff globally using npm:Run without installing
Use npx to run Codebuff without installation:Using npx will download and run the latest version each time. For regular use, global installation is recommended.
Verify installation
Check that Codebuff is installed correctly:SDK installation
The Codebuff SDK allows you to integrate AI coding capabilities into your applications.Install the package
Install the SDK as a project dependency:Verify installation
Create a test file to verify the SDK is working:test.ts
Prerequisites
System requirements
Node.js version
Node.js version
Codebuff requires Node.js 18.0.0 or higher.Check your version:If you need to upgrade, download from nodejs.org or use a version manager like nvm:
Package manager
Package manager
Codebuff works with any Node.js package manager:
- npm (bundled with Node.js)
- yarn (install with
npm install -g yarn) - pnpm (install with
npm install -g pnpm) - bun (install from bun.sh)
Git (recommended)
Git (recommended)
While not required, Codebuff works best with Git repositories. It can:
- Analyze commit history for context
- Create commits with meaningful messages
- Track changes made during sessions
Codebuff account
You need a Codebuff account to use the service:- Sign up: Visit codebuff.com to create an account
- Get API key: Navigate to codebuff.com/api-keys
- Copy your key: You’ll need this for authentication
Environment setup
CLI authentication
The first time you run the CLI, you’ll be prompted to authenticate:- Open your browser
- Log in to your Codebuff account
- Authorize the CLI
SDK authentication
For the SDK, provide your API key when creating the client:Store API key securely
Never hardcode your API key. Use environment variables:Configuration
Project setup
Initialize Codebuff in your project:Knowledge files
Knowledge files provide context about your project:knowledge.md: Project-specific guidelines and context~/.knowledge.md: User-wide preferences (home directory)AGENTS.md: Alternative name for knowledge filesCLAUDE.md: Alternative name (Claude compatibility)
knowledge.md:
Verification
Test CLI installation
1.0.0)
Test SDK installation
Create a simple test:test-sdk.ts
Common issues
Command not found: codebuff
Command not found: codebuff
If you see this error after installation:Solution 1: Ensure npm global bin is in your PATHAdd this to your PATH in Solution 2: Use npx instead
.bashrc, .zshrc, or equivalent:Permission denied errors
Permission denied errors
If you get EACCES errors during installation:Solution: Use a Node version manager or fix npm permissionsOr follow npm’s guide to fixing permissions.
API key not working
API key not working
If authentication fails:
- Verify the key: Check you copied the full key from codebuff.com/api-keys
- Check environment: Ensure
CODEBUFF_API_KEYis set - Regenerate: Create a new API key if needed
Module not found errors (SDK)
Module not found errors (SDK)
If you get module resolution errors:Solution: Ensure TypeScript is configured correctlyOr use
tsconfig.json
"module": "CommonJS" for CommonJS projects.Slow installation
Slow installation
If npm install is taking too long:Solution: Use a faster package managerOr:
Next steps
Quickstart
Complete your first coding task with Codebuff
CLI Guide
Learn CLI commands and workflows
SDK Guide
Integrate Codebuff into your application
Configuration
Advanced configuration options

