Skip to content

CLI Command Reference

Complete documentation for all @brainfile/cli commands.

Most Used Commands

CommandJump to
brainfile addCreate tasks with contracts, subtasks, and metadata
brainfile listFilter and display tasks by column, tag, or contract status
brainfile moveMove tasks between columns
brainfile completeComplete tasks — move from board/ to logs/
brainfile contractManage contracts — pickup, deliver, validate
brainfile patchUpdate fields on existing tasks

Command Overview

bash
brainfile [file]        # Open TUI (auto-detects .brainfile/brainfile.md)
brainfile <command>     # Run CLI command
brainfile mcp           # Start MCP server for AI assistants

Commands

CommandDescription
initCreate a new brainfile
listDisplay tasks
showDisplay single task details
addCreate a new task
moveMove task between columns
patchUpdate task fields
deletePermanently delete a task
archiveArchive a task
restoreRestore from archive
subtaskManage subtasks
lintValidate and fix syntax
templateCreate from templates
tuiInteractive terminal UI
hooksAI agent hook integration
completeComplete a task (move to logs/)
contractManage agent-to-agent contracts
adrADR lifecycle management
rulesManage project rules
typesDocument type management
searchSearch tasks and logs
logView completed task logs
migrateMove brainfile to .brainfile/ directory
configManage user configuration
authAuthenticate with external services
mcpMCP server for AI assistants

init

Create a new .brainfile/ project directory with board config, board/, and logs/.

bash
brainfile init
brainfile init --force  # Overwrite existing

Options:

OptionDescription
-f, --file <path>Output path (default: .brainfile/brainfile.md)
--forceOverwrite if file exists

list

Display all tasks with optional filtering.

Essential Command

list is the go-to command for finding tasks. Combine filters like --column and --tag to narrow results. Use --contract ready to find work waiting for agents.

bash
brainfile list
brainfile list --column "In Progress"
brainfile list --tag bug
brainfile list --contract ready

Options:

OptionDescription
-f, --file <path>Path to brainfile (auto-detects .brainfile/brainfile.md)
-c, --column <name>Filter by column
-t, --tag <name>Filter by tag
--parent <id>Filter by parent task ID (parentId)
--contract <status>Filter by contract status (ready, in_progress, delivered, done, failed, blocked)

show

Display full details of a single task.

bash
brainfile show --task task-1
brainfile show -t task-42

Options:

OptionDescription
-t, --task <id>Task ID (required)
-f, --file <path>Path to brainfile (auto-detects .brainfile/brainfile.md)
--jsonOutput task data as JSON

Output includes:

  • Task ID, title, column, priority, tags, assignee
  • Full description
  • Subtasks with completion status
  • Related files
  • Contract details (if present)

add

Create a new task with all available fields.

Power Command

add supports one-shot creation of tasks with contracts, subtasks, and full metadata. Use --with-contract along with --deliverable and --validation to create ready-to-assign work items.

bash
brainfile add --title "Implement auth"
brainfile add --title "Fix bug" --priority high --tags "bug,urgent"
brainfile add --title "Auth overhaul" --child "OAuth flow" --child "Session handling"
brainfile add --title "Design doc" --type adr --column todo

Options:

OptionDescription
-t, --title <text>Task title (required)
-c, --column <name>Target column (default: todo)
-d, --description <text>Task description
-p, --priority <level>low, medium, high, or critical
--type <type>Document type (e.g., epic, adr; default: task)
--parent <id>Parent task/epic ID
--child <title>Create child task(s) under the new parent (repeatable)
--tags <list>Comma-separated tags
--assignee <name>Assignee name
--due-date <date>Due date (YYYY-MM-DD)
--subtasks <list>Comma-separated subtask titles
--files <list>Comma-separated related file paths
--with-contractAttach a contract (status=ready)
--deliverable <spec>Contract deliverable: type:path:description (repeatable)
--validation <command>Contract validation command (repeatable)
--constraint <text>Contract constraint (repeatable)

move

Move a task to a different column.

Workflow Progression

Use move to progress tasks through your workflow. Moving to a completion column (if configured) can auto-complete the task.

bash
brainfile move --task task-1 --column "In Progress"
brainfile move --task task-5 --column done

Options:

OptionDescription
-t, --task <id>Task ID (required)
-c, --column <name>Target column (required)

patch

Update specific fields of a task. Use --clear-* options to remove fields.

bash
brainfile patch --task task-1 --priority critical
brainfile patch --task task-1 --title "Updated" --tags "new,tags"
brainfile patch --task task-1 --clear-assignee

Options:

OptionDescription
-t, --task <id>Task ID (required)
--title <text>New title
--description <text>New description
--priority <level>New priority
--tags <list>New tags (comma-separated)
--assignee <name>New assignee
--due-date <date>New due date
--clear-descriptionRemove description
--clear-priorityRemove priority
--clear-tagsRemove tags
--clear-assigneeRemove assignee
--clear-due-dateRemove due date

delete

Permanently delete a task. Requires confirmation.

