byterover-cli 0.1.0 → 0.2.0

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 (47) hide show
  1. package/README.md +108 -653
  2. package/bin/dev.cmd +1 -1
  3. package/bin/dev.js +1 -1
  4. package/bin/run.cmd +1 -1
  5. package/bin/run.js +1 -1
  6. package/dist/commands/add.d.ts +4 -15
  7. package/dist/commands/add.js +31 -69
  8. package/dist/commands/init.js +13 -8
  9. package/dist/commands/push.d.ts +6 -4
  10. package/dist/commands/push.js +39 -9
  11. package/dist/commands/retrieve.d.ts +2 -2
  12. package/dist/commands/retrieve.js +3 -3
  13. package/dist/commands/space/list.js +10 -5
  14. package/dist/commands/space/switch.js +8 -7
  15. package/dist/commands/status.js +5 -6
  16. package/dist/config/environment.d.ts +3 -2
  17. package/dist/config/environment.js +13 -11
  18. package/dist/constants.d.ts +8 -1
  19. package/dist/constants.js +8 -1
  20. package/dist/core/domain/entities/{br-config.d.ts → brv-config.d.ts} +5 -5
  21. package/dist/core/domain/entities/{br-config.js → brv-config.js} +5 -5
  22. package/dist/core/domain/entities/playbook.d.ts +4 -0
  23. package/dist/core/domain/entities/playbook.js +7 -0
  24. package/dist/core/interfaces/i-playbook-service.d.ts +1 -1
  25. package/dist/core/interfaces/i-project-config-store.d.ts +10 -10
  26. package/dist/hooks/init/welcome.d.ts +3 -0
  27. package/dist/hooks/init/welcome.js +31 -0
  28. package/dist/infra/ace/ace-file-utils.js +2 -2
  29. package/dist/infra/ace/file-bullet-content-store.d.ts +4 -4
  30. package/dist/infra/ace/file-bullet-content-store.js +7 -7
  31. package/dist/infra/ace/file-delta-store.d.ts +1 -1
  32. package/dist/infra/ace/file-delta-store.js +1 -1
  33. package/dist/infra/ace/file-executor-output-store.d.ts +1 -1
  34. package/dist/infra/ace/file-executor-output-store.js +1 -1
  35. package/dist/infra/ace/file-playbook-store.d.ts +3 -3
  36. package/dist/infra/ace/file-playbook-store.js +6 -6
  37. package/dist/infra/ace/file-reflection-store.d.ts +1 -1
  38. package/dist/infra/ace/file-reflection-store.js +1 -1
  39. package/dist/infra/config/file-config-store.d.ts +6 -8
  40. package/dist/infra/config/file-config-store.js +10 -11
  41. package/dist/infra/playbook/file-playbook-service.d.ts +0 -1
  42. package/dist/infra/playbook/file-playbook-service.js +7 -8
  43. package/dist/templates/README.md +5 -5
  44. package/dist/templates/sections/command-reference.md +23 -23
  45. package/dist/templates/sections/workflow.md +3 -4
  46. package/oclif.manifest.json +10 -3
  47. package/package.json +8 -5
package/README.md CHANGED
@@ -1,69 +1,43 @@
1
1
  # ByteRover CLI
2
2
 
3
- Command-line interface for ByteRover, enabling seamless project management, authentication, and workspace operations directly from your terminal.
3
+ Command-line interface for ByteRover, enabling seamless team/space management, authentication, and space's memory operations directly from your terminal.
4
4
 
