Set up the Brief CLI

Install Brief's command-line tool, sign in, connect a coding agent, and use Brief from your terminal.

Last updated: October 20, 2026

Use the Brief CLI to ask questions, find decisions and documents, and work with Brief from a terminal.

Install and sign in

The CLI is published as @briefhq/cli on npm and requires Node.js 22.13 or later. Check your installed version, then install the CLI and sign in:

node --version
npm install -g @briefhq/cli
brief login
brief status

brief login opens a browser for sign-in. On a remote machine, use brief login --device: the CLI prints a URL and code to approve in another browser. The older --no-browser option starts the same flow. You can also use npx @briefhq/cli@latest <command>, pnpm add -g @briefhq/cli, or yarn dlx @briefhq/cli@latest <command>.

brief status shows Auth, Org ID, Auth Method, and Workspace. Check that Auth says Authenticated and Workspace is the one you intend to use. If the selected workspace differs from the signed-in credential's workspace, the command shows a warning.

The CLI keeps signed-in credentials in your user configuration directory (~/.config/brief/ by default, or under XDG_CONFIG_HOME when set) and refreshes an expired access token when it can. brief logout removes the saved login and attempts to revoke its access token.

For unattended scripts, create an API key under Integrations → Connect Brief Into Another Tool → API Keys → New Key…. Supply it as BRIEF_API_KEY through your secret manager; do not commit it to a repository. The CLI checks BRIEF_TOKEN, global --token, BRIEF_API_KEY, then saved login credentials, in that order. brief token prints the credential currently in use; it does not create an API key. A browser sign-in access token expires.

Connect a coding agent

In a project that already has a supported coding agent's configuration, run brief init to detect it and install Brief instructions. In a new project without an agent configuration, name the agent explicitly:

brief init --agent codex

Supported values for --agent are cursor, claude, copilot (or vscode), windsurf, cline, codex, junie, and all. You can provide several values separated by commas. brief init installs agent skill and instruction files; it does not configure an MCP connection. For that path, see Set up Brief MCP.

AgentProject skillProject instructions
Claude Code.claude/skills/brief/SKILL.mdCLAUDE.md, or an existing AGENTS.md when no Claude instruction file takes precedence
Cursor.cursor/skills/brief/SKILL.md.cursor/rules/brief-context.mdc
GitHub Copilot / VS Code.agents/skills/brief/SKILL.md.github/copilot-instructions.md
Windsurf.windsurf/skills/brief/SKILL.md.windsurfrules
Cline.agents/skills/brief/SKILL.md.clinerules
Codex.agents/skills/brief/SKILL.mdAGENTS.md
Junie.junie/skills/brief/SKILL.md.junie/AGENTS.md

Use brief init --global for global skill files, --refresh to update installed content, or --no-scan to skip packing and uploading codebase context. Restart your coding agent after setup.

Ask and continue

brief ask "What decisions affect onboarding?"
brief ask --mode check "Does this plan conflict with an existing decision?"
brief ask --mode decide "Which approach should we choose?"
brief ask --context "Updating onboarding" "What should I consider?"
brief ask -c <conversation-id> "What should we change?"
brief ask --new "Start a different topic"
brief ask --fast "Find decisions about onboarding"

Normal brief ask calls can continue the current coding session's conversation. -c uses a specific conversation for that question without changing the session default; --new starts a fresh one. --fast is a separate, stateless lookup, so it cannot continue a conversation.

The default advise mode offers guidance; check checks an approach; decide asks for a recommendation. Use brief conversations list to find earlier conversations and brief conversations get <id> to read one. --stream streams readable answer text, --model <id> selects a model, and --folder <uuid> or --docs <comma-separated-uuids> narrows document context. Repeat --attach <path> to attach files to an Ask turn.

For a longer Ask turn in a terminal, the CLI shows elapsed time and tool progress while it waits for an answer.

You can also use brief decisions search "onboarding", brief docs search "onboarding", and brief workspace list. To change workspaces, use brief workspace switch <id> with an ID from the list. Environment-based credentials are tied to one workspace, so switching requires a credential for the destination or interactive sign-in.

You can set a plain-language expiry condition when recording or confirming a decision:

brief decisions create --decision "Use the preview API" --rationale "Needed for the pilot" --expires-when "when the stable API ships"
brief decisions confirm <id> --expires-when "when the stable API ships"

For a live conversation in your terminal, see Chat with Brief in a terminal.

Other commands

TaskExample commands
Decisionsbrief decisions list; brief decisions get <id>; brief decisions reject <id> --reason "Superseded"
Documentsbrief docs browse; brief docs read <id>; brief docs import ./specs/ --folder <folder-id>
Product contextbrief context; brief context --json
Research signalsbrief signals list --type pain-point --source granola; brief signals search "onboarding"
Personasbrief personas list; brief personas get <id>
Featuresbrief features list; brief features get <id>
Work pipelinebrief pipeline
Marketbrief market competitors --status active; brief market deals --stage "negotiation" --source hubspot; brief market positioning
Workspace skillsbrief skills list; brief skills get <name>; brief skills create ./prd-writer.md; brief skills update <name> <file>; brief skills archive <name>; brief skills import <url>

See Skills for skill file format, update version requirements, and archive restrictions.

To create a document, use brief docs browse to get a folder ID, then brief docs create --title "API Design" --folder <folder-id> --content "...". See Documents for document tasks and comments, Decisions for review, and Research signals, Features, and Market for those topics.

For exploratory decisions, pass --isolation <key> to brief decisions create, then run brief decisions review --isolation <key>. brief decisions promote <id> makes an isolated decision workspace-wide. Decision search and list also accept --isolation <key>.

brief skill show prints the Brief product skill for coding agents. brief skills manages workspace skills. brief build "Add a health check endpoint" starts a specification draft for review. brief build --confirm "..." approves that draft for noninteractive use. The current flow can stop after specification approval without completing a build.

JSON output and global options

Use --json for structured output and --jq <expression> to filter it with jq:

brief decisions list --json
brief decisions list --json --jq '.data[0].decision'

For a scripted follow-up, capture conversation_id from the first Ask response and pass it to -c:

response=$(brief ask "What's our auth strategy?" --json)
conversation_id=$(printf '%s\n' "$response" | jq -r '.data.conversation_id')
brief ask -c "$conversation_id" "What are the risks?" --json

Other global options include -q/--quiet, --no-color, --org <org-id>, --session <id> for a named Ask and decision scope, and --no-update-check. Avoid typing --token <token> into shell history; supply secrets through a secret manager.

When a command needs attention

If the API limits a request, the CLI shows how many seconds to wait when the server provides a retry time. If your CLI or terminal client is below the supported minimum version, the API returns an upgrade message. Update the CLI with npm install -g @briefhq/cli.

If brief is not found, check that your global package bin directory is on PATH or use npx @briefhq/cli@latest <command>. If sign-in fails, run brief status and then brief login; use --device when the terminal cannot open a browser. For the wrong workspace, run brief workspace list followed by brief workspace switch <id>. If results look out of date, check the connected tool on Integrations.

To send a bug report, support request, feature request, or general feedback:

brief feedback submit --type bug --title "Short summary" --body "What happened and what you expected"