Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b08aa44
chore: remove legacy backend and npm-app
brandonkachen Dec 9, 2025
82327c7
chore: stabilize tests without api key
brandonkachen Dec 9, 2025
c65a661
chore: point defaults at production api
brandonkachen Dec 9, 2025
80f1435
chore: require env-provided frontend urls
brandonkachen Dec 9, 2025
79b2811
Enforce explicit env vars and guard agent integrations
brandonkachen Dec 9, 2025
e09024c
Drop backend env var and guard admin proxy
brandonkachen Dec 9, 2025
8c9e35e
Remove unused backend-only env vars
brandonkachen Dec 9, 2025
20e7bcc
Make e2e tests fail on network/auth errors
brandonkachen Dec 9, 2025
4846be1
chore: update bun.lock to fix CI
brandonkachen Dec 9, 2025
eef156f
fix: add type assertions in MCP client to fix TypeScript errors
brandonkachen Dec 9, 2025
f38e21d
Migrate relabel endpoint and fix agent loader
brandonkachen Dec 9, 2025
c7e1381
chore: update bun.lock to fix CI
brandonkachen Dec 9, 2025
7c94267
Respect relabel limit in full-context relabel
brandonkachen Dec 9, 2025
f544231
chore: format and lint branch changes
brandonkachen Dec 9, 2025
71ef3bd
chore: enforce env validation
brandonkachen Dec 9, 2025
663a37c
chore: drop legacy backend env var from worktree setup
brandonkachen Dec 10, 2025
5be4a75
Update .envrc
brandonkachen Dec 10, 2025
af2771f
chore: add gpt-tokenizer as direct dependency to agent-runtime
brandonkachen Dec 10, 2025
b102618
refactor: use SDK for loading local agents with async initialization
brandonkachen Dec 10, 2025
03db2d8
fix: address code review feedback
brandonkachen Dec 10, 2025
ba520bf
fix: replace as any casts with proper types in relabel endpoint
brandonkachen Dec 10, 2025
e41fb69
docs: add instruction to visit /usage to create API key
brandonkachen Dec 10, 2025
56616db
docs: remove references to removed npm-app and backend packages
brandonkachen Dec 10, 2025
7190295
fix: require user-provided API key for relabel endpoint
brandonkachen Dec 10, 2025
2822177
refactor: migrate web package from env to webEnv
brandonkachen Dec 10, 2025
46aeb27
refactor: simplify CODEBUFF_API_KEY protection with ciOnlyEnvVars
brandonkachen Dec 10, 2025
e76c0b0
fix: only set env defaults in CI, not local dev
brandonkachen Dec 10, 2025
e511ef9
fix: remove network error suppression from SDK integration test
brandonkachen Dec 10, 2025
3fa8a3c
refactor(sdk): simplify and enhance loadLocalAgents API
brandonkachen Dec 10, 2025
5d6a1a4
docs(sdk): fix README examples to be valid copy-pasteable code
brandonkachen Dec 10, 2025
87034da
Update load-agents.ts
brandonkachen Dec 10, 2025
ee3087b
Update llm.ts
brandonkachen Dec 10, 2025
a2a9aec
refactor(sdk): improve loadLocalAgents to return validation errors
brandonkachen Dec 10, 2025
f2ac48b
fix(sdk): replace deprecated base agent with codebuff/base2@latest
brandonkachen Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
260 changes: 125 additions & 135 deletions .agents/LESSONS.md

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ OPENAI_API_KEY=dummy_openai_key
# Database & Server
DATABASE_URL=postgresql://manicode_user_local:secretpassword_local@localhost:5432/manicode_db_local
PORT=4242
GOOGLE_CLOUD_PROJECT_ID=dummy_project_id

# Authentication
CODEBUFF_GITHUB_ID=dummy_github_id
CODEBUFF_GITHUB_SECRET=dummy_github_secret
NEXTAUTH_SECRET=dummy_nextauth_secret_at_least_32_chars_long
API_KEY_ENCRYPTION_SECRET=dummy_encryption_secret_32_chars

# Payment (Stripe)
STRIPE_SECRET_KEY=sk_test_dummy_stripe_secret
Expand All @@ -21,7 +19,6 @@ STRIPE_USAGE_PRICE_ID=price_dummy_usage_id
STRIPE_TEAM_FEE_PRICE_ID=price_dummy_team_fee_id

# External Services
RELACE_API_KEY=dummy_relace_key
LINKUP_API_KEY=dummy_linkup_key
LOOPS_API_KEY=dummy_loops_key

