@agentbrain/cli 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +94 -13
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,6 +10,19 @@ npm install -g @agentbrain/cli
10
10
 
11
11
  ## Quick Start
12
12
 
13
+ ```bash
14
+ # ONE-TIME SETUP: Complete automated setup
15
+ cd /path/to/your/project
16
+ agentbrain setup
17
+
18
+ # That's it! AgentBrain now:
19
+ # ✓ Generates context automatically on commits
20
+ # ✓ Injects loading instructions into agent files
21
+ # ✓ Keeps everything in sync with your codebase
22
+ ```
23
+
24
+ ### Manual Setup (Advanced)
25
+
13
26
  ```bash
14
27
  # Configure your API key
15
28
  agentbrain config
@@ -27,6 +40,48 @@ agentbrain handoff
27
40
 
28
41
  ## Commands
29
42
 
43
+ ### `agentbrain setup`
44
+
45
+ **One-command automated setup** for AgentBrain in your repository.
46
+
47
+ **Usage:**
48
+ ```bash
49
+ agentbrain setup [options]
50
+ ```
51
+
52
+ **Options:**
53
+ - `--path <path>` - Repository path (default: current directory)
54
+ - `--skip-hooks` - Skip git hooks installation
55
+ - `--skip-agent-files` - Skip agent file injection
56
+
57
+ **What it does:**
58
+ 1. Detects which agents you use (Claude Code, Cursor, Windsurf)
59
+ 2. Generates initial context documentation
60
+ 3. Injects context loading instructions into agent files
61
+ 4. Installs smart git hooks for automatic regeneration
62
+ 5. Sets up complete automation
63
+
64
+ **Output:**
65
+ - Creates `agentbrain/` directory with context docs
66
+ - Updates `CLAUDE.md`, `.cursorrules`, and/or `.windsurfrules`
67
+ - Installs `.git/hooks/post-commit` for smart auto-regeneration
68
+
69
+ **Example:**
70
+ ```bash
71
+ # Complete automated setup
72
+ agentbrain setup
73
+
74
+ # Setup without git hooks
75
+ agentbrain setup --skip-hooks
76
+ ```
77
+
78
+ **Cost:** ~$0.02-0.05 for initial generation (cached repeats are free)
79
+
80
+ **Smart Git Hooks:**
81
+ After setup, AgentBrain automatically regenerates context when you commit **source file changes**. It intelligently skips regeneration when only documentation or configuration files change, saving time and API costs.
82
+
83
+ ---
84
+
30
85
  ### `agentbrain init`
31
86
 
32
87
  Generate comprehensive context documentation for your repository.
@@ -87,8 +142,8 @@ agentbrain standards [options]
87
142
 
88
143
  **Output:**
89
144
  Creates agent-specific files:
90
- - `CLAUDE.md` - For Claude Code
91
- - `.cursor/rules` - For Cursor
145
+ - `CLAUDE.md` - For Claude Code CLI
146
+ - `.cursorrules` - For Cursor (also supports legacy `.cursor/rules`)
92
147
  - `.windsurfrules` - For Windsurf
93
148
 
94
149
  **Example:**
@@ -221,23 +276,29 @@ This stores the key securely at `~/.agentbrain/config.json` with 0600 permission
221
276
 
222
277
  ## Usage with AI Agents
223
278
 
224
- ### Claude Code
279
+ After running `agentbrain setup`, your agents automatically load context at every session start.
225
280
 
226
- Add to your workspace:
227
- ```markdown
228
- <!-- In CLAUDE.md or prompt -->
229
- @agentbrain/context.md
230
- @agentbrain/dependency-map.md
231
- @agentbrain/patterns.md
232
- ```
281
+ ### Claude Code CLI
282
+
283
+ AgentBrain injects loading instructions into `CLAUDE.md`, which Claude Code CLI reads automatically from your project root. No manual action needed.
233
284
 
234
285
  ### Cursor
235
286
 
236
- Cursor automatically loads `.cursor/rules` generated by `agentbrain standards`.
287
+ AgentBrain injects loading instructions into `.cursorrules` (or `.cursor/rules` for legacy setups), which Cursor reads automatically. No manual action needed.
237
288
 
238
289
  ### Windsurf
239
290
 
240
- Windsurf automatically loads `.windsurfrules` generated by `agentbrain standards`.
291
+ AgentBrain injects loading instructions into `.windsurfrules`, which Windsurf reads automatically. No manual action needed.
292
+
293
+ ### Manual Loading (Advanced)
294
+
295
+ If not using `agentbrain setup`, you can manually reference context files:
296
+ ```markdown
297
+ <!-- In agent prompt or rules file -->
298
+ @agentbrain/context.md
299
+ @agentbrain/dependency-map.md
300
+ @agentbrain/patterns.md
301
+ ```
241
302
 
242
303
  ## Cost Estimates
243
304
 
@@ -255,6 +316,26 @@ All costs are approximate (as of January 2025):
255
316
 
256
317
  ## Workflow Example
257
318
 
319
+ ### Recommended: Automated Setup
320
+
321
+ ```bash
322
+ # 1. One-time setup (do once per repo)
323
+ cd /path/to/project
324
+ agentbrain setup
325
+
326
+ # 2. Start coding - context auto-updates on commits!
327
+ # ... make changes ...
328
+ git commit -m "Add feature"
329
+ # → AgentBrain automatically regenerates context (if source files changed)
330
+
331
+ # 3. Generate handoff when needed
332
+ agentbrain handoff --goal "Completed authentication feature"
333
+
334
+ # That's it! Everything else is automatic.
335
+ ```
336
+
337
+ ### Manual Setup (Advanced)
338
+
258
339
  ```bash
259
340
  # 1. Initial setup
260
341
  cd /path/to/project
@@ -271,7 +352,7 @@ agentbrain standards
271
352
  # ... make changes ...
272
353
  agentbrain handoff --goal "Add authentication feature"
273
354
 
274
- # 5. Regenerate context after major changes
355
+ # 5. Manually regenerate context after changes
275
356
  agentbrain init # Only costs money if git hash changed
276
357
  ```
277
358
 
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ const program = new Command();
10
10
  program
11
11
  .name('agentbrain')
12
12
  .description('Generate smart context docs for coding agents')
13
- .version('1.3.0');
13
+ .version('1.3.2');
14
14
  // Add commands
15
15
  program.addCommand(createSetupCommand());
16
16
  program.addCommand(createInitCommand());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentbrain/cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "CLI for AgentBrain - generate smart context documentation for coding agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",