Skip to content

Commit e145dc0

Browse files
committed
docs: refine development guide with verified scripts, complete workspaces, and env notes
1 parent 2f8cdef commit e145dc0

1 file changed

Lines changed: 38 additions & 20 deletions

File tree

docs/development.md

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This guide covers local environment setup, monorepo architecture, development wo
66

77
## 📦 Monorepo Architecture
88

9-
Freebuff is structured as a TypeScript monorepo using Bun workspaces:
9+
Freebuff is structured as a TypeScript monorepo using Bun workspaces (defined in [`package.json`](../package.json)):
1010

1111
| Workspace | Path | Purpose |
1212
|---|---|---|
@@ -17,6 +17,7 @@ Freebuff is structured as a TypeScript monorepo using Bun workspaces:
1717
| **Agent Runtime** | `packages/agent-runtime/` | Multi-agent execution loop, step orchestration, and tool execution |
1818
| **Code Map** | `packages/code-map/` | AST and Tree-sitter powered codebase indexing |
1919
| **LLM Providers** | `packages/llm-providers/` | Model adapters (DeepSeek, OpenAI, Anthropic, Gemini, MiMo, MiniMax) |
20+
| **Evals** | `evals/` | Evaluation benchmarks (`buffbench`) for evaluating agent performance |
2021
| **Freebuff** | `freebuff/` | Freebuff distribution packaging and CLI build scripts |
2122
| **Tmux Scripts** | `scripts/tmux/` | Terminal emulation helpers for interactive CLI testing |
2223

@@ -25,49 +26,51 @@ Freebuff is structured as a TypeScript monorepo using Bun workspaces:
2526
## 🛠️ Prerequisites
2627

2728
- **[Bun](https://bun.sh)**: `v1.3.14` or higher (primary package manager and runtime)
28-
- **Node.js**: `v22+` (for compatibility with certain tooling)
29+
- **Node.js**: `v22+` (for compatibility with ecosystem tooling)
2930
- **Git**: For version control
30-
- **tmux** *(optional)*: Required only for interactive CLI E2E testing (macOS: `brew install tmux`, Linux: `sudo apt-get install tmux`)
31+
- **tmux** *(optional)*: Required for interactive CLI E2E testing (macOS: `brew install tmux`, Linux: `sudo apt-get install tmux`)
3132

3233
---
3334

3435
## 🚀 Getting Started
3536

3637
### 1. Install Dependencies
3738

38-
Install all workspace dependencies from the root:
39+
Install all workspace dependencies from the repository root:
3940

4041
```bash
4142
bun install
4243
```
4344

4445
### 2. Build the SDK
4546

46-
The CLI and other packages depend on the built SDK:
47+
The CLI and other packages depend on the compiled SDK:
4748

4849
```bash
4950
bun run build:sdk
5051
```
5152

52-
### 3. Run the CLI in Development Mode
53+
### 3. Build the Freebuff Binary
54+
55+
Compile the standalone Freebuff distribution binary into `cli/bin/freebuff`:
56+
57+
```bash
58+
bun run build:freebuff
59+
```
60+
61+
### 4. Run the CLI in Development Mode
5362

5463
Start the terminal UI directly from source:
5564

5665
```bash
5766
# Standard CLI dev mode
5867
bun start-cli
5968

60-
# Or run Freebuff mode
69+
# Or run in Freebuff mode
6170
bun run dev:freebuff
6271
```
6372

64-
### 4. Build the Freebuff Binary
65-
66-
Compile the standalone Freebuff distribution binary:
67-
68-
```bash
69-
bun run build:freebuff
70-
```
73+
> **Note**: Running the interactive CLI directly from source validates client environment configuration (`.env.local` or environment variables) on startup. See the [Contributing Guide](../CONTRIBUTING.md) and root [`README.md`](../README.md) for details on backend services.
7174
7275
---
7376

@@ -83,7 +86,7 @@ Run all unit tests across the repository:
8386
bun test
8487
```
8588

86-
Or run tests for a specific workspace:
89+
Or run tests for a specific workspace or file:
8790

8891
```bash
8992
# Test common utilities
@@ -92,7 +95,7 @@ bun test common/src/
9295
# Test SDK
9396
bun test sdk/
9497

95-
# Test CLI
98+
# Test CLI unit tests
9699
bun test cli/
97100
```
98101

@@ -102,13 +105,28 @@ For testing terminal rendering, bracketed paste mode, and keyboard navigation, F
102105

103106
---
104107

105-
## 📋 Code Conventions & Pre-PR Checklist
108+
## 📋 Available Root Scripts
109+
110+
The following scripts are defined in root [`package.json`](../package.json):
111+
112+
| Script | Command | Description |
113+
|---|---|---|
114+
| `bun run build:sdk` | `cd sdk && bun run build` | Builds `@codebuff/sdk` (ESM, CJS, types, WASM) |
115+
| `bun run build:freebuff` | `bun freebuff/cli/build.ts 0.0.0-dev` | Compiles the standalone Freebuff binary |
116+
| `bun run ci` | `bun run build:sdk && bun run build:freebuff` | Validates SDK and CLI builds for CI |
117+
| `bun start-cli` / `bun dev` | `bun --cwd cli dev` | Launches CLI in development mode |
118+
| `bun run dev:freebuff` | `FREEBUFF_MODE=true bun --cwd cli dev` | Launches CLI in Freebuff mode |
119+
| `bun run buffbench` | `bun --cwd evals run-buffbench` | Runs evaluation benchmarks |
120+
| `bun test` | `bun test` | Executes the test suite |
121+
122+
---
123+
124+
## 📋 Pre-PR Checklist
106125

107126
Before opening a pull request, ensure the following checks pass:
108127

109-
1. **Build the SDK**: `bun run build:sdk`
128+
1. **Validate Monorepo CI**: `bun run ci` (runs `build:sdk` and `build:freebuff`)
110129
2. **Run Unit Tests**: `bun test`
111-
3. **Validate Monorepo CI**: `bun run ci`
112-
4. **Clean Code**: Follow TypeScript strict typing, avoid `any`, and preserve existing documentation.
130+
3. **Clean Code**: Follow TypeScript strict typing, avoid `any`, and preserve existing documentation.
113131

114132
For pull request submission guidelines and scoping rules, see the [Contributing Guide](../CONTRIBUTING.md).

0 commit comments

Comments
 (0)