Skip to content

Commit 28db5db

Browse files
Merge branch 'main' of https://github.com/parikhvedant2003/codebuff into markdown_fix
2 parents ed178cd + f5b7ea2 commit 28db5db

File tree

9 files changed

+68
-97
lines changed

9 files changed

+68
-97
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,18 @@ Before you begin, you'll need to install a few tools:
5050

5151
5. **Start development services**:
5252

53-
**Option A: All-in-one (recommended)**
54-
55-
```bash
56-
bun run dev
57-
# Starts the web server, builds the SDK, and launches the CLI automatically
58-
```
59-
60-
**Option B: Separate terminals (for more control)**
61-
6253
```bash
63-
# Terminal 1 - Web server (start first)
54+
# Terminal 1 - Start the web server first
6455
bun run start-web
6556
# Expected: Ready on http://localhost:3000
6657

67-
# Terminal 2 - CLI client (requires web server to be running first)
58+
# Terminal 2 - Start the CLI (requires web server to be running)
6859
bun run start-cli
6960
# Expected: Welcome to Codebuff! + agent list
7061
```
7162

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

74-
**Note**: CLI requires the web server running for authentication.
75-
7665
6. **Giving yourself credits**:
7766

7867
1. Log into Codebuff at [http://localhost:3000/login](http://localhost:3000/login)

cli/release/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codebuff",
3-
"version": "1.0.620",
3+
"version": "1.0.621",
44
"description": "AI coding agent",
55
"license": "MIT",
66
"bin": {

cli/src/index.tsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,26 @@ async function main(): Promise<void> {
197197
const startCwd = process.cwd()
198198
const showProjectPicker = shouldShowProjectPicker(startCwd, homeDir)
199199

200+
// Initialize analytics early, before anything that might use the logger
201+
// (the logger calls trackEvent, which throws if analytics isn't initialized)
202+
try {
203+
initAnalytics()
204+
205+
// Track app launch event
206+
trackEvent(AnalyticsEvent.APP_LAUNCHED, {
207+
version: loadPackageVersion(),
208+
platform: process.platform,
209+
arch: process.arch,
210+
hasInitialPrompt: Boolean(initialPrompt),
211+
hasAgentOverride: hasAgentOverride,
212+
continueChat,
213+
initialMode: initialMode ?? 'DEFAULT',
214+
})
215+
} catch (error) {
216+
// Analytics initialization is optional - don't fail the app if it errors
217+
logger.debug(error, 'Failed to initialize analytics')
218+
}
219+
200220
// Initialize agent registry (loads user agents via SDK).
201221
// When --agent is provided, skip local .agents to avoid overrides.
202222
if (isPublishCommand || !hasAgentOverride) {
@@ -231,25 +251,6 @@ async function main(): Promise<void> {
231251
}
232252
}
233253

234-
// Initialize analytics
235-
try {
236-
initAnalytics()
237-
238-
// Track app launch event
239-
trackEvent(AnalyticsEvent.APP_LAUNCHED, {
240-
version: loadPackageVersion(),
241-
platform: process.platform,
242-
arch: process.arch,
243-
hasInitialPrompt: Boolean(initialPrompt),
244-
hasAgentOverride: hasAgentOverride,
245-
continueChat,
246-
initialMode: initialMode ?? 'DEFAULT',
247-
})
248-
} catch (error) {
249-
// Analytics initialization is optional - don't fail the app if it errors
250-
logger.debug(error, 'Failed to initialize analytics')
251-
}
252-
253254
if (clearLogs) {
254255
clearLogFile()
255256
}

knowledge.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,23 @@ Codebuff is a tool for editing codebases via natural-language instructions to Bu
3333

3434
## Development
3535

36-
Start everything:
36+
Start the web server first:
3737

3838
```bash
39-
bun dev
39+
bun up
4040
```
4141

42-
Or run services + CLI separately:
42+
Then start the CLI separately:
4343

4444
```bash
45-
bun up
4645
bun start-cli
47-
bun ps
48-
bun down
46+
```
47+
48+
Other service commands:
49+
50+
```bash
51+
bun ps # check running services
52+
bun down # stop services
4953
```
5054

5155
Worktrees (run multiple stacks on different ports): create `.env.development.local`:

sdk/e2e/utils/e2e-mocks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ async function* promptAiSdkStreamMock(
344344
await params.onCostCalculated(0)
345345
}
346346

347-
return `mock-message-${Math.random().toString(36).slice(2, 10)}`
347+
return promptSuccess(`mock-message-${Math.random().toString(36).slice(2, 10)}`)
348348
}
349349

350350
async function promptAiSdkMock(
@@ -393,7 +393,7 @@ export function setupE2eMocks(): void {
393393
async ({ fields }) =>
394394
Object.fromEntries(
395395
fields.map((field) => [field, MOCK_USER[field]]),
396-
) as Awaited<ReturnType<typeof databaseModule.getUserInfoFromApiKey>>,
396+
) as unknown as Awaited<ReturnType<typeof databaseModule.getUserInfoFromApiKey>>,
397397
)
398398
spyOn(databaseModule, 'fetchAgentFromDatabase').mockImplementation(
399399
async ({ parsedAgentId }) => buildMockAgentTemplate(parsedAgentId),

web/src/content/advanced/troubleshooting.mdx

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ order: 1
99

1010
[Open an issue](https://github.com/CodebuffAI/codebuff/issues) or check existing reports.
1111

12+
## Install Node
13+
14+
If you don't have `npm`, [get Node here](https://nodejs.org/en/download).
15+
16+
## Delete local cache
17+
18+
Codebuff stores files at `~/.config/manicode` including the binary `codebuff`. Sometimes deleting the binary and restarting codebuff will fix issues.
19+
1220
## Version
1321

1422
The latest version of the Codebuff client can be found on the [npm page](https://www.npmjs.com/package/codebuff).
@@ -17,10 +25,6 @@ Run `codebuff --version` to make sure you're on the latest version.
1725

1826
Codebuff should auto-update. If not, try the steps below.
1927

20-
## Codebuff not updating
21-
22-
If you see the npm install run but Codebuff still isn't at the latest version, this is most likely an issue with npm's cache. Try running `npm cache clean --force` and then `npm install -g codebuff`.
23-
2428
## Install failed
2529

2630
If `npm install -g codebuff` gave you an error regarding permissions, try using setting the owner of that directory to your user.
@@ -39,27 +43,6 @@ Include recent chats if you ask for help.
3943

4044
## Common Issues
4145

42-
### Connection Issues
43-
44-
If you see a message like this:
45-
46-
```bash
47-
/Users/<youruser>/Library/pnpm/global/5/.pnpm/codebuff@someversion/node_modules/codebuff/dist/common/websockets/websocket-client.js:158
48-
reject(new Error(`Websocket message with txid ${txid} timed out.`)); ^
49-
50-
Error: Websocket message with txid 32 timed out.
51-
at Timeout._onTimeout (/Users/<youruser>/Library/pnpm/global/5/.pnpm/codebuff@someversion/node_modules/codebuff/dist/common/websockets/websocket-client.js:158:28)
52-
at listOnTimeout (node:internal/timers:594:17)
53-
at process.processTimers (node:internal/timers:529:7)
54-
55-
Node.js v22.12.0
56-
```
57-
58-
it means you're having connection issues. In that case, try:
59-
60-
1. Check your internet connection.
61-
2. Try logging out and back in with `logout` followed by `login`.
62-
6346
### Endless Auto-Updates
6447

6548
If Codebuff keeps trying to update itself in a loop, check the items below:

web/src/content/advanced/what-models.mdx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,27 @@ Codebuff uses different models for different tasks. The orchestrator coordinates
1414
The main agent ("Buffy") coordinates everything:
1515

1616
<MarkdownTable>
17-
| Mode | Model | |------|-------| | Default | Claude Opus 4.6 | | Max | Claude
18-
Opus 4.6 | | Free | MiniMax M2.5 |
17+
| Mode | Model |
18+
|------|-------|
19+
| Default | Opus 4.6 |
20+
| Plan | Opus 4.6 |
21+
| Max | Opus 4.6 |
22+
| Free | MiniMax M2.5 |
1923
</MarkdownTable>
2024

2125
## Subagents
2226

2327
The orchestrator spawns these for specific jobs:
2428

2529
<MarkdownTable>
26-
| Task | Models | |------|--------| | Code editing | Claude Opus 4.6, GLM 4.7
27-
| | Thinking/reasoning | Claude Opus 4.6, GPT-5.2 | | Code review | Claude
28-
Opus 4.6, GPT-5.2 | | File discovery | Gemini 2.5 Flash Lite, Grok 4.1 Fast |
29-
| Terminal commands | Claude Haiku 4.5, Grok 4.1 Fast | | Web/docs research |
30-
Grok 4.1 Fast |
30+
| Task | Models |
31+
|------|--------|
32+
| Code editing | Claude Opus 4.6, GLM 4.7 |
33+
| Thinking/reasoning | Claude Opus 4.6, GPT-5.2 |
34+
| Code review | Claude Opus 4.6, GPT-5.2 |
35+
| File discovery | Gemini 2.5 Flash Lite, Grok 4.1 Fast |
36+
| Terminal commands | Claude Haiku 4.5, Grok 4.1 Fast |
37+
| Web/docs research | Grok 4.1 Fast |
3138
</MarkdownTable>
3239

3340
Max mode runs multiple implementations in parallel and picks the best one. Default mode runs a single implementation pass. Free mode uses MiniMax M2.5 and includes code review support.

web/src/content/help/quick-start.mdx

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,19 @@ cd /path/to/your-repo
2727
codebuff
2828
```
2929

30-
Codebuff has multiple [modes](/docs/tips/modes): `plan` for planning without file changes, `max` for better results at higher cost and time. You can invoke them in the slash menu with `/mode`.
30+
Check out the [modes](/docs/tips/modes) for using Codebuff, such as Free, Max, or Plan.
3131

3232
## 4. Initialize Your Project (Optional)
3333

34-
Run the `/init` command inside Codebuff to set up project-specific files:
35-
36-
```
37-
/init
38-
```
39-
40-
### What `/init` Creates
41-
42-
- `knowledge.md` — A starter file for documenting your project's setup commands, architecture, and coding conventions. Codebuff reads this to understand your project better.
43-
- `.agents/types/` — TypeScript type definitions for creating custom agents.
44-
45-
### When to Use `/init`
34+
Run the `/init` command inside Codebuff to set up project-specific files. Useful for:
4635

4736
- **New projects** — if you don't already have an AGENTS.md or CLAUDE.md (Codebuff will also read these files).
4837
- **Building custom agents** — running /init is the first step to [creating your own agents](/docs/walkthroughs/creating-your-first-agent)!
4938

5039
## Troubleshooting
5140

52-
If you run into issues during installation:
53-
54-
1. **Permission issues** — The best fix is to install Node.js using [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm), which avoids permission problems entirely. Then run `npm install -g codebuff` again.
41+
- Make sure you have [node installed](https://nodejs.org/en/download) (which includes npm).
5542

56-
2. **Still Having Problems?**
57-
- On Mac/Linux, you can fix permissions with: `sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}`
58-
- On Windows, run your terminal as administrator
43+
- Try deleting the downloaded binary at `~/.config/manicode/codebuff` and restarting codebuff.
5944

60-
[Troubleshooting](/docs/advanced/troubleshooting) | [Discord](https://codebuff.com/discord)
45+
See [here](/docs/advanced/troubleshooting) for more help or ask in our [Discord](https://codebuff.com/discord).

web/src/content/tips/modes.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ order: 2
1010
Codebuff has four modes. Switch during a session with `Shift+Tab` or `/mode:` commands.
1111

1212
<MarkdownTable>
13-
| Mode | Model | Editor Agent | Code Review | | --- | --- | --- | --- | --- |
14-
| Default | Claude Opus 4.6 | editor | Yes | | Max | Claude Opus 4.6 |
15-
editor-multi-prompt | Yes | | Plan | Claude Opus 4.6 | None | No | | Free |
16-
MiniMax M2.5 | editor-lite | No |
13+
| Mode | Model | Editor Agent | Code Review |
14+
| --- | --- | --- | --- | --- |
15+
| Default | Claude Opus 4.6 | editor | Yes |
16+
| Max | Claude Opus 4.6 | editor-multi-prompt | Yes |
17+
| Plan | Claude Opus 4.6 | None | No |
18+
| Free | MiniMax M2.5 | editor-lite | No |
1719
</MarkdownTable>
1820

1921
## Default

0 commit comments

Comments
 (0)