Expand All @@ -33,9 +30,8 @@ DISCORD_APPLICATION_ID=dummy_discord_app_id
# Frontend/Public Variables
NEXT_PUBLIC_CB_ENVIRONMENT=dev
NEXT_PUBLIC_CODEBUFF_APP_URL=http://localhost:3000
NEXT_PUBLIC_CODEBUFF_BACKEND_URL=localhost:4242
NEXT_PUBLIC_SUPPORT_EMAIL=support@codebuff.com
NEXT_PUBLIC_POSTHOG_API_KEY=phc_dummy_posthog_key
NEXT_PUBLIC_POSTHOG_HOST_URL=https://us.i.posthog.com
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_dummy_publishable
NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL=https://billing.stripe.com/p/login/test_dummy
NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL=https://billing.stripe.com/p/login/test_dummy
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ Before you begin, you'll need to install a few tools:
5. **Start development services**:

**Option A: All-in-one (recommended)**

```bash
bun run dev
# Starts the web server, builds the SDK, and launches the CLI automatically
```

**Option B: Separate terminals (for more control)**

```bash
# Terminal 1 - Web server (start first)
bun run start-web
Expand All @@ -69,7 +71,7 @@ Before you begin, you'll need to install a few tools:

Now, you should be able to run the CLI and send commands, but it will error out because you don't have any credits.

**Note**: CLI requires both backend and web server running for authentication.
**Note**: CLI requires the web server running for authentication.

6. **Giving yourself credits**:

Expand Down Expand Up @@ -123,9 +125,8 @@ In order to run the CLI from other directories, you need to first publish the ag

Codebuff is organized as a monorepo with these main packages:

- **backend/**: WebSocket server, LLM integration, agent orchestration
- **npm-app/**: CLI application that users interact with
- **web/**: Next.js web application and dashboard
- **cli/**: CLI application that users interact with
- **python-app/**: Python version of the CLI (experimental)
- **common/**: Shared code, database schemas, utilities
- **sdk/**: TypeScript SDK for programmatic usage
Expand Down Expand Up @@ -202,7 +203,7 @@ cd cli
bun run test:tmux-poc
```

See [cli/src/__tests__/README.md](cli/src/__tests__/README.md) for comprehensive interactive testing documentation.
See [cli/src/**tests**/README.md](cli/src/__tests__/README.md) for comprehensive interactive testing documentation.

### Commit Messages

Expand All @@ -225,15 +226,15 @@ Build specialized agents in `.agents/` for different languages, frameworks, or w

### 🔧 **Tool System**

Add new capabilities in `backend/src/tools.ts` - file operations, API integrations, development environment helpers. The sky's the limit!
Add new capabilities in `common/src/tools` and the SDK helpers - file operations, API integrations, development environment helpers. The sky's the limit!

### 📦 **SDK Improvements**

Make the SDK in `sdk/` even more powerful with new methods, better TypeScript support, or killer integration examples.

### 💻 **CLI Magic**

Enhance the user experience in `npm-app/` with smoother commands, better error messages, or interactive features that make developers smile.
Enhance the user experience in `cli/` with smoother commands, better error messages, or interactive features that make developers smile.

### 🌐 **Web Dashboard**

Expand Down
10 changes: 5 additions & 5 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
In general, we reevaulate plans day-by-day and thus the roadmap may change at any point.
In general, we reevaluate plans day-by-day and thus the roadmap may change at any point.

As of Oct 6th, here's what we're working on:
- Brandon is rebuilding npm-app from the ground up with a snazzy TUI and reusing the SDK instead of a custom connection to the backend
- Charles is moving backend logic to the SDK so more code is run locally.
- James is building more powerful agents, especially "base2", which is the next-gen default codebuff agent. Try it with `codebuff --experimental`!
As of Dec 2024, here's what we're working on:
- The CLI has been rebuilt with a modern TUI using OpenTUI and React 19
- Core functionality has been moved to the SDK for local execution, and our CLI now fully uses it!
- Building more powerful agents, especially "base2", which is the next-gen default codebuff agent
6 changes: 3 additions & 3 deletions authentication.knowledge.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Overview

Codebuff implements secure authentication between CLI (npm-app), backend, and web application using fingerprint-based device identification.
Codebuff implements secure authentication between the CLI and web application using fingerprint-based device identification.

## Core Authentication Flow

```mermaid
sequenceDiagram
participant CLI as npm-app
participant CLI as CLI
participant Web as web app
participant DB as Database

Expand All @@ -30,7 +30,7 @@ sequenceDiagram
### 1. First Time Login / Missing Credentials

- CLI generates fingerprint from hardware info + 8 random bytes
- Uses `calculateFingerprint()` in `npm-app/src/fingerprint.ts`
- Uses `calculateFingerprint()` in the SDK
- Continues to core flow with new fingerprintId

### 2. Logout Flow
Expand Down
4 changes: 0 additions & 4 deletions backend/.gitignore

This file was deleted.

25 changes: 0 additions & 25 deletions backend/README.md

This file was deleted.

180 changes: 0 additions & 180 deletions backend/knowledge.md

This file was deleted.

Loading