@brainfile/cli 0.13.3 → 0.15.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.
- package/CHANGELOG.md +26 -0
- package/README.md +123 -358
- package/dist/cli.js +88 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.d.ts +3 -0
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +162 -3
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/adr.d.ts +22 -0
- package/dist/commands/adr.d.ts.map +1 -0
- package/dist/commands/adr.js +182 -0
- package/dist/commands/adr.js.map +1 -0
- package/dist/commands/archive.d.ts.map +1 -1
- package/dist/commands/archive.js +147 -0
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/complete.d.ts +30 -0
- package/dist/commands/complete.d.ts.map +1 -0
- package/dist/commands/complete.js +254 -0
- package/dist/commands/complete.js.map +1 -0
- package/dist/commands/contract.d.ts.map +1 -1
- package/dist/commands/contract.js +2 -0
- package/dist/commands/contract.js.map +1 -1
- package/dist/commands/delete.d.ts.map +1 -1
- package/dist/commands/delete.js +29 -1
- package/dist/commands/delete.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +41 -8
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.d.ts +1 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +34 -12
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/log.d.ts +52 -0
- package/dist/commands/log.d.ts.map +1 -0
- package/dist/commands/log.js +246 -0
- package/dist/commands/log.js.map +1 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +864 -44
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/migrate.d.ts +4 -3
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +193 -38
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/move.d.ts.map +1 -1
- package/dist/commands/move.js +90 -0
- package/dist/commands/move.js.map +1 -1
- package/dist/commands/patch.d.ts.map +1 -1
- package/dist/commands/patch.js +85 -13
- package/dist/commands/patch.js.map +1 -1
- package/dist/commands/search.d.ts +33 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +209 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/show.d.ts.map +1 -1
- package/dist/commands/show.js +74 -1
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/subtask.d.ts.map +1 -1
- package/dist/commands/subtask.js +72 -5
- package/dist/commands/subtask.js.map +1 -1
- package/dist/commands/types.d.ts +40 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +242 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/contractRunner.d.ts.map +1 -1
- package/dist/lib/contractRunner.js +177 -12
- package/dist/lib/contractRunner.js.map +1 -1
- package/dist/tui/BrainfileTUI.d.ts.map +1 -1
- package/dist/tui/BrainfileTUI.js +23 -20
- package/dist/tui/BrainfileTUI.js.map +1 -1
- package/dist/tui/actions.d.ts +5 -5
- package/dist/tui/actions.d.ts.map +1 -1
- package/dist/tui/actions.js +335 -47
- package/dist/tui/actions.js.map +1 -1
- package/dist/tui/components/ArchivePanel.js +1 -1
- package/dist/tui/components/ArchivePanel.js.map +1 -1
- package/dist/tui/components/ColumnTabs.d.ts.map +1 -1
- package/dist/tui/components/ColumnTabs.js +6 -2
- package/dist/tui/components/ColumnTabs.js.map +1 -1
- package/dist/tui/components/HelpOverlay.js +3 -3
- package/dist/tui/components/HelpOverlay.js.map +1 -1
- package/dist/tui/components/LogsPanel.d.ts +16 -0
- package/dist/tui/components/LogsPanel.d.ts.map +1 -0
- package/dist/tui/components/LogsPanel.js +115 -0
- package/dist/tui/components/LogsPanel.js.map +1 -0
- package/dist/tui/components/MainPanelTabs.d.ts +2 -2
- package/dist/tui/components/MainPanelTabs.d.ts.map +1 -1
- package/dist/tui/components/MainPanelTabs.js +3 -3
- package/dist/tui/components/MainPanelTabs.js.map +1 -1
- package/dist/tui/components/StackedTaskList.d.ts +2 -1
- package/dist/tui/components/StackedTaskList.d.ts.map +1 -1
- package/dist/tui/components/StackedTaskList.js +9 -9
- package/dist/tui/components/StackedTaskList.js.map +1 -1
- package/dist/tui/components/TaskCard.d.ts +2 -1
- package/dist/tui/components/TaskCard.d.ts.map +1 -1
- package/dist/tui/components/TaskCard.js +41 -5
- package/dist/tui/components/TaskCard.js.map +1 -1
- package/dist/tui/components/TaskCardMeasure.d.ts +2 -16
- package/dist/tui/components/TaskCardMeasure.d.ts.map +1 -1
- package/dist/tui/components/TaskCardMeasure.js +30 -25
- package/dist/tui/components/TaskCardMeasure.js.map +1 -1
- package/dist/tui/components/TaskDetail.d.ts +2 -3
- package/dist/tui/components/TaskDetail.d.ts.map +1 -1
- package/dist/tui/components/TaskDetail.js +35 -12
- package/dist/tui/components/TaskDetail.js.map +1 -1
- package/dist/tui/components/TaskList.d.ts +2 -1
- package/dist/tui/components/TaskList.d.ts.map +1 -1
- package/dist/tui/components/TaskList.js +5 -5
- package/dist/tui/components/TaskList.js.map +1 -1
- package/dist/tui/components/index.d.ts +2 -2
- package/dist/tui/components/index.d.ts.map +1 -1
- package/dist/tui/components/index.js +3 -3
- package/dist/tui/components/index.js.map +1 -1
- package/dist/tui/hooks/useBrainfileLoader.d.ts.map +1 -1
- package/dist/tui/hooks/useBrainfileLoader.js +97 -31
- package/dist/tui/hooks/useBrainfileLoader.js.map +1 -1
- package/dist/tui/hooks/useKeyboardNavigation.d.ts.map +1 -1
- package/dist/tui/hooks/useKeyboardNavigation.js +47 -47
- package/dist/tui/hooks/useKeyboardNavigation.js.map +1 -1
- package/dist/tui/types.d.ts +7 -7
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/utils/board-types.d.ts +13 -0
- package/dist/utils/board-types.d.ts.map +1 -0
- package/dist/utils/board-types.js +7 -0
- package/dist/utils/board-types.js.map +1 -0
- package/dist/utils/dot-brainfile.d.ts +9 -0
- package/dist/utils/dot-brainfile.d.ts.map +1 -0
- package/dist/utils/dot-brainfile.js +74 -0
- package/dist/utils/dot-brainfile.js.map +1 -0
- package/dist/utils/strict-validation.d.ts +8 -0
- package/dist/utils/strict-validation.d.ts.map +1 -0
- package/dist/utils/strict-validation.js +41 -0
- package/dist/utils/strict-validation.js.map +1 -0
- package/dist/utils/v2-detect.d.ts +28 -0
- package/dist/utils/v2-detect.d.ts.map +1 -0
- package/dist/utils/v2-detect.js +109 -0
- package/dist/utils/v2-detect.js.map +1 -0
- package/dist/utils/v2-tasks.d.ts +121 -0
- package/dist/utils/v2-tasks.d.ts.map +1 -0
- package/dist/utils/v2-tasks.js +384 -0
- package/dist/utils/v2-tasks.js.map +1 -0
- package/package.json +3 -3
- package/state.json +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.14.0] - 2026-02-18
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Per-task file architecture (v2)** - Tasks are now individual `.md` files instead of embedded YAML
|
|
14
|
+
- `brainfile init` creates v2 structure: `brainfile.md` (config), `tasks/`, `logs/`, `state.json`
|
|
15
|
+
- `brainfile migrate --v2` converts v1 boards to v2 per-task files (creates `.v1.bak` backup)
|
|
16
|
+
- All existing commands auto-detect v1 vs v2 and handle both transparently
|
|
17
|
+
- **`brainfile complete`** - Move task from `tasks/` to `logs/` with `completedAt` timestamp
|
|
18
|
+
- Strips `column` and `position` fields from completed task
|
|
19
|
+
- `complete_task` MCP tool for parity
|
|
20
|
+
- **`brainfile log`** - View and manage task history
|
|
21
|
+
- `brainfile log -t <id>` - View a completed task's log
|
|
22
|
+
- `brainfile log --search <query>` - Search across all completed task logs
|
|
23
|
+
- `brainfile log --recent` - List recently completed tasks
|
|
24
|
+
- `brainfile log note -t <id> "<message>"` - Append timestamped entry to any task's `## Log` section
|
|
25
|
+
- `search_logs` and `append_log` MCP tools for parity
|
|
26
|
+
- **`brainfile search`** - Search across active tasks and completed logs with relevance scoring
|
|
27
|
+
- `search_tasks` MCP tool updated for v2
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- **All MCP tools have v2 support** - 29 tools detect v1/v2 and handle per-task files correctly
|
|
31
|
+
- Uses `@brainfile/core` as single source of truth for all task I/O operations
|
|
32
|
+
- CLI is a thin wrapper over core (no duplicated parsing/serialization logic)
|
|
33
|
+
- **`brainfile init` defaults to v2** - Creates per-task file directory structure
|
|
34
|
+
- Upgraded to @brainfile/core@^0.11.0
|
|
35
|
+
|
|
10
36
|
## [0.13.3] - 2026-01-01
|
|
11
37
|
|
|
12
38
|
### Added
|
package/README.md
CHANGED
|
@@ -1,372 +1,205 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/brainfile/cli/main/logo.png" alt="Brainfile Logo" width="128" height="128">
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
1
|
# @brainfile/cli
|
|
6
2
|
|
|
7
|
-
**
|
|
8
|
-
|
|
9
|
-
- Modern, borderless TUI optimized for information density
|
|
10
|
-
- Vim-style navigation with intuitive keybindings
|
|
11
|
-
- CLI commands for scripting and automation
|
|
12
|
-
- MCP server for AI assistant integration
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
3
|
+
**The official CLI for Brainfile.** Manage tasks, contracts, and ADRs directly from your terminal.
|
|
15
4
|
|
|
16
|
-
|
|
17
|
-
npm install -g @brainfile/cli
|
|
18
|
-
```
|
|
5
|
+
Designed for developers who want a local-first, file-based task management system that plays nicely with AI agents.
|
|
19
6
|
|
|
20
|
-
|
|
7
|
+
## Install
|
|
21
8
|
|
|
22
9
|
```bash
|
|
23
|
-
brainfile
|
|
10
|
+
npm i -g @brainfile/cli
|
|
24
11
|
```
|
|
25
12
|
|
|
26
13
|
## Quick Start
|
|
27
14
|
|
|
15
|
+
Initialize a new brainfile in your project root:
|
|
16
|
+
|
|
28
17
|
```bash
|
|
29
|
-
# Initialize a new brainfile
|
|
30
18
|
brainfile init
|
|
31
|
-
|
|
32
|
-
# Launch interactive TUI
|
|
33
|
-
brainfile
|
|
34
|
-
|
|
35
|
-
# Or use CLI commands
|
|
36
|
-
brainfile list # List all tasks
|
|
37
|
-
brainfile add --title "My task" --column todo # Add a task
|
|
38
|
-
brainfile move --task task-1 --column done # Move a task
|
|
39
19
|
```
|
|
40
20
|
|
|
41
|
-
|
|
21
|
+
This creates the standard v2 structure:
|
|
22
|
+
- `.brainfile/brainfile.md` (Configuration, rules, definitions)
|
|
23
|
+
- `.brainfile/board/` (Active tasks)
|
|
24
|
+
- `.brainfile/logs/` (Completed tasks)
|
|
25
|
+
|
|
26
|
+
The board comes pre-configured with `To Do` and `In Progress` columns.
|
|
42
27
|
|
|
43
|
-
|
|
28
|
+
## Core Workflow
|
|
44
29
|
|
|
45
|
-
|
|
30
|
+
### Add Tasks
|
|
31
|
+
Create new tasks with rich metadata.
|
|
46
32
|
|
|
47
33
|
```bash
|
|
48
|
-
|
|
49
|
-
brainfile
|
|
50
|
-
```
|
|
34
|
+
# Basic task
|
|
35
|
+
brainfile add --title "Implement login" --column todo
|
|
51
36
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
37
|
+
# Full featured task
|
|
38
|
+
brainfile add \
|
|
39
|
+
--title "Refactor database layer" \
|
|
40
|
+
--type task \
|
|
41
|
+
--column todo \
|
|
42
|
+
--priority high \
|
|
43
|
+
--assignee @josh \
|
|
44
|
+
--tags "refactor,db" \
|
|
45
|
+
--parent epic-123
|
|
56
46
|
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
# Create a parent with children in one shot
|
|
48
|
+
brainfile add -c todo -t "Auth overhaul" \
|
|
49
|
+
--child "OAuth flow" --child "Session hardening"
|
|
59
50
|
```
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
- `
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|-----|--------|
|
|
70
|
-
| `1` | Switch to Tasks panel |
|
|
71
|
-
| `2` | Switch to Rules panel |
|
|
72
|
-
| `3` | Switch to Archive panel |
|
|
73
|
-
| `?` | Show help |
|
|
74
|
-
| `q` | Quit |
|
|
75
|
-
|
|
76
|
-
**Tasks Panel:**
|
|
77
|
-
| Key | Action |
|
|
78
|
-
|-----|--------|
|
|
79
|
-
| `TAB` / `Shift+TAB` | Navigate columns |
|
|
80
|
-
| `j`/`k` or `↑`/`↓` | Navigate tasks |
|
|
81
|
-
| `h`/`l` or `←`/`→` | Switch columns |
|
|
82
|
-
| `g`/`G` | Jump to top/bottom |
|
|
83
|
-
| `Enter` | Expand/collapse task |
|
|
84
|
-
| `/` | Search tasks |
|
|
85
|
-
| `r` | Refresh |
|
|
86
|
-
|
|
87
|
-
**Search Filters:**
|
|
88
|
-
| Filter | Example | Description |
|
|
89
|
-
|--------|---------|-------------|
|
|
90
|
-
| Priority | `p:high` | Filter by priority |
|
|
91
|
-
| Tag | `#bug` or `t:feature` | Filter by tag |
|
|
92
|
-
| Assignee | `@john` | Filter by assignee |
|
|
93
|
-
| Due date | `due:week` | `overdue`, `today`, `week`, `month` |
|
|
94
|
-
|
|
95
|
-
Combine filters with text: `p:high #bug login issue`
|
|
96
|
-
|
|
97
|
-
**Task Management:**
|
|
98
|
-
| Key | Action |
|
|
99
|
-
|-----|--------|
|
|
100
|
-
| `e` | Edit task in $EDITOR |
|
|
101
|
-
| `m` | Move task to column |
|
|
102
|
-
| `d` | Delete task |
|
|
103
|
-
| `n` | Quick add new task |
|
|
104
|
-
| `N` | New task in $EDITOR |
|
|
105
|
-
| `p` | Cycle priority |
|
|
106
|
-
| `t` | Toggle subtask |
|
|
107
|
-
| `A` | Archive task |
|
|
108
|
-
| `y` | Copy task ID |
|
|
109
|
-
|
|
110
|
-
**Rules Panel:**
|
|
111
|
-
| Key | Action |
|
|
112
|
-
|-----|--------|
|
|
113
|
-
| `TAB` / `Shift+TAB` | Switch rule type |
|
|
114
|
-
| `h`/`l` | Switch rule type (always/never/prefer/context) |
|
|
115
|
-
| `j`/`k` | Navigate rules |
|
|
116
|
-
| `n` | Add new rule |
|
|
117
|
-
| `e` | Edit selected rule |
|
|
118
|
-
| `d` | Delete selected rule |
|
|
119
|
-
|
|
120
|
-
**Archive Panel:**
|
|
121
|
-
| Key | Action |
|
|
122
|
-
|-----|--------|
|
|
123
|
-
| `j`/`k` | Navigate archived tasks |
|
|
124
|
-
| `Enter` | Expand/collapse task |
|
|
125
|
-
| `R` | Restore task to column |
|
|
126
|
-
| `d` | Permanently delete task |
|
|
127
|
-
| `r` | Refresh archive |
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
### list
|
|
52
|
+
**Key Flags:**
|
|
53
|
+
- `--title, -t`: Task summary
|
|
54
|
+
- `--type`: `task`, `epic`, or `adr` (default: `task`)
|
|
55
|
+
- `--column, -c`: Target column ID
|
|
56
|
+
- `--parent`: Parent task/epic ID
|
|
57
|
+
- `--child`: Create child task(s) under the new parent (repeatable)
|
|
58
|
+
- `--priority, -p`: `low`, `medium`, `high`, `critical`
|
|
59
|
+
- `--tags`: Comma-separated list
|
|
132
60
|
|
|
133
|
-
List
|
|
61
|
+
### List Tasks
|
|
62
|
+
View your board from the command line.
|
|
134
63
|
|
|
135
64
|
```bash
|
|
136
|
-
brainfile list
|
|
137
|
-
brainfile list --column
|
|
138
|
-
brainfile list --tag bug
|
|
65
|
+
brainfile list # View all active tasks
|
|
66
|
+
brainfile list --column todo # Filter by column
|
|
67
|
+
brainfile list --tag bug # Filter by tag
|
|
68
|
+
brainfile list --parent epic-123 # See all children of an epic
|
|
69
|
+
brainfile list --contract ready # See tasks with contracts waiting for pickup
|
|
139
70
|
```
|
|
140
71
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- `-c, --column <name>` - Filter by column
|
|
144
|
-
- `-t, --tag <name>` - Filter by tag
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
### show
|
|
149
|
-
|
|
150
|
-
Show full details of a single task:
|
|
72
|
+
### Manage Tasks
|
|
73
|
+
Manipulate tasks as you work.
|
|
151
74
|
|
|
152
75
|
```bash
|
|
153
|
-
|
|
154
|
-
brainfile show -t task-
|
|
155
|
-
```
|
|
76
|
+
# View details
|
|
77
|
+
brainfile show -t task-10
|
|
156
78
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
- `-t, --task <id>` - Task ID (required)
|
|
79
|
+
# Move to another column
|
|
80
|
+
brainfile move -t task-10 -c in-progress
|
|
160
81
|
|
|
161
|
-
|
|
82
|
+
# Update fields
|
|
83
|
+
brainfile patch -t task-10 --priority critical --tags "frontend,urgent"
|
|
162
84
|
|
|
163
|
-
|
|
85
|
+
# Clear fields
|
|
86
|
+
brainfile patch -t task-10 --clear-tags --clear-assignee
|
|
164
87
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
brainfile add --title "Implement auth" --column todo
|
|
169
|
-
brainfile add --title "Fix bug" --priority high --tags "bug,urgent"
|
|
170
|
-
brainfile add --title "Review PR" --assignee john --due-date 2025-02-01
|
|
88
|
+
# Delete (permanently)
|
|
89
|
+
brainfile delete -t task-10
|
|
171
90
|
```
|
|
172
91
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
- `-c, --column <name>` - Target column (default: `todo`)
|
|
176
|
-
- `-d, --description <text>` - Task description
|
|
177
|
-
- `-p, --priority <level>` - `low`, `medium`, `high`, or `critical`
|
|
178
|
-
- `--tags <list>` - Comma-separated tags
|
|
179
|
-
- `--assignee <name>` - Assignee name
|
|
180
|
-
- `--due-date <date>` - Due date (YYYY-MM-DD)
|
|
181
|
-
- `--subtasks <list>` - Comma-separated subtask titles
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
### move
|
|
186
|
-
|
|
187
|
-
Move a task to a different column:
|
|
92
|
+
### Complete
|
|
93
|
+
When a task is done, move it to the archive.
|
|
188
94
|
|
|
189
95
|
```bash
|
|
190
|
-
brainfile
|
|
191
|
-
brainfile move --task task-5 --column done
|
|
96
|
+
brainfile complete -t task-10
|
|
192
97
|
```
|
|
98
|
+
This moves the file from `.brainfile/board/` to `.brainfile/logs/`, preserving its history forever.
|
|
193
99
|
|
|
194
|
-
|
|
195
|
-
- `-t, --task <id>` - Task ID (required)
|
|
196
|
-
- `-c, --column <name>` - Target column (required)
|
|
197
|
-
|
|
198
|
-
---
|
|
100
|
+
## Types
|
|
199
101
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
Update specific fields of a task:
|
|
102
|
+
Brainfile supports different document types.
|
|
203
103
|
|
|
204
104
|
```bash
|
|
205
|
-
brainfile
|
|
206
|
-
brainfile
|
|
207
|
-
brainfile patch --task task-1 --clear-assignee # Remove assignee
|
|
105
|
+
brainfile types list # See available types (task, epic, adr)
|
|
106
|
+
brainfile types add # (Coming soon: define custom types)
|
|
208
107
|
```
|
|
209
108
|
|
|
210
|
-
|
|
211
|
-
- `-t, --task <id>` - Task ID (required)
|
|
212
|
-
- `--title <text>` - New title
|
|
213
|
-
- `--description <text>` - New description
|
|
214
|
-
- `--priority <level>` - New priority
|
|
215
|
-
- `--tags <list>` - New tags (comma-separated)
|
|
216
|
-
- `--assignee <name>` - New assignee
|
|
217
|
-
- `--due-date <date>` - New due date
|
|
218
|
-
- `--clear-description` - Remove description
|
|
219
|
-
- `--clear-priority` - Remove priority
|
|
220
|
-
- `--clear-tags` - Remove tags
|
|
221
|
-
- `--clear-assignee` - Remove assignee
|
|
222
|
-
- `--clear-due-date` - Remove due date
|
|
223
|
-
|
|
224
|
-
---
|
|
109
|
+
## Contracts: Working with AI Agents
|
|
225
110
|
|
|
226
|
-
|
|
111
|
+
Contracts allow you to define explicit deliverables and validation rules for AI agents.
|
|
227
112
|
|
|
228
|
-
|
|
113
|
+
### 1. Create a Contract
|
|
114
|
+
Add a task with a contract definition.
|
|
229
115
|
|
|
230
116
|
```bash
|
|
231
|
-
brainfile
|
|
117
|
+
brainfile add -c todo -t "Optimize image loader" \
|
|
118
|
+
--with-contract \
|
|
119
|
+
--deliverable "file:src/utils/loader.ts:Optimized implementation" \
|
|
120
|
+
--validation "npm test -- loader" \
|
|
121
|
+
--constraint "Must use lazy loading"
|
|
232
122
|
```
|
|
233
123
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
- `--force` - Confirm deletion (required)
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
### archive
|
|
241
|
-
|
|
242
|
-
Move a task to the archive:
|
|
124
|
+
### 2. Pickup (Agent)
|
|
125
|
+
The agent claims the task.
|
|
243
126
|
|
|
244
127
|
```bash
|
|
245
|
-
brainfile
|
|
128
|
+
brainfile contract pickup -t task-45
|
|
246
129
|
```
|
|
130
|
+
Status changes to `in_progress`. Metrics tracking begins.
|
|
247
131
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
### restore
|
|
251
|
-
|
|
252
|
-
Restore a task from the archive:
|
|
132
|
+
### 3. Deliver (Agent)
|
|
133
|
+
The agent marks work as ready for review.
|
|
253
134
|
|
|
254
135
|
```bash
|
|
255
|
-
brainfile
|
|
136
|
+
brainfile contract deliver -t task-45
|
|
256
137
|
```
|
|
138
|
+
Status changes to `delivered`.
|
|
257
139
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
- `-c, --column <name>` - Target column (required)
|
|
261
|
-
|
|
262
|
-
---
|
|
263
|
-
|
|
264
|
-
### subtask
|
|
265
|
-
|
|
266
|
-
Manage subtasks:
|
|
140
|
+
### 4. Validate (User)
|
|
141
|
+
Run the validation commands automatically.
|
|
267
142
|
|
|
268
143
|
```bash
|
|
269
|
-
brainfile
|
|
270
|
-
brainfile subtask --task task-1 --toggle task-1-1
|
|
271
|
-
brainfile subtask --task task-1 --update task-1-1 --title "Updated"
|
|
272
|
-
brainfile subtask --task task-1 --delete task-1-2
|
|
144
|
+
brainfile contract validate -t task-45
|
|
273
145
|
```
|
|
146
|
+
- **Pass**: Task is marked `done`.
|
|
147
|
+
- **Fail**: Task status reverts to `ready` (or `failed`) for rework.
|
|
274
148
|
|
|
275
|
-
|
|
276
|
-
- `-t, --task <id>` - Parent task ID (required)
|
|
277
|
-
- `--add <title>` - Add a new subtask
|
|
278
|
-
- `--toggle <id>` - Toggle subtask completion
|
|
279
|
-
- `--update <id>` - Update subtask (use with `--title`)
|
|
280
|
-
- `--delete <id>` - Delete a subtask
|
|
281
|
-
- `--title <text>` - New title (for `--update`)
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
### lint
|
|
149
|
+
## ADR Promotion
|
|
286
150
|
|
|
287
|
-
|
|
151
|
+
Architecture Decision Records (ADRs) are first-class citizens. You can promote an accepted ADR to a global rule that agents must follow.
|
|
288
152
|
|
|
289
153
|
```bash
|
|
290
|
-
|
|
291
|
-
brainfile
|
|
292
|
-
brainfile lint --check # Exit with error code (for CI)
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
**What it checks:**
|
|
296
|
-
- YAML syntax errors
|
|
297
|
-
- Unquoted strings with colons (auto-fixable)
|
|
298
|
-
- Duplicate column IDs
|
|
299
|
-
- Missing required fields
|
|
300
|
-
|
|
301
|
-
---
|
|
154
|
+
# 1. Create an ADR
|
|
155
|
+
brainfile add -t "Use Postgres for all user data" --type adr -c proposed
|
|
302
156
|
|
|
303
|
-
|
|
157
|
+
# 2. Accept it (move to accepted column)
|
|
158
|
+
brainfile move -t adr-1 -c accepted
|
|
304
159
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
```bash
|
|
308
|
-
brainfile template --list
|
|
309
|
-
brainfile template --use bug-report --title "Login fails"
|
|
310
|
-
brainfile template --use feature-request --title "Dark mode"
|
|
160
|
+
# 3. Promote to a rule
|
|
161
|
+
brainfile adr promote -t adr-1 --category always
|
|
311
162
|
```
|
|
312
163
|
|
|
313
|
-
**
|
|
314
|
-
- `
|
|
315
|
-
- `
|
|
316
|
-
- `
|
|
164
|
+
**Categories:**
|
|
165
|
+
- `always`: Strict rules (e.g., "Always use TypeScript")
|
|
166
|
+
- `never`: Prohibitions (e.g., "Never commit secrets")
|
|
167
|
+
- `prefer`: Guidelines (e.g., "Prefer functional components")
|
|
168
|
+
- `context`: informational context
|
|
317
169
|
|
|
318
|
-
|
|
170
|
+
Promoted rules are added to `.brainfile/brainfile.md` and injected into agent prompts.
|
|
319
171
|
|
|
320
|
-
|
|
172
|
+
## TUI (Terminal UI)
|
|
321
173
|
|
|
322
|
-
|
|
174
|
+
Launch the interactive board:
|
|
323
175
|
|
|
324
176
|
```bash
|
|
325
|
-
brainfile
|
|
326
|
-
brainfile
|
|
327
|
-
brainfile hooks install cline
|
|
328
|
-
brainfile hooks list
|
|
329
|
-
brainfile hooks uninstall claude-code --scope all
|
|
177
|
+
brainfile # No arguments launches the TUI
|
|
178
|
+
brainfile tui # Explicit subcommand also works
|
|
330
179
|
```
|
|
331
180
|
|
|
332
|
-
|
|
333
|
-
-
|
|
334
|
-
-
|
|
335
|
-
-
|
|
336
|
-
|
|
337
|
-
Hooks provide automatic reminders to update task status during AI-assisted development.
|
|
338
|
-
|
|
339
|
-
---
|
|
340
|
-
|
|
341
|
-
### mcp
|
|
342
|
-
|
|
343
|
-
Start an MCP (Model Context Protocol) server for AI assistant integration:
|
|
344
|
-
|
|
345
|
-
```bash
|
|
346
|
-
brainfile mcp
|
|
347
|
-
brainfile mcp --file ./project/brainfile.md
|
|
348
|
-
```
|
|
181
|
+
### Panels
|
|
182
|
+
- **Board (`1`)**: Kanban view of active tasks.
|
|
183
|
+
- **Logs (`2`)**: List of completed tasks.
|
|
184
|
+
- **Rules (`3`)**: Active rules and configuration.
|
|
349
185
|
|
|
350
|
-
|
|
186
|
+
### Keyboard Shortcuts
|
|
187
|
+
| Key | Action |
|
|
188
|
+
|-----|--------|
|
|
189
|
+
| `tab` | Next column |
|
|
190
|
+
| `j` / `k` | Down / Up |
|
|
191
|
+
| `enter` | View task details |
|
|
192
|
+
| `n` | New task |
|
|
193
|
+
| `m` | Move task |
|
|
194
|
+
| `e` | Edit task (in $EDITOR) |
|
|
195
|
+
| `/` | Search |
|
|
196
|
+
| `q` | Quit |
|
|
351
197
|
|
|
352
|
-
|
|
353
|
-
| Tool | Description |
|
|
354
|
-
|------|-------------|
|
|
355
|
-
| `list_tasks` | List tasks with optional filtering |
|
|
356
|
-
| `add_task` | Create a new task |
|
|
357
|
-
| `move_task` | Move task between columns |
|
|
358
|
-
| `patch_task` | Update task fields |
|
|
359
|
-
| `delete_task` | Permanently delete a task |
|
|
360
|
-
| `archive_task` | Archive a task |
|
|
361
|
-
| `restore_task` | Restore from archive |
|
|
362
|
-
| `add_subtask` | Add a subtask |
|
|
363
|
-
| `delete_subtask` | Delete a subtask |
|
|
364
|
-
| `toggle_subtask` | Toggle subtask completion |
|
|
365
|
-
| `update_subtask` | Update subtask title |
|
|
198
|
+
## AI Integration
|
|
366
199
|
|
|
367
|
-
|
|
200
|
+
The CLI includes an MCP (Model Context Protocol) server.
|
|
368
201
|
|
|
369
|
-
Add to your
|
|
202
|
+
Add to your `claude_desktop_config.json`:
|
|
370
203
|
|
|
371
204
|
```json
|
|
372
205
|
{
|
|
@@ -379,72 +212,4 @@ Add to your MCP settings (`.mcp.json` or Claude Code config):
|
|
|
379
212
|
}
|
|
380
213
|
```
|
|
381
214
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
```json
|
|
385
|
-
{
|
|
386
|
-
"mcpServers": {
|
|
387
|
-
"brainfile": {
|
|
388
|
-
"command": "npx",
|
|
389
|
-
"args": ["@brainfile/cli", "mcp", "-f", "path/to/brainfile.md"]
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
---
|
|
396
|
-
|
|
397
|
-
### init
|
|
398
|
-
|
|
399
|
-
Create a new brainfile:
|
|
400
|
-
|
|
401
|
-
```bash
|
|
402
|
-
brainfile init
|
|
403
|
-
brainfile init --file ./project/tasks.md # Custom location (optional)
|
|
404
|
-
brainfile init --force # Overwrite existing
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
### migrate
|
|
408
|
-
|
|
409
|
-
Move a legacy root `brainfile.md` into the preferred `.brainfile/` directory:
|
|
410
|
-
|
|
411
|
-
```bash
|
|
412
|
-
brainfile migrate
|
|
413
|
-
brainfile migrate --force
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
## Output Colors
|
|
417
|
-
|
|
418
|
-
The CLI uses colors to highlight information:
|
|
419
|
-
|
|
420
|
-
| Element | Color |
|
|
421
|
-
|---------|-------|
|
|
422
|
-
| Task IDs | Gray |
|
|
423
|
-
| Titles | White |
|
|
424
|
-
| Critical Priority | Red (bold) |
|
|
425
|
-
| High Priority | Red |
|
|
426
|
-
| Medium Priority | Yellow |
|
|
427
|
-
| Low Priority | Blue |
|
|
428
|
-
| Tags | Cyan |
|
|
429
|
-
| Completed | Green |
|
|
430
|
-
|
|
431
|
-
## Package Information
|
|
432
|
-
|
|
433
|
-
- **npm**: https://www.npmjs.com/package/@brainfile/cli
|
|
434
|
-
- **GitHub**: https://github.com/brainfile/cli
|
|
435
|
-
- **Core Library**: [@brainfile/core](https://www.npmjs.com/package/@brainfile/core)
|
|
436
|
-
- **Protocol**: https://brainfile.md
|
|
437
|
-
|
|
438
|
-
## Development
|
|
439
|
-
|
|
440
|
-
```bash
|
|
441
|
-
git clone https://github.com/brainfile/cli.git
|
|
442
|
-
cd cli
|
|
443
|
-
npm install
|
|
444
|
-
npm run build
|
|
445
|
-
npm test
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
## License
|
|
449
|
-
|
|
450
|
-
MIT
|
|
215
|
+
This gives Claude (and other MCP clients) full access to read your board, create tasks, and manage contracts.
|