bash
brainfile delete --task task-1 --force

Options:

OptionDescription
-t, --task <id>Task ID (required)
--forceConfirm deletion (required)

archive

Archive a task locally or to an external service (GitHub Issues, Linear).

bash
brainfile archive --task task-1
brainfile archive --task task-1 --to github
brainfile archive --all --to linear --dry-run

Options:

OptionDescription
-t, --task <id>Task ID to archive
--to <destination>Archive destination: local, github, or linear
--allArchive all tasks from local archive to external service
--dry-runPreview what would be created without making changes

restore

Restore an archived task to a column.

bash
brainfile restore --task task-1 --column todo

Options:

OptionDescription
-t, --task <id>Task ID (required)
-c, --column <name>Target column (required)

subtask

Manage subtasks within a task.

bash
brainfile subtask --task task-1 --add "New subtask"
brainfile subtask --task task-1 --toggle task-1-1
brainfile subtask --task task-1 --update task-1-1 --title "Updated"
brainfile subtask --task task-1 --delete task-1-2

Options:

OptionDescription
-t, --task <id>Parent task ID (required)
--add <title>Add a new subtask
--toggle <id>Toggle subtask completion
--update <id>Update subtask (use with --title)
--delete <id>Delete a subtask
--title <text>New title (for --update)

lint

Validate brainfile syntax and auto-fix issues.

bash
brainfile lint              # Check for issues
brainfile lint --fix        # Auto-fix issues
brainfile lint --check      # Exit with error (for CI)

Options:

OptionDescription
-f, --file <path>Path to brainfile (auto-detects .brainfile/brainfile.md)
--fixAutomatically fix issues
--checkExit with error code if issues found

What it checks:

  • YAML syntax errors
  • Unquoted strings with colons (auto-fixable)
  • Duplicate column IDs
  • Missing required fields

template

Create tasks from built-in templates.

bash
brainfile template --list
brainfile template --use bug-report --title "Login fails"
brainfile template --use feature-request --title "Dark mode"

Options:

OptionDescription
-l, --listList available templates
-u, --use <id>Create from template
--title <text>Task title (required with --use)
--description <text>Task description
-c, --column <name>Target column (default: todo)

Built-in Templates:

  • bug-report — Bug tracking with triage steps
  • feature-request — Feature proposals
  • refactor — Code refactoring tasks

tui

Launch interactive terminal UI. This is the default when running brainfile without arguments.

bash
brainfile              # Opens TUI (auto-detects .brainfile/brainfile.md)
brainfile ./tasks.md   # Opens TUI with specific file
brainfile tui          # Explicit TUI command

Keyboard Controls:

KeyAction
TAB / Shift+TABNavigate columns
j/k or /Navigate tasks
EnterExpand/collapse task
/Search tasks
?Show help
rRefresh
qQuit

hooks

Install integration hooks for AI coding assistants.

bash
brainfile hooks install claude-code
brainfile hooks install cursor --scope project
brainfile hooks install cline
brainfile hooks list
brainfile hooks uninstall claude-code --scope all

Supported Assistants:

  • Claude Code
  • Cursor
  • Cline

Options:

OptionDescription
--scope <scope>user (default), project, or all

complete

Complete a task — moves it from board/ to logs/.

Board Hygiene

complete archives finished work to logs/, keeping your active board clean. Use --force for epics with remaining child tasks.

bash
brainfile complete --task task-1
brainfile complete -t epic-1 --force

Options:

OptionDescription
-t, --task <id>Task ID (required)
--forceForce epic completion even if child tasks are still active

contract

Manage the lifecycle of agent-to-agent contracts.

Agent Coordination

The contract command drives the full agent-to-agent workflow: pickupdelivervalidate. See the Contracts Guide for lifecycle details.

bash
brainfile contract pickup --task task-1
brainfile contract deliver --task task-1
brainfile contract validate --task task-1
brainfile contract attach --task task-1 --deliverable "file:src/feature.ts:Implementation"

Subcommands:

CommandDescription
pickupClaim a contract and set status to in_progress
deliverMark contract as delivered (ready for validation)
validateCheck deliverables and run validation commands
attachAdd contract to existing task

Common Options:

OptionDescription
-t, --task <id>Task ID (required)
-f, --file <path>Path to brainfile (auto-detects .brainfile/brainfile.md)

Attach Options:

OptionDescription
--deliverable <spec>Add deliverable (format: type:path:description)
--validation <command>Add validation command (repeatable)
--constraint <text>Add constraint (repeatable)

See the Contract Commands Reference for detailed documentation.


adr

Manage Architecture Decision Records.

bash
brainfile adr promote -t adr-1 --category always

Options:

OptionDescription
-t, --task <id>ADR task ID (required)
--category <cat>Rule category: prefer, always, never, context

rules

Manage project rules.

bash
brainfile rules                          # List all rules
brainfile rules list --category always   # Filter by category
brainfile rules add always "Write tests" # Add a rule
brainfile rules delete always 1          # Delete rule by ID

types