5
- [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
6
5
  [![Version](https://img.shields.io/npm/v/byterover-cli.svg)](https://npmjs.org/package/byterover-cli)
7
6
  [![Downloads/week](https://img.shields.io/npm/dw/byterover-cli.svg)](https://npmjs.org/package/byterover-cli)
8
- [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
- [![Node](https://img.shields.io/badge/node-%3E%3D22.0.0-brightgreen.svg)](https://nodejs.org)
7
+ [![Node](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org)
8
+
9
+ ## Important
10
+
11
+ Starting with version **0.2.0**, the ByteRover CLI command has been renamed from `br` to `brv` to avoid conflicts with [broot](https://github.com/Canop/broot), another popular CLI tool that also uses the `br` command.
12
+
13
+ This is a **breaking change** that requires action from existing users.
14
+
15
+ Please check the migration guide [here](https://docs.byterover.dev/beta/migration-br-brv).
10
16
 
11
17
  ## Table of Contents
12
18
 
13
- <!-- toc -->
14
- * [Development Testing](#development-testing)
15
19
  * [Installation](#installation)
16
20
  * [Quick Start](#quick-start)
17
- * [Agentic Context Engineering (ACE)](#agentic-context-engineering-ace)
21
+ * [What is ACE?](#what-is-ace)
22
+ * [Core Workflow](#core-workflow)
23
+ * [Essential Commands](#essential-commands)
18
24
  * [Authentication](#authentication)
19
- * [Usage](#usage)
20
- * [Commands](#commands)
21
25
  * [Configuration](#configuration)
22
- * [Development](#development)
23
- * [Architecture](#architecture)
24
- <!-- tocstop -->
25
-
26
- ## Development Testing
27
-
28
- Make sure you're on the `develop` branch.
29
-
30
- Build:
31
-
32
- ```bash
33
- npm run build
34
- ```
35
-
36
- In `./bin/run.js`, change `process.env.BR_ENV` to `'development'`.
37
-
38
- Run:
39
-
40
- ```bash
41
- npm link
42
- ```
43
-
44
- This will:
45
-
46
- - Create a **folder symlink** `<npm_global_prefix>/lib/node_modules/<package_name>`
47
- which points to the **package's directory**.
48
- - Create a symlink for **the package's bin**
49
- in
50
- `<npm_global_prefix>/bin/<package_bin_command_or_package_name>`
51
- which points to
52
- `<npm_global_prefix>/lib/node_modules/<package_name>/<path_to_executable>`.
53
- - Register the package as being globally installed.
54
-
55
- Once testing is done, the package can be "unlink" by:
56
-
57
- ```bash
58
- npm uninstall -g package-name
59
- ```
26
+ * [Getting Help](#getting-help)
60
27
 
61
28
  ## Installation
62
29
 
63
30
  ### Requirements
64
31
 
65
- - **Node.js**: >= 22.0.0
66
- - **Operating System**: macOS (keychain integration for secure token storage)
32
+ - **Node.js**: >= 18.0.0
33
+ - **Operating System**:
34
+ - macOS
35
+ - Windows
36
+ - Linux
37
+ - Currently this CLI uses `libsecret`. Depending on your distribution, you will need to run the following command:
38
+ - Debian/Ubuntu: `sudo apt-get install libsecret-1-dev`
39
+ - Red Hat-based: `sudo yum install libsecret-devel`
40
+ - Arch Linux: `sudo pacman -S libsecret`
67
41
 
68
42
  ### Install globally via npm
69
43
 
@@ -74,17 +48,19 @@ npm install -g byterover-cli
74
48
  ### Verify installation
75
49
 
76
50
  ```bash
77
- br --version
51
+ brv --version
78
52
  ```
79
53
 
80
54
  ## Quick Start
81
55
 
56
+ Visit [**ByteRover's Beta Docs**](https://docs.byterover.dev/beta) for more information.
57
+
82
58
  Get started with ByteRover CLI in three simple steps:
83
59
 
84
60
  ### 1. Authenticate
85
61
 
86
62
  ```bash
87
- br login
63
+ brv login
88
64
  ```
89
65
 
90
66
  This opens your browser to complete OAuth authentication. Your credentials are securely stored in the system keychain.
@@ -92,21 +68,21 @@ This opens your browser to complete OAuth authentication. Your credentials are s
92
68
  ### 2. Initialize a project
93
69
 
94
70
  ```bash
95
- cd your-project-directory
96
- br init
71
+ cd to/your/project
72
+ brv init
97
73
  ```
98
74
 
99
- Select a workspace from your available spaces and configure your project.
75
+ Select a space from your available spaces and configure your project.
100
76
 
101
77
  ### 3. Start using ByteRover
102
78
 
103
79
  You're ready to use ByteRover commands in your project!
104
80
 
105
- ## Agentic Context Engineering (ACE)
81
+ ## What is ACE?
106
82
 
107
- **ACE** is a systematic workflow for coding agents (like Claude Code, Cursor, etc.) to capture their work, learn from feedback, and build cumulative knowledge in a living playbook.
83
+ **Agentic Context Engineering (ACE)** is a systematic workflow that helps coding agents (like Claude Code, Cursor, etc.) capture their work, learn from feedback, and build cumulative knowledge in a living playbook.
108
84
 
109
- This implementation is based on the research paper: [**Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models**](https://arxiv.org/abs/2510.04618) by Dang et al., which introduces a framework for language models to iteratively improve their performance through structured context evolution.
85
+ Based on the research paper [**Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models**](https://arxiv.org/abs/2510.04618) by Dang et al., ACE enables language models to iteratively improve their performance through structured context evolution.
110
86
 
111
87
  ### Why Use ACE?
112
88
 
@@ -115,667 +91,146 @@ This implementation is based on the research paper: [**Agentic Context Engineeri
115
91
  - **Context Persistence**: Maintain project-specific best practices that improve over time
116
92
  - **Traceability**: Track what worked, what didn't, and why
117
93
 
118
- ### The ACE Workflow
94
+ ## Core Workflow
95
+
96
+ ACE follows a simple 3-phase cycle that coding agents can use to improve over time:
97
+
98
+ ### 1. Executor
99
+ Agent performs coding task and saves detailed output with context.
100
+
101
+ ### 2. Reflector
102
+ Agent analyzes results and provides honest feedback on what worked and what didn't.
119
103
 
120
- ACE follows a 3-phase cycle:
104
+ ### 3. Curator
105
+ Agent transforms insights into playbook updates that are automatically applied to improve future work.
121
106
 
122
- 1. **Executor** - Agent performs coding task and saves output with detailed context
123
- 2. **Reflector** - Agent analyzes results and provides honest feedback
124
- 3. **Curator** - Agent transforms insights into playbook updates (automatically applied)
107
+ ### Quick Example
125
108
 
126
- ### Quick ACE Example
109
+ If you're using a coding agent like Claude Code:
127
110
 
128
111
  ```bash
129
112
  # Complete ACE workflow in a single command
130
- br complete "auth-feature" \
113
+ brv complete "auth-feature" \
131
114
  "Implemented JWT authentication with secure token handling" \
132
115
  "Successfully added OAuth2 authentication" \
133
116
  --tool-usage "Read:src/auth.ts,Edit:src/auth.ts,Bash:npm test" \
134
117
  --feedback "All tests passed, auth works correctly"
135
-
136
- # Update an existing playbook bullet
137
- br complete "auth-update" \
138
- "Improved error handling in auth flow" \
139
- "Better error messages for failed login" \
140
- --tool-usage "Edit:src/auth.ts" \
141
- --feedback "Tests passed" \
142
- --update-bullet "bullet-5"
143
118
  ```
144
119
 
145
- ### For Coding Agents
146
-
147
- **📘 Complete ACE Guide**: See [rules](./src/templates/README.md) for comprehensive instructions on using ACE in your development workflow.
120
+ For comprehensive ACE instructions for coding agents, check the corresponding coding agents' instruction files after `brv init` or `brv gen-rules`.
148
121
 
149
- `br gen-rules` (integrated into `br init`) helps users quickly set up their coding agents with the ACE workflow.
122
+ ## Essential Commands
150
123
 
151
- ### ACE Commands
124
+ ### Authentication
152
125
 
153
126
  ```bash
154
- # Complete ACE workflow (executor + reflector + curator in one command)
155
- br complete <hint> <reasoning> <answer> \
156
- --tool-usage <tools> \
157
- --feedback <feedback> \
158
- [--bullet-ids <ids>] \
159
- [--update-bullet <id>] # Complete workflow: save, reflect, and update playbook
160
-
161
- # Direct playbook manipulation (bypasses ACE workflow)
162
- br add -s "Section" -c "Content" # Add new bullet (auto-generates ID)
163
- br add -s "Section" -c "Updated" -b "bullet-id" # Update existing bullet
127
+ # Log in to ByteRover
128
+ brv login
164
129
 
165
- # Memory operations
166
- br push [--branch name] # Push playbook to blob storage and cleanup local files
167
- br retrieve --query <text> [--node-keys <paths>] # Retrieve memories from ByteRover and load into playbook
168
-
169
- # Utility commands
170
- br status # View CLI status and playbook statistics
171
- br clear [--yes] # Reset playbook
130
+ # Check your authentication and project status
131
+ brv status
172
132
  ```
173
133
 
174
- #### Quick Add Command
175
-
176
- For agents that need to quickly add context without the full ACE workflow:
134
+ ### Project Setup
177
135
 
178
136
  ```bash
179
- # 1. First, check the current playbook
180
- br show
137
+ # Initialize project with ByteRover
138
+ brv init
181
139
 
182
- # 2. Add a new bullet to an existing or new section
183
- br add -s "Common Errors" -c "Always validate API responses before processing"
140
+ # List available spaces
141
+ brv space list
184
142
 
185
- # 3. Update an existing bullet (use ID from br show)
186
- br add -s "Common Errors" -c "Updated content" -b "common-00001"
143
+ # Switch to a different space or team
144
+ brv space switch
187
145
  ```
188
146
 
189
- The `add` command automatically tags bullets with `['manual']` and is ideal for quick knowledge capture during development.
190
-
191
- ### Memory Push
192
-
193
- The `br push` command uploads your playbook to ByteRover's memory storage (blob storage) and automatically cleans up local ACE files. This is useful when you want to:
194
-
195
- - **Share playbook knowledge** with other team members or agents
196
- - **Archive completed work** to cloud storage
197
- - **Reset local state** after pushing insights to the system
198
- - **Free up local storage** by removing processed ACE outputs
199
-
200
- #### Usage
147
+ ### Memory Operations
201
148
 
202
149
  ```bash
203
- # Push to default branch (main)
204
- br push
205
-
206
- # Push to a specific branch
207
- br push --branch develop
208
- br push -b feature-auth
209
- ```
210
-
211
- #### What Gets Pushed
212
-
213
- - `.br/ace/playbook.json` - Your accumulated knowledge base
214
-
215
- #### What Gets Cleaned Up (After Successful Push)
216
-
217
- After successfully uploading to blob storage, the command automatically:
150
+ # Retrieve memories from ByteRover (outputs to stdout for agent context)
151
+ brv retrieve --query "authentication best practices"
152
+ brv retrieve -q "error handling" -n "src/auth/login.ts,src/auth/oauth.ts"
218
153
 
219
- 1. **Clears playbook content** - Resets to empty playbook (file remains, content cleared)
220
- 2. **Removes executor outputs** - Deletes all files in `.br/ace/executor-outputs/`
221
- 3. **Removes reflections** - Deletes all files in `.br/ace/reflections/`
222
- 4. **Removes deltas** - Deletes all files in `.br/ace/deltas/`
223
-
224
- **Note**: Cleanup only happens after successful upload. If the upload fails, your local files remain unchanged.
225
-
226
- #### Example Output
227
-
228
- ```text
229
- Requesting upload URLs... done
230
- Loading playbook... done
231
-
232
- Uploading files...
233
- Uploading playbook.json... ✓
234
-
235
- Cleaning up local files...
236
- Clearing playbook... ✓
237
- Cleaning executor outputs... ✓ (3 files removed)
238
- Cleaning reflections... ✓ (2 files removed)
239
- Cleaning deltas... ✓ (5 files removed)
240
-
241
- ✓ Successfully pushed playbook to ByteRover memory storage!
242
- Branch: main
243
- Files uploaded: 1
244
- ```
245
-
246
- #### Branches
247
-
248
- The `--branch` parameter refers to **ByteRover's internal branching system**, not Git branches. This allows you to organize different versions of your playbook in blob storage (e.g., `main`, `develop`, `experimental`).
249
-
250
- ### File Organization
251
-
252
- ACE stores all outputs in `.br/ace/` with hint-based naming for traceability:
253
-
254
- ```
255
- .br/ace/
256
- ├── playbook.json # Living knowledge base
257
- ├── executor-outputs/
258
- │ └── executor-{hint}-{timestamp}.json # Your coding work
259
- ├── reflections/
260
- │ └── reflection-{hint}-{timestamp}.json # Analysis and feedback
261
- └── deltas/
262
- └── delta-{hint}-{timestamp}.json # Playbook updates
154
+ # Push your playbook to ByteRover's memory storage
155
+ brv push
263
156
  ```
264
157
 
265
- **Note**: When you run `br push`, all files in `executor-outputs/`, `reflections/`, and `deltas/` are removed after successful upload. The `playbook.json` is cleared (reset to empty). This keeps your local workspace clean while preserving your knowledge in ByteRover's blob storage.
266
-
267
- ### Memory Retrieve
268
-
269
- The `br retrieve` command fetches memories from ByteRover's Memora service and loads them to `stdout` as parts of the coding agents' current context. This is useful when you want to:
270
-
271
- - **Access team knowledge** - Retrieve insights and best practices shared by your team
272
- - **Find relevant context** - Search for specific topics or code patterns
273
- - **Filter by files** - Narrow results to specific file paths using `--node-keys`
274
- - **Start with knowledge** - Begin work with relevant memories already in your playbook
275
-
276
- #### Retrieve Usage
158
+ ### For Coding Agents
277
159
 
278
160
  ```bash
279
- # Retrieve memories by query
280
- br retrieve --query "authentication best practices"
281
-
282
- # Retrieve with file path filtering
283
- br retrieve -q "error handling" -n "src/auth/login.ts,src/auth/oauth.ts"
161
+ # Complete ACE workflow (recommended for agents)
162
+ brv complete <hint> <reasoning> <answer> \
163
+ --tool-usage <tools> \
164
+ --feedback <feedback>
284
165
 
285
- # Short form
286
- br retrieve -q "database connection issues"
166
+ # Generate agent rules (sets up ACE workflow for your coding agent)
167
+ brv gen-rules
287
168
  ```
288
169
 
289
- #### How Retrieve Works
290
-
291
- 1. **Searches** ByteRover's memory storage for matches to your query
292
- 2. **Filters** results by node keys (file paths) if specified
293
- 3. **Clears** your existing local playbook
294
- 4. **Loads** retrieved memories and related memories into `stdout`.
295
-
296
170
  ## Authentication
297
171
 
298
- ByteRover CLI uses **OAuth 2.0 with PKCE** (Proof Key for Code Exchange) for secure authentication:
172
+ ByteRover CLI uses **OAuth 2.0 with PKCE** (Proof Key for Code Exchange) for secure authentication.
299
173
 
300
174
  ### How it works
301
175
 
302
- 1. Run `br login` to initiate authentication
303
- 2. A local callback server starts on a random port
304
- 3. Your default browser opens to the ByteRover authorization page
305
- 4. After successful authentication, tokens are securely stored in your system keychain
306
- 5. All subsequent commands automatically use your stored credentials
176
+ 1. Run `brv login` to start authentication
177
+ 2. Your browser opens to the ByteRover authorization page
178
+ 3. After successful login, tokens are securely stored in your system keychain
179
+ 4. All subsequent commands automatically use your stored credentials
307
180
 
308
181
  ### Security features
309
182
 
310
183
  - **PKCE flow**: Prevents authorization code interception attacks
311
- - **System keychain**: Tokens stored using native OS secure storage (macOS Keychain)
312
- - **Session tracking**: Each authentication session includes a session key for request tracking
184
+ - **System keychain**: Tokens stored in macOS Keychain
185
+ - **Session tracking**: Each session includes a session key for request tracking
313
186
  - **Auto-refresh**: Refresh tokens enable seamless credential renewal
314
187
 
315
- ### Environment-aware
316
-
317
- The CLI supports separate development and production environments:
318
-
319
- - **Development**: Uses `./bin/dev.js` and points to dev authentication servers
320
- - **Production**: Uses `./bin/run.js` and points to production servers
321
-
322
- ### Token storage
323
-
324
- After authentication, the CLI stores:
325
-
326
- - **Access token**: For API authorization (`Authorization: Bearer {token}`)
327
- - **Refresh token**: For obtaining new access tokens
328
- - **Session key**: For request tracking (`x-byterover-session-id` header)
329
- - **Expiration time**: For automatic token refresh
330
-
331
- All tokens are stored in your system keychain via the `keytar` library.
332
-
333
- ## Usage
334
-
335
- ```sh-session
336
- $ npm install -g byterover-cli
337
- $ br COMMAND
338
- running command...
339
- $ br (--version)
340
- byterover-cli/0.0.0 darwin-arm64 node-v22.19.0
341
- $ br --help [COMMAND]
342
- USAGE
343
- $ br COMMAND
344
- ...
345
- ```
346
-
347
- ## Commands
348
-
349
- * [`br add`](#br-add)
350
- * [`br clear`](#br-clear)
351
- * [`br complete`](#br-complete)
352
- * [`br gen-rules`](#br-gen-rules)
353
- * [`br help [COMMAND]`](#br-help-command)
354
- * [`br init`](#br-init)
355
- * [`br login`](#br-login)
356
- * [`br push`](#br-push)
357
- * [`br retrieve`](#br-retrieve)
358
- * [`br space list`](#br-space-list)
359
- * [`br space switch`](#br-space-switch)
360
- * [`br status`](#br-status)
361
-
362
- ## `br add`
363
-
364
- Add or update a bullet in the playbook (bypasses ACE workflow for direct agent usage)
365
-
366
- ```txt
367
- USAGE
368
- $ br add -c <value> -s <value> [-b <value>]
369
-
370
- FLAGS
371
- -b, --bullet-id=<value> Bullet ID to update (if not provided, a new bullet will be created)
372
- -c, --content=<value> (required) Content of the bullet
373
- -s, --section=<value> (required) Section name for the bullet
374
-
375
- DESCRIPTION
376
- Add or update a bullet in the playbook (bypasses ACE workflow for direct agent usage)
377
-
378
- This command allows agents to directly manipulate the playbook without going through
379
- the full ACE workflow (executor → reflector → curator → apply-delta). Use this for
380
- quick knowledge capture during development.
381
-
382
- Before using this command, run 'br show' to view existing sections and bullet IDs.
383
-
384
- EXAMPLES
385
- $ br add --section "Common Errors" --content "Always validate API responses"
386
-
387
- $ br add --section "Common Errors" --bullet-id "common-00001" --content "Updated: Validate and sanitize API responses"
388
-
389
- $ br add -s "Best Practices" -c "Use dependency injection for better testability"
390
- ```
391
-
392
- ## `br clear`
393
-
394
- Clear local ACE context (playbook) managed by ByteRover CLI
395
-
396
- ```txt
397
- USAGE
398
- $ br clear [DIRECTORY] [-y]
399
-
400
- ARGUMENTS
401
- DIRECTORY Project directory (defaults to current directory)
402
-
403
- FLAGS
404
- -y, --yes Skip confirmation prompt
405
-
406
- DESCRIPTION
407
- Clear local ACE context (playbook) managed by ByteRover CLI
408
-
409
- EXAMPLES
410
- $ br clear
411
-
412
- $ br clear --yes
413
-
414
- $ br clear /path/to/project
415
- ```
416
-
417
- ## `br complete`
418
-
419
- Complete ACE workflow: save executor output, generate reflection, and update playbook in one command
420
-
421
- ```txt
422
- USAGE
423
- $ br complete HINT REASONING FINALANSWER -t <value> -f <value> [-b <value>] [-u <value>]
424
-
425
- ARGUMENTS
426
- HINT Short hint for naming output files (e.g., "user-auth", "bug-fix")
427
- REASONING Detailed reasoning and approach for completing the task
428
- FINALANSWER The final answer/solution to the task
429
-
430
- FLAGS
431
- -b, --bullet-ids=<value> Comma-separated list of playbook bullet IDs referenced
432
- -f, --feedback=<value> (required) Environment feedback about task execution (e.g., "Tests passed", "Build failed")
433
- -t, --tool-usage=<value> (required) Comma-separated list of tool calls with arguments (format: "ToolName:argument", e.g., "Read:src/file.ts,Bash:npm test")
434
- -u, --update-bullet=<value> Bullet ID to update with new knowledge (if not provided, adds new bullet)
435
-
436
- DESCRIPTION
437
- Complete ACE workflow: save executor output, generate reflection, and update playbook in one command
438
-
439
- This command executes the full ACE (Agentic Context Engineering) workflow in a single step:
440
- 1. Executor phase: Saves your task output with detailed context
441
- 2. Reflector phase: Analyzes results and generates reflection
442
- 3. Curator phase: Updates the playbook with new knowledge
443
-
444
- EXAMPLES
445
- $ br complete "user-auth" "Implemented OAuth2 flow" "Auth works" --tool-usage "Read:src/auth.ts,Edit:src/auth.ts,Bash:npm test" --feedback "All tests passed"
446
-
447
- $ br complete "validation-fix" "Analyzed validator" "Fixed bug" --tool-usage "Grep:pattern:\"validate\",Read:src/validator.ts" --bullet-ids "bullet-123" --feedback "Tests passed"
448
-
449
- $ br complete "auth-update" "Improved error handling" "Better errors" --tool-usage "Edit:src/auth.ts" --feedback "Tests passed" --update-bullet "bullet-5"
450
- ```
451
-
452
- ## `br gen-rules`
453
-
454
- Generate rule instructions for coding agents to work with ByteRover correctly
455
-
456
- ```txt
457
- USAGE
458
- $ br gen-rules
459
-
460
- DESCRIPTION
461
- Generate rule instructions for coding agents to work with ByteRover correctly
462
-
463
- This command generates agent-specific rule files that provide instructions for coding agents
464
- (like Claude Code, Cursor, Aider, etc.) to work correctly with ByteRover CLI and the ACE workflow.
465
-
466
- EXAMPLES
467
- $ br gen-rules
468
- ```
469
-
470
- ## `br login`
471
-
472
- Authenticate with ByteRover
473
-
474
- ```txt
475
- USAGE
476
- $ br login
477
-
478
- DESCRIPTION
479
- Authenticate with ByteRover
480
- ```
481
-
482
- ## `br help [COMMAND]`
483
-
484
- Display help for br.
485
-
486
- ```txt
487
- USAGE
488
- $ br help [COMMAND...] [-n]
489
-
490
- ARGUMENTS
491
- COMMAND... Command to show help for.
492
-
493
- FLAGS
494
- -n, --nested-commands Include all nested commands in the output.
495
-
496
- DESCRIPTION
497
- Display help for br.
498
- ```
499
-
500
- ## `br init`
501
-
502
- Initialize a project with ByteRover
503
-
504
- ```txt
505
- USAGE
506
- $ br init
507
-
508
- DESCRIPTION
509
- Initialize a project with ByteRover
510
-
511
- EXAMPLES
512
- $ br init
513
- ```
514
-
515
- ## `br push`
516
-
517
- Push playbook to ByteRover memory storage and clean up local ACE files
518
-
519
- ```txt
520
- USAGE
521
- $ br push [-b <value>]
522
-
523
- FLAGS
524
- -b, --branch=<value> [default: main] ByteRover branch name (not Git branch)
525
-
526
- DESCRIPTION
527
- Push playbook to ByteRover memory storage and clean up local ACE files
528
-
529
- This command uploads your playbook to ByteRover's memory storage and automatically cleans up
530
- local ACE files after successful upload. The cleanup includes:
531
- - Clearing playbook content
532
- - Removing executor outputs
533
- - Removing reflections
534
- - Removing deltas
535
-
536
- EXAMPLES
537
- $ br push
538
-
539
- $ br push --branch develop
540
-
541
- $ br push -b feature-auth
542
- ```
543
-
544
- ## `br retrieve`
545
-
546
- Retrieve memories from ByteRover Memora service and output as JSON
547
-
548
- ```txt
549
- USAGE
550
- $ br retrieve -q <value> [-n <value>] [--compact]
551
-
552
- FLAGS
553
- -n, --node-keys=<value> Comma-separated list of node keys (file paths) to filter results
554
- -q, --query=<value> (required) Search query string
555
- --compact Output compact JSON (single line)
556
-
557
- DESCRIPTION
558
- Retrieve memories from ByteRover Memora service and output as JSON
559
-
560
- This command fetches memories from ByteRover's memory storage based on your query.
561
- You can optionally filter results by specific file paths using the --node-keys flag.
562
-
563
- EXAMPLES
564
- $ br retrieve --query "authentication best practices"
565
-
566
- $ br retrieve -q "error handling" -n "src/auth/login.ts,src/auth/oauth.ts"
567
-
568
- $ br retrieve -q "database connection issues" --compact
569
- ```
570
-
571
- ## `br status`
572
-
573
- Show CLI status and project information
574
-
575
- ```txt
576
- USAGE
577
- $ br status
578
-
579
- DESCRIPTION
580
- Show CLI status and project information
581
-
582
- Displays comprehensive information about your ByteRover CLI setup including:
583
- - CLI version
584
- - Authentication status (with user email if logged in)
585
- - Current working directory
586
- - Project initialization status (with connected space if initialized)
587
-
588
- EXAMPLES
589
- $ br status
590
- ```
591
-
592
- ## `br space list`
593
-
594
- List all spaces for the current team (requires project initialization)
595
-
596
- ```txt
597
- USAGE
598
- $ br space list [-a] [-j] [-l <value>] [-o <value>]
599
-
600
- FLAGS
601
- -a, --all Fetch all spaces (may be slow for large teams)
602
- -j, --json Output in JSON format
603
- -l, --limit=<value> [default: 50] Maximum number of spaces to fetch
604
- -o, --offset=<value> [default: 0] Number of spaces to skip
605
-
606
- DESCRIPTION
607
- List all spaces for the current team (requires project initialization)
608
-
609
- This command lists all available spaces in the current team. By default, it shows 50 spaces.
610
- Use --all to fetch all spaces or use --limit and --offset for manual pagination.
611
-
612
- EXAMPLES
613
- $ br space list
614
-
615
- $ br space list --all
616
-
617
- $ br space list --limit 10
618
-
619
- $ br space list --limit 10 --offset 20
620
-
621
- $ br space list --json
622
- ```
623
-
624
- ## `br space switch`
625
-
626
- Switch to a different team or space (updates .br/config.json)
627
-
628
- ```txt
629
- USAGE
630
- $ br space switch
631
-
632
- DESCRIPTION
633
- Switch to a different team or space (updates .br/config.json)
634
-
635
- This command allows you to switch your project to a different team or space.
636
- It shows your current configuration, then prompts you to select a new team and space.
637
- The configuration is updated in .br/config.json.
638
-
639
- EXAMPLES
640
- $ br space switch
641
- ```
642
-
643
188
  ## Configuration
644
189
 
645
- ### Environment Configuration
646
-
647
- ByteRover CLI supports runtime environment selection:
648
-
649
- * **Development Environment** (`./bin/dev.js`)
650
- * Issuer URL: `https://dev-beta-iam.byterover.dev/api/v1/oidc`
651
- * Client ID: `byterover-cli-client`
652
- * Scopes: `read`, `write`, `debug`
653
-
654
- * **Production Environment** (`./bin/run.js`)
655
- * Issuer URL: `https://prod-beta-iam.byterover.dev/api/v1/oidc`
656
- * Client ID: `byterover-cli-prod`
657
- * Scopes: `read`, `write`
658
-
659
- The environment is automatically set when you run the CLI:
660
-
661
- ```bash
662
- # Development mode
663
- ./bin/dev.js [command]
664
-
665
- # Production mode (installed globally)
666
- br [command]
667
- ```
668
-
669
- ### Environment Variables
670
-
671
- * **BR_ENV** - Runtime environment (`development` | `production`) - automatically set by launcher scripts
672
-
673
190
  ### Project Configuration
674
191
 
675
- When you run `br init`, a configuration file is created at `.byterover/config.json` in your project directory. This file contains:
192
+ When you run `brv init`, a configuration file is created at `.brv/config.json` in your project directory containing:
676
193
 
677
- * **Space ID**: The ByteRover workspace/space associated with this project
678
- * **Project settings**: Project-specific configuration
679
- * **User's information**: User's ID and user's email.
194
+ - **Space ID**: The ByteRover workspace/space associated with this project
195
+ - **User information**: Your user ID and email
196
+ - **Project settings**: Project-specific configuration
680
197
 
681
- ## Development
198
+ ### ACE File Structure
682
199
 
683
- ### Clone and Setup
200
+ ACE stores all outputs in `.brv/ace/`:
684
201
 
685
- ```bash
686
- git clone https://github.com/campfirein/byterover-cli.git
687
- cd byterover-cli
688
- npm install
689
202
  ```
690
-
691
- ### Build
692
-
693
- ```bash
694
- npm run build
695
- ```
696
-
697
- Compiles TypeScript to JavaScript in the `dist/` directory.
698
-
699
- ### Test
700
-
701
- ```bash
702
- # Run all tests
703
- npm test
704
-
705
- # Run a specific test file
706
- npx mocha --forbid-only "test/path/to/file.test.ts"
203
+ .brv/ace/
204
+ ├── playbook.json # Your living knowledge base
205
+ ├── executor-outputs/ # Coding task outputs
206
+ ├── reflections/ # Task analysis and feedback
207
+ └── deltas/ # Playbook updates
707
208
  ```
708
209
 
709
- Tests use Mocha + Chai and are organized in `test/` with subdirectories:
210
+ **Note**: When you run `brv push`, the playbook is uploaded to ByteRover's memory storage, and local ACE files are automatically cleaned up to keep your workspace organized.
710
211
 
711
- * `test/commands/` - Command integration tests
712
- * `test/unit/` - Unit tests mirroring `src/` structure
713
- * `test/learning/` - Learning/exploration tests
212
+ ## Getting Help
714
213
 
715
- ### Lint
214
+ ### Command Help
716
215
 
717
216
  ```bash
718
- npm run lint
719
- ```
720
-
721
- Runs ESLint with oclif and prettier configurations.
217
+ # Get general help
218
+ brv --help
722
219
 
723
- ### Run Locally
724
-
725
- ```bash
726
- # Development mode (uses ts-node, points to dev environment)
727
- ./bin/dev.js [command]
728
-
729
- # Production mode (uses compiled dist/, points to prod environment)
730
- ./bin/run.js [command]
220
+ # Get help for a specific command
221
+ brv login --help
222
+ brv init --help
223
+ brv push --help
731
224
  ```
732
225
 
733
- ### Create New Command
734
-
735
- ```bash
736
- npx oclif generate command
737
- ```
738
-
739
- ### Distribution
740
-
741
- ```bash
742
- # Create development tarball
743
- npm run pack:dev
744
-
745
- # Create production tarball
746
- npm run pack:prod
747
- ```
748
-
749
- ## Architecture
750
-
751
- ByteRover CLI follows **Clean Architecture** principles with a clear separation of concerns:
752
-
753
- ### Layers
754
-
755
- * **Core Layer** (`src/core/`) - Domain logic independent of frameworks
756
- * `domain/entities/` - Business entities with validation and behavior
757
- * `domain/errors/` - Domain-specific error types
758
- * `interfaces/` - Port definitions (dependency inversion)
759
-
760
- * **Infrastructure Layer** (`src/infra/`) - Concrete implementations using external dependencies
761
- * `auth/` - OAuth 2.0 + PKCE implementation
762
- * `http/` - HTTP clients and callback servers
763
- * `storage/` - Keychain token storage
764
- * `space/` - Space/workspace service implementations
765
-
766
- * **Application Layer** (`src/commands/`) - oclif command definitions
767
-
768
- ### Key Technologies
226
+ ### Support
769
227
 
770
- * **[oclif](https://oclif.io) v4** - CLI framework with plugin system
771
- * **TypeScript** - Strict mode, ES2022 target, Node16 modules
772
- * **axios** - HTTP client for OAuth and API operations
773
- * **express** - Local callback server for OAuth flows
774
- * **keytar** - Secure system keychain access
775
- * **Mocha + Chai** - Testing framework
228
+ If you encounter issues or have questions:
776
229
 
777
- ### Detailed Documentation
230
+ 1. Check the command help: `brv [command] --help`
231
+ 2. Review your status: `brv status`
232
+ 3. Contact ByteRover support
778
233
 
779
- For comprehensive architecture documentation, design patterns, and development guidelines, see [CLAUDE.md](CLAUDE.md).
234
+ ---
780
235
 
781
- Copyright (c) ByteRover
236
+ **Copyright (c) ByteRover**