brainfile 0.18.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/README.md +222 -0
- package/dist/__tests__/helpers/v2.d.ts +12 -0
- package/dist/__tests__/helpers/v2.d.ts.map +1 -0
- package/dist/__tests__/helpers/v2.js +73 -0
- package/dist/__tests__/helpers/v2.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +480 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +34 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +255 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/adr.d.ts +22 -0
- package/dist/commands/adr.d.ts.map +1 -0
- package/dist/commands/adr.js +195 -0
- package/dist/commands/adr.js.map +1 -0
- package/dist/commands/archive.d.ts +20 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +590 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/auth.d.ts +26 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +245 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/complete.d.ts +30 -0
- package/dist/commands/complete.d.ts.map +1 -0
- package/dist/commands/complete.js +267 -0
- package/dist/commands/complete.js.map +1 -0
- package/dist/commands/config.d.ts +29 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +210 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/contract.d.ts +84 -0
- package/dist/commands/contract.d.ts.map +1 -0
- package/dist/commands/contract.js +715 -0
- package/dist/commands/contract.js.map +1 -0
- package/dist/commands/delete.d.ts +8 -0
- package/dist/commands/delete.d.ts.map +1 -0
- package/dist/commands/delete.js +139 -0
- package/dist/commands/delete.js.map +1 -0
- package/dist/commands/hooks.d.ts +35 -0
- package/dist/commands/hooks.d.ts.map +1 -0
- package/dist/commands/hooks.js +324 -0
- package/dist/commands/hooks.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +118 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/lint.d.ts +16 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +123 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/list.d.ts +20 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +175 -0
- package/dist/commands/list.js.map +1 -0
- 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 +3 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +96 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/migrate.d.ts +16 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +388 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/move.d.ts +16 -0
- package/dist/commands/move.d.ts.map +1 -0
- package/dist/commands/move.js +225 -0
- package/dist/commands/move.js.map +1 -0
- package/dist/commands/patch.d.ts +17 -0
- package/dist/commands/patch.d.ts.map +1 -0
- package/dist/commands/patch.js +226 -0
- package/dist/commands/patch.js.map +1 -0
- package/dist/commands/restore.d.ts +8 -0
- package/dist/commands/restore.d.ts.map +1 -0
- package/dist/commands/restore.js +111 -0
- package/dist/commands/restore.js.map +1 -0
- package/dist/commands/rules.d.ts +68 -0
- package/dist/commands/rules.d.ts.map +1 -0
- package/dist/commands/rules.js +322 -0
- package/dist/commands/rules.js.map +1 -0
- package/dist/commands/schema.d.ts +31 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +374 -0
- package/dist/commands/schema.js.map +1 -0
- 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 +20 -0
- package/dist/commands/show.d.ts.map +1 -0
- package/dist/commands/show.js +272 -0
- package/dist/commands/show.js.map +1 -0
- package/dist/commands/subtask.d.ts +12 -0
- package/dist/commands/subtask.d.ts.map +1 -0
- package/dist/commands/subtask.js +212 -0
- package/dist/commands/subtask.js.map +1 -0
- package/dist/commands/template.d.ts +17 -0
- package/dist/commands/template.d.ts.map +1 -0
- package/dist/commands/template.js +149 -0
- package/dist/commands/template.js.map +1 -0
- package/dist/commands/tui.d.ts +6 -0
- package/dist/commands/tui.d.ts.map +1 -0
- package/dist/commands/tui.js +79 -0
- package/dist/commands/tui.js.map +1 -0
- 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 +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/contractRunner.d.ts +59 -0
- package/dist/lib/contractRunner.d.ts.map +1 -0
- package/dist/lib/contractRunner.js +511 -0
- package/dist/lib/contractRunner.js.map +1 -0
- package/dist/mcp/helpers.d.ts +32 -0
- package/dist/mcp/helpers.d.ts.map +1 -0
- package/dist/mcp/helpers.js +125 -0
- package/dist/mcp/helpers.js.map +1 -0
- package/dist/mcp/tools/contract.d.ts +25 -0
- package/dist/mcp/tools/contract.d.ts.map +1 -0
- package/dist/mcp/tools/contract.js +33 -0
- package/dist/mcp/tools/contract.js.map +1 -0
- package/dist/mcp/tools/contract_tool.d.ts +3 -0
- package/dist/mcp/tools/contract_tool.d.ts.map +1 -0
- package/dist/mcp/tools/contract_tool.js +328 -0
- package/dist/mcp/tools/contract_tool.js.map +1 -0
- package/dist/mcp/tools/get_task_tool.d.ts +3 -0
- package/dist/mcp/tools/get_task_tool.d.ts.map +1 -0
- package/dist/mcp/tools/get_task_tool.js +55 -0
- package/dist/mcp/tools/get_task_tool.js.map +1 -0
- package/dist/mcp/tools/list_tasks_tool.d.ts +3 -0
- package/dist/mcp/tools/list_tasks_tool.d.ts.map +1 -0
- package/dist/mcp/tools/list_tasks_tool.js +82 -0
- package/dist/mcp/tools/list_tasks_tool.js.map +1 -0
- package/dist/mcp/tools/search_tool.d.ts +3 -0
- package/dist/mcp/tools/search_tool.d.ts.map +1 -0
- package/dist/mcp/tools/search_tool.js +155 -0
- package/dist/mcp/tools/search_tool.js.map +1 -0
- package/dist/mcp/tools/subtask_tool.d.ts +3 -0
- package/dist/mcp/tools/subtask_tool.d.ts.map +1 -0
- package/dist/mcp/tools/subtask_tool.js +321 -0
- package/dist/mcp/tools/subtask_tool.js.map +1 -0
- package/dist/mcp/tools/task_add_tool.d.ts +3 -0
- package/dist/mcp/tools/task_add_tool.d.ts.map +1 -0
- package/dist/mcp/tools/task_add_tool.js +196 -0
- package/dist/mcp/tools/task_add_tool.js.map +1 -0
- package/dist/mcp/tools/task_complete_tool.d.ts +3 -0
- package/dist/mcp/tools/task_complete_tool.d.ts.map +1 -0
- package/dist/mcp/tools/task_complete_tool.js +265 -0
- package/dist/mcp/tools/task_complete_tool.js.map +1 -0
- package/dist/mcp/tools/task_delete_tool.d.ts +3 -0
- package/dist/mcp/tools/task_delete_tool.d.ts.map +1 -0
- package/dist/mcp/tools/task_delete_tool.js +87 -0
- package/dist/mcp/tools/task_delete_tool.js.map +1 -0
- package/dist/mcp/tools/task_move_tool.d.ts +3 -0
- package/dist/mcp/tools/task_move_tool.d.ts.map +1 -0
- package/dist/mcp/tools/task_move_tool.js +187 -0
- package/dist/mcp/tools/task_move_tool.js.map +1 -0
- package/dist/mcp/tools/task_patch_tool.d.ts +3 -0
- package/dist/mcp/tools/task_patch_tool.d.ts.map +1 -0
- package/dist/mcp/tools/task_patch_tool.js +189 -0
- package/dist/mcp/tools/task_patch_tool.js.map +1 -0
- package/dist/schemas/base.json +159 -0
- package/dist/schemas/board.json +290 -0
- package/dist/tui/BrainfileTUI.d.ts +4 -0
- package/dist/tui/BrainfileTUI.d.ts.map +1 -0
- package/dist/tui/BrainfileTUI.js +272 -0
- package/dist/tui/BrainfileTUI.js.map +1 -0
- package/dist/tui/actions.d.ts +84 -0
- package/dist/tui/actions.d.ts.map +1 -0
- package/dist/tui/actions.js +1251 -0
- package/dist/tui/actions.js.map +1 -0
- package/dist/tui/components/ColumnTabs.d.ts +9 -0
- package/dist/tui/components/ColumnTabs.d.ts.map +1 -0
- package/dist/tui/components/ColumnTabs.js +34 -0
- package/dist/tui/components/ColumnTabs.js.map +1 -0
- package/dist/tui/components/Header.d.ts +15 -0
- package/dist/tui/components/Header.d.ts.map +1 -0
- package/dist/tui/components/Header.js +48 -0
- package/dist/tui/components/Header.js.map +1 -0
- package/dist/tui/components/HelpOverlay.d.ts +9 -0
- package/dist/tui/components/HelpOverlay.d.ts.map +1 -0
- package/dist/tui/components/HelpOverlay.js +116 -0
- package/dist/tui/components/HelpOverlay.js.map +1 -0
- 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 +10 -0
- package/dist/tui/components/MainPanelTabs.d.ts.map +1 -0
- package/dist/tui/components/MainPanelTabs.js +56 -0
- package/dist/tui/components/MainPanelTabs.js.map +1 -0
- package/dist/tui/components/ManualBorder.d.ts +42 -0
- package/dist/tui/components/ManualBorder.d.ts.map +1 -0
- package/dist/tui/components/ManualBorder.js +56 -0
- package/dist/tui/components/ManualBorder.js.map +1 -0
- package/dist/tui/components/Overlays.d.ts +41 -0
- package/dist/tui/components/Overlays.d.ts.map +1 -0
- package/dist/tui/components/Overlays.js +127 -0
- package/dist/tui/components/Overlays.js.map +1 -0
- package/dist/tui/components/ProgressBar.d.ts +8 -0
- package/dist/tui/components/ProgressBar.d.ts.map +1 -0
- package/dist/tui/components/ProgressBar.js +35 -0
- package/dist/tui/components/ProgressBar.js.map +1 -0
- package/dist/tui/components/RulesPanel.d.ts +25 -0
- package/dist/tui/components/RulesPanel.d.ts.map +1 -0
- package/dist/tui/components/RulesPanel.js +139 -0
- package/dist/tui/components/RulesPanel.js.map +1 -0
- package/dist/tui/components/SearchBar.d.ts +8 -0
- package/dist/tui/components/SearchBar.d.ts.map +1 -0
- package/dist/tui/components/SearchBar.js +38 -0
- package/dist/tui/components/SearchBar.js.map +1 -0
- package/dist/tui/components/StackedTaskList.d.ts +27 -0
- package/dist/tui/components/StackedTaskList.d.ts.map +1 -0
- package/dist/tui/components/StackedTaskList.js +120 -0
- package/dist/tui/components/StackedTaskList.js.map +1 -0
- package/dist/tui/components/StatusBar.d.ts +14 -0
- package/dist/tui/components/StatusBar.d.ts.map +1 -0
- package/dist/tui/components/StatusBar.js +42 -0
- package/dist/tui/components/StatusBar.js.map +1 -0
- package/dist/tui/components/TaskCard.d.ts +25 -0
- package/dist/tui/components/TaskCard.d.ts.map +1 -0
- package/dist/tui/components/TaskCard.js +221 -0
- package/dist/tui/components/TaskCard.js.map +1 -0
- package/dist/tui/components/TaskCardMeasure.d.ts +31 -0
- package/dist/tui/components/TaskCardMeasure.d.ts.map +1 -0
- package/dist/tui/components/TaskCardMeasure.js +133 -0
- package/dist/tui/components/TaskCardMeasure.js.map +1 -0
- package/dist/tui/components/TaskDetail.d.ts +13 -0
- package/dist/tui/components/TaskDetail.d.ts.map +1 -0
- package/dist/tui/components/TaskDetail.js +64 -0
- package/dist/tui/components/TaskDetail.js.map +1 -0
- package/dist/tui/components/TaskList.d.ts +12 -0
- package/dist/tui/components/TaskList.d.ts.map +1 -0
- package/dist/tui/components/TaskList.js +75 -0
- package/dist/tui/components/TaskList.js.map +1 -0
- package/dist/tui/components/index.d.ts +31 -0
- package/dist/tui/components/index.d.ts.map +1 -0
- package/dist/tui/components/index.js +43 -0
- package/dist/tui/components/index.js.map +1 -0
- package/dist/tui/hooks/index.d.ts +3 -0
- package/dist/tui/hooks/index.d.ts.map +1 -0
- package/dist/tui/hooks/index.js +8 -0
- package/dist/tui/hooks/index.js.map +1 -0
- package/dist/tui/hooks/useBrainfileLoader.d.ts +5 -0
- package/dist/tui/hooks/useBrainfileLoader.d.ts.map +1 -0
- package/dist/tui/hooks/useBrainfileLoader.js +237 -0
- package/dist/tui/hooks/useBrainfileLoader.js.map +1 -0
- package/dist/tui/hooks/useKeyboardNavigation.d.ts +20 -0
- package/dist/tui/hooks/useKeyboardNavigation.d.ts.map +1 -0
- package/dist/tui/hooks/useKeyboardNavigation.js +806 -0
- package/dist/tui/hooks/useKeyboardNavigation.js.map +1 -0
- package/dist/tui/index.d.ts +10 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +38 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/theme.d.ts +119 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +138 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/tui/types.d.ts +53 -0
- package/dist/tui/types.d.ts.map +1 -0
- package/dist/tui/types.js +12 -0
- package/dist/tui/types.js.map +1 -0
- package/dist/tui/utils.d.ts +24 -0
- package/dist/tui/utils.d.ts.map +1 -0
- package/dist/tui/utils.js +161 -0
- package/dist/tui/utils.js.map +1 -0
- package/dist/utils/archive.d.ts +57 -0
- package/dist/utils/archive.d.ts.map +1 -0
- package/dist/utils/archive.js +304 -0
- package/dist/utils/archive.js.map +1 -0
- package/dist/utils/auth-store.d.ts +69 -0
- package/dist/utils/auth-store.d.ts.map +1 -0
- package/dist/utils/auth-store.js +308 -0
- package/dist/utils/auth-store.js.map +1 -0
- 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/brainfile-finder.d.ts +12 -0
- package/dist/utils/brainfile-finder.d.ts.map +1 -0
- package/dist/utils/brainfile-finder.js +69 -0
- package/dist/utils/brainfile-finder.js.map +1 -0
- package/dist/utils/brainfile-path.d.ts +10 -0
- package/dist/utils/brainfile-path.d.ts.map +1 -0
- package/dist/utils/brainfile-path.js +88 -0
- package/dist/utils/brainfile-path.js.map +1 -0
- package/dist/utils/cli-error.d.ts +44 -0
- package/dist/utils/cli-error.d.ts.map +1 -0
- package/dist/utils/cli-error.js +85 -0
- package/dist/utils/cli-error.js.map +1 -0
- package/dist/utils/config.d.ts +119 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +304 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/contractSpec.d.ts +13 -0
- package/dist/utils/contractSpec.d.ts.map +1 -0
- package/dist/utils/contractSpec.js +61 -0
- package/dist/utils/contractSpec.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/errorHandler.d.ts +106 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/errorHandler.js +223 -0
- package/dist/utils/errorHandler.js.map +1 -0
- package/dist/utils/git-helper.d.ts +17 -0
- package/dist/utils/git-helper.d.ts.map +1 -0
- package/dist/utils/git-helper.js +62 -0
- package/dist/utils/git-helper.js.map +1 -0
- package/dist/utils/github-auth.d.ts +56 -0
- package/dist/utils/github-auth.d.ts.map +1 -0
- package/dist/utils/github-auth.js +341 -0
- package/dist/utils/github-auth.js.map +1 -0
- package/dist/utils/hook-parser.d.ts +15 -0
- package/dist/utils/hook-parser.d.ts.map +1 -0
- package/dist/utils/hook-parser.js +69 -0
- package/dist/utils/hook-parser.js.map +1 -0
- package/dist/utils/hook-settings.d.ts +27 -0
- package/dist/utils/hook-settings.d.ts.map +1 -0
- package/dist/utils/hook-settings.js +364 -0
- package/dist/utils/hook-settings.js.map +1 -0
- package/dist/utils/linear-auth.d.ts +59 -0
- package/dist/utils/linear-auth.d.ts.map +1 -0
- package/dist/utils/linear-auth.js +295 -0
- package/dist/utils/linear-auth.js.map +1 -0
- package/dist/utils/logger.d.ts +34 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +56 -0
- package/dist/utils/logger.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 +112 -0
- package/dist/utils/v2-detect.js.map +1 -0
- package/dist/utils/v2-only.d.ts +9 -0
- package/dist/utils/v2-only.d.ts.map +1 -0
- package/dist/utils/v2-only.js +64 -0
- package/dist/utils/v2-only.js.map +1 -0
- package/dist/utils/workspace-format.d.ts +25 -0
- package/dist/utils/workspace-format.d.ts.map +1 -0
- package/dist/utils/workspace-format.js +106 -0
- package/dist/utils/workspace-format.js.map +1 -0
- package/dist/validation/command-lint.d.ts +11 -0
- package/dist/validation/command-lint.d.ts.map +1 -0
- package/dist/validation/command-lint.js +88 -0
- package/dist/validation/command-lint.js.map +1 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# @brainfile/cli
|
|
2
|
+
|
|
3
|
+
CLI for the [Brainfile](https://brainfile.md) task coordination protocol. Manage tasks, contracts, and ADRs from your terminal. Includes a TUI board view and an MCP server for AI agent integration.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g @brainfile/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
Initialize a new brainfile in your project root:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
brainfile init
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This creates the standard v2 structure:
|
|
20
|
+
- `.brainfile/brainfile.md` (Configuration, rules, definitions)
|
|
21
|
+
- `.brainfile/board/` (Active tasks)
|
|
22
|
+
- `.brainfile/logs/` (Completed task files)
|
|
23
|
+
|
|
24
|
+
The board comes pre-configured with `To Do` and `In Progress` columns.
|
|
25
|
+
|
|
26
|
+
### Migrating older layouts
|
|
27
|
+
|
|
28
|
+
If your repo still has a legacy `brainfile.md` layout, normal runtime commands will ask you to migrate before continuing. Run `brainfile migrate` from the directory that contains the old file, or pass `--dir` to point at that directory:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
brainfile migrate --dir .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This upgrades your workspace to v2 (`.brainfile/brainfile.md` + `board/` + `logs/`). Use `--logs-to-ledger` when you also want legacy `logs/*.md` files migrated into `ledger.jsonl`.
|
|
35
|
+
|
|
36
|
+
## Core Workflow
|
|
37
|
+
|
|
38
|
+
### Add Tasks
|
|
39
|
+
Create new tasks with rich metadata.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Basic task
|
|
43
|
+
brainfile add --title "Implement login" --column todo
|
|
44
|
+
|
|
45
|
+
# Full featured task
|
|
46
|
+
brainfile add \
|
|
47
|
+
--title "Refactor database layer" \
|
|
48
|
+
--type task \
|
|
49
|
+
--column todo \
|
|
50
|
+
--priority high \
|
|
51
|
+
--assignee @josh \
|
|
52
|
+
--tags "refactor,db" \
|
|
53
|
+
--parent epic-123
|
|
54
|
+
|
|
55
|
+
# Create a parent with children in one shot
|
|
56
|
+
brainfile add -c todo -t "Auth overhaul" \
|
|
57
|
+
--child "OAuth flow" --child "Session hardening"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Key Flags:**
|
|
61
|
+
- `--title, -t`: Task summary
|
|
62
|
+
- `--type`: `task`, `epic`, or `adr` (default: `task`)
|
|
63
|
+
- `--column, -c`: Target column ID
|
|
64
|
+
- `--parent`: Parent task/epic ID
|
|
65
|
+
- `--child`: Create child task(s) under the new parent (repeatable)
|
|
66
|
+
- `--priority, -p`: `low`, `medium`, `high`, `critical`
|
|
67
|
+
- `--tags`: Comma-separated list
|
|
68
|
+
|
|
69
|
+
### List Tasks
|
|
70
|
+
View your board from the command line.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
brainfile list # View all active tasks
|
|
74
|
+
brainfile list --column todo # Filter by column
|
|
75
|
+
brainfile list --tag bug # Filter by tag
|
|
76
|
+
brainfile list --parent epic-123 # See all children of an epic
|
|
77
|
+
brainfile list --contract ready # See tasks with contracts waiting for pickup
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Manage Tasks
|
|
81
|
+
Manipulate tasks as you work.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# View details
|
|
85
|
+
brainfile show -t task-10
|
|
86
|
+
|
|
87
|
+
# Move to another column
|
|
88
|
+
brainfile move -t task-10 -c in-progress
|
|
89
|
+
|
|
90
|
+
# Update fields
|
|
91
|
+
brainfile patch -t task-10 --priority critical --tags "frontend,urgent"
|
|
92
|
+
|
|
93
|
+
# Clear fields
|
|
94
|
+
brainfile patch -t task-10 --clear-tags --clear-assignee
|
|
95
|
+
|
|
96
|
+
# Delete (permanently)
|
|
97
|
+
brainfile delete -t task-10 --force
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Complete
|
|
101
|
+
When a task is done, complete it from the active board.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
brainfile complete -t task-10
|
|
105
|
+
```
|
|
106
|
+
This writes `.brainfile/logs/task-10.md` with a completion timestamp and removes the active task file from `.brainfile/board/`. Use `brainfile log` to view completed task history.
|
|
107
|
+
|
|
108
|
+
## Types
|
|
109
|
+
|
|
110
|
+
Brainfile supports different document types.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
brainfile types list # See configured types
|
|
114
|
+
brainfile types list --json # Output configured types as JSON
|
|
115
|
+
brainfile types add epic # Add a type (use --id-prefix, --completable, or --schema to customize it)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Contracts: Working with AI Agents
|
|
119
|
+
|
|
120
|
+
Contracts allow you to define explicit deliverables and validation rules for AI agents.
|
|
121
|
+
|
|
122
|
+
### 1. Create a Contract
|
|
123
|
+
Add a task with a contract definition.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
brainfile add -c todo -t "Optimize image loader" \
|
|
127
|
+
--with-contract \
|
|
128
|
+
--deliverable "file:src/utils/loader.ts:Optimized implementation" \
|
|
129
|
+
--validation "npm test -- loader" \
|
|
130
|
+
--constraint "Must use lazy loading"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 2. Pickup (Agent)
|
|
134
|
+
The agent claims the task.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
brainfile contract pickup -t task-45
|
|
138
|
+
```
|
|
139
|
+
Status changes to `in_progress`. Metrics tracking begins.
|
|
140
|
+
|
|
141
|
+
### 3. Deliver (Agent)
|
|
142
|
+
The agent marks work as ready for review.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
brainfile contract deliver -t task-45
|
|
146
|
+
```
|
|
147
|
+
Status changes to `delivered`.
|
|
148
|
+
|
|
149
|
+
### 4. Validate (User)
|
|
150
|
+
Run the validation commands and check deliverables.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
brainfile contract validate -t task-45
|
|
154
|
+
```
|
|
155
|
+
- **Pass**: Contract status becomes `done`.
|
|
156
|
+
- **Fail**: Contract status becomes `failed` and records feedback for rework.
|
|
157
|
+
|
|
158
|
+
## ADR Promotion
|
|
159
|
+
|
|
160
|
+
Architecture Decision Records (ADRs) are first-class task files. You can promote an ADR into a project rule.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# 1. Create an ADR
|
|
164
|
+
brainfile add -t "Use Postgres for all user data" --type adr -c todo
|
|
165
|
+
|
|
166
|
+
# 2. Promote it to a rule
|
|
167
|
+
brainfile adr promote -t adr-1 --category always
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Categories:**
|
|
171
|
+
- `always`: Strict rules (e.g., "Always use TypeScript")
|
|
172
|
+
- `never`: Prohibitions (e.g., "Never commit secrets")
|
|
173
|
+
- `prefer`: Guidelines (e.g., "Prefer functional components")
|
|
174
|
+
- `context`: informational context
|
|
175
|
+
|
|
176
|
+
Promoted rules are added to `.brainfile/brainfile.md`, and the promoted ADR file moves to `.brainfile/logs/`.
|
|
177
|
+
|
|
178
|
+
## TUI (Terminal UI)
|
|
179
|
+
|
|
180
|
+
Launch the interactive board:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
brainfile # No arguments launches the TUI
|
|
184
|
+
brainfile tui # Explicit subcommand also works
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Panels
|
|
188
|
+
- **Tasks (`1`)**: Kanban view of active tasks.
|
|
189
|
+
- **Rules (`2`)**: Active rules and configuration.
|
|
190
|
+
- **Logs (`3`)**: Completed task files.
|
|
191
|
+
|
|
192
|
+
### Keyboard Shortcuts
|
|
193
|
+
| Key | Action |
|
|
194
|
+
|-----|--------|
|
|
195
|
+
| `tab` / `shift+tab` | Next / previous column in wide mode |
|
|
196
|
+
| `j` / `k` | Down / up |
|
|
197
|
+
| `enter` | Expand or collapse the selected task |
|
|
198
|
+
| `n` | New task |
|
|
199
|
+
| `m` | Move task |
|
|
200
|
+
| `e` | Edit task in `$EDITOR` |
|
|
201
|
+
| `/` | Search |
|
|
202
|
+
| `?` | Show help |
|
|
203
|
+
| `q` | Quit |
|
|
204
|
+
|
|
205
|
+
## AI Integration
|
|
206
|
+
|
|
207
|
+
The CLI includes an MCP (Model Context Protocol) server.
|
|
208
|
+
|
|
209
|
+
Add to your `claude_desktop_config.json`:
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"mcpServers": {
|
|
214
|
+
"brainfile": {
|
|
215
|
+
"command": "npx",
|
|
216
|
+
"args": ["@brainfile/cli", "mcp"]
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
This registers MCP tools to list, read, search, create, update, move, complete, and delete tasks; manage subtasks; and run contract workflows.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Task } from '@brainfile/core';
|
|
2
|
+
export interface V2TestWorkspace {
|
|
3
|
+
tempDir: string;
|
|
4
|
+
dotDir: string;
|
|
5
|
+
brainfilePath: string;
|
|
6
|
+
boardDir: string;
|
|
7
|
+
logsDir: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function createV2TestWorkspace(prefix?: string, config?: string): V2TestWorkspace;
|
|
10
|
+
export declare function writeV2Task(workspace: V2TestWorkspace, task: Task, body?: string): string;
|
|
11
|
+
export declare function readV2Task(workspace: V2TestWorkspace, taskId: string): import("@brainfile/core").TaskDocument | null;
|
|
12
|
+
//# sourceMappingURL=v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../../src/__tests__/helpers/v2.ts"],"names":[],"mappings":"AAGA,OAAO,EAA6C,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,SAAuB,EAC7B,MAAM,SAWP,GACE,eAAe,CAYjB;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,SAAK,GAAG,MAAM,CAIrF;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,iDAEpE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.createV2TestWorkspace = createV2TestWorkspace;
|
|
37
|
+
exports.writeV2Task = writeV2Task;
|
|
38
|
+
exports.readV2Task = readV2Task;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const os = __importStar(require("os"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const core_1 = require("@brainfile/core");
|
|
43
|
+
function createV2TestWorkspace(prefix = 'brainfile-v2-test-', config = `---
|
|
44
|
+
title: Test Board
|
|
45
|
+
schema: https://brainfile.md/v2/board.json
|
|
46
|
+
columns:
|
|
47
|
+
- id: todo
|
|
48
|
+
title: To Do
|
|
49
|
+
- id: in-progress
|
|
50
|
+
title: In Progress
|
|
51
|
+
- id: done
|
|
52
|
+
title: Done
|
|
53
|
+
---
|
|
54
|
+
`) {
|
|
55
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
|
|
56
|
+
const dotDir = path.join(tempDir, '.brainfile');
|
|
57
|
+
const boardDir = path.join(dotDir, 'board');
|
|
58
|
+
const logsDir = path.join(dotDir, 'logs');
|
|
59
|
+
const brainfilePath = path.join(dotDir, 'brainfile.md');
|
|
60
|
+
fs.mkdirSync(boardDir, { recursive: true });
|
|
61
|
+
fs.mkdirSync(logsDir, { recursive: true });
|
|
62
|
+
fs.writeFileSync(brainfilePath, config, 'utf-8');
|
|
63
|
+
return { tempDir, dotDir, brainfilePath, boardDir, logsDir };
|
|
64
|
+
}
|
|
65
|
+
function writeV2Task(workspace, task, body = '') {
|
|
66
|
+
const filePath = path.join(workspace.boardDir, (0, core_1.taskFileName)(task.id));
|
|
67
|
+
(0, core_1.writeTaskFile)(filePath, task, body);
|
|
68
|
+
return filePath;
|
|
69
|
+
}
|
|
70
|
+
function readV2Task(workspace, taskId) {
|
|
71
|
+
return (0, core_1.readTaskFile)(path.join(workspace.boardDir, (0, core_1.taskFileName)(taskId)));
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2.js","sourceRoot":"","sources":["../../../src/__tests__/helpers/v2.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,sDA0BC;AAED,kCAIC;AAED,gCAEC;AAjDD,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,0CAAuF;AAUvF,SAAgB,qBAAqB,CACnC,MAAM,GAAG,oBAAoB,EAC7B,MAAM,GAAG;;;;;;;;;;;CAWV;IAEC,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAExD,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC/D,CAAC;AAED,SAAgB,WAAW,CAAC,SAA0B,EAAE,IAAU,EAAE,IAAI,GAAG,EAAE;IAC3E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAA,mBAAY,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACtE,IAAA,oBAAa,EAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAgB,UAAU,CAAC,SAA0B,EAAE,MAAc;IACnE,OAAO,IAAA,mBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAA,mBAAY,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|