Inspect and manage board document types.

bash
brainfile types list
brainfile types add epic --completable true --id-prefix epic

Search across active tasks and completed logs.

bash
brainfile search "auth"
brainfile search "bug" --column todo

log

View and search completed task logs.

bash
brainfile log                      # List recent completions
brainfile log -t task-10           # View specific log
brainfile log --search "auth"      # Search logs

note

Append a timestamped note to a task's log section.

bash
brainfile note -t task-1 "Started implementation"
brainfile note -t task-1 "Fixed failing test" --agent codex

Options:

OptionDescription
-t, --task <id>Task ID (required)
--agent <name>Agent name for attribution
[message]Log message to append (positional argument)

migrate

Move root brainfile.md to .brainfile/ directory structure.

bash
brainfile migrate
brainfile migrate --dir ./project
brainfile migrate --force

Options:

OptionDescription
--dir <path>Project directory (default: current directory)
--forceOverwrite existing .brainfile/brainfile.md

What it does:

  • Creates .brainfile/ directory
  • Moves brainfile.md.brainfile/brainfile.md
  • Creates .brainfile/.gitignore (ignores state.json)
  • Preserves all content exactly

config

Manage user configuration stored in ~/.config/brainfile/config.json.

bash
brainfile config list
brainfile config get archive.default
brainfile config set archive.default github
brainfile config path

Subcommands:

CommandDescription
listShow all configuration values
get <key>Get specific config value
set <key> <value>Set config value
pathShow config file path

Common Config Keys:

  • archive.default — Default archive destination (local, github, linear)
  • archive.github.owner — GitHub repository owner
  • archive.github.repo — GitHub repository name
  • archive.linear.teamId — Linear team ID

auth

Authenticate with external services for archive functionality.

bash
brainfile auth github
brainfile auth linear --token <api-key>
brainfile auth status
brainfile auth logout github

Subcommands:

CommandDescription
github [--token <token>]Authenticate with GitHub (auto-detects gh CLI or uses OAuth)
linear --token <token>Authenticate with Linear API
statusShow authentication status for all services
logout [provider] [--all]Log out from service(s)

Options:

OptionDescription
--token <token>API token (required for Linear, optional for GitHub)
--allLog out from all services

mcp

Start an MCP (Model Context Protocol) server for AI assistant integration.

bash
brainfile mcp
brainfile mcp --file ./project/brainfile.md

Options:

OptionDescription
-f, --file <path>Path to brainfile (auto-detects .brainfile/brainfile.md)

Available MCP Tools (30):

Task Management:

ToolDescription
list_tasksList tasks with optional filtering (column, tag, type, contract status)
get_taskGet detailed information about a specific task
search_tasksSearch tasks by query, column, priority, assignee
add_taskCreate a task with title, priority, tags, type, relatedFiles, contracts
move_taskMove task between columns
patch_taskUpdate task fields
delete_taskPermanently delete a task
complete_taskComplete a task (move from board/ to logs/)

Bulk Operations:

ToolDescription
bulk_move_tasksMove multiple tasks to a column
bulk_patch_tasksApply same patch to multiple tasks
bulk_delete_tasksDelete multiple tasks
bulk_archive_tasksArchive multiple tasks

Archiving:

ToolDescription
archive_taskArchive a task (local, GitHub, or Linear)
restore_taskRestore from archive

Subtasks:

ToolDescription
add_subtaskAdd a subtask
toggle_subtaskToggle subtask completion
update_subtaskUpdate subtask title
delete_subtaskDelete a subtask
bulk_set_subtasksSet multiple subtasks to completed or incomplete
complete_all_subtasksMark all subtasks as completed or incomplete

Agent Contracts:

ToolDescription
contract_pickupClaim a contract (status → in_progress)
contract_deliverMark contract as delivered
contract_validateCheck deliverables and run validation commands
attach_contractAdd contract to existing task

Logs, Types, and Rules:

ToolDescription
search_logsSearch completed task logs
append_logAppend a timestamped log entry to a task
list_typesList board type configuration
list_rulesList project rules
add_ruleAdd a project rule
delete_ruleDelete a project rule

Global Options

OptionDescription
--helpDisplay help for command
--versionDisplay CLI version

Exit Codes

CodeMeaning
0Success
1Error (invalid arguments, file not found)
2Validation error (with lint --check)

CI/CD Integration

GitHub Actions

yaml
name: Validate Brainfile
on: [push, pull_request]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Validate
        run: npx @brainfile/cli lint --check

Pre-commit Hook

bash
#!/bin/bash
# .git/hooks/pre-commit

if [ -f "brainfile.md" ]; then
  npx @brainfile/cli lint --check
  if [ $? -ne 0 ]; then
    echo "brainfile.md has validation errors"
    exit 1
  fi
fi

npm Scripts

json
{
  "scripts": {
    "tasks": "brainfile list",
    "tasks:lint": "brainfile lint --fix",
    "precommit": "brainfile lint --check"
  }
}

Next Steps

Released under the MIT License.