Codebuff is a tool for editing codebases via natural-language instructions to Buffy (an expert AI programming assistant).
- Make expert engineers faster (power-user focus).
- Reduce time/effort for common programming tasks.
- Improve via iteration/feedback (learn/adapt from usage).
- TypeScript monorepo (Bun workspaces)
- Bun runtime + package manager
- Next.js (web app + API routes)
- Multiple LLM providers (Anthropic/OpenAI/Gemini/etc.)
cli/— TUI client (OpenTUI + React) and local UXsdk/— JS/TS SDK used by the CLI and external usersweb/— Next.js app + API routes (the "web API")packages/agent-runtime/— agent runtime + tool handling (server-side)common/— shared types, tools, schemas, utilitiesagents/— main agents shipped with codebuff.agents/— local agent templates (prompt + programmatic agents)
- CLI/SDK sends user input + context to the Codebuff web API.
- Agent runtime streams events/chunks back through SDK callbacks.
- Tools execute locally (file edits, terminal commands, search) to satisfy tool calls.
- Prefer
ErrorOr<T>return values (success(...)/failure(...)incommon/src/util/error.ts) over throwing. - Never force-push
mainunless explicitly requested. - To exclude files from a commit: stage only what you want (
git add <paths>). Never usegit restore/git checkout HEAD -- <file>to "uncommit" changes. - Run interactive git commands in tmux (anything that opens an editor or prompts).
- Referral codes are applied via the CLI (web onboarding only instructs the user); see
web/src/app/api/referrals/helpers.ts.
docs/architecture.md— Package dependency graph, per-package details, architectural patternsdocs/request-flow.md— Full request lifecycle from CLI through server and backdocs/error-schema.md— Server error response formats and client-side handlingdocs/development.md— Dev setup, worktrees, logs, package management, DB migrationsdocs/testing.md— DI over mocking, tmux CLI testingdocs/environment-variables.md— Env var rules, DI helpers, loading orderdocs/agents-and-tools.md— Agent system, shell shims, tool definitions