Skip to main content

Breign CLI

The breign command brings Breign to your terminal: chat with an agent, pipe a file into it, create and export agents from scripts, call any API route, and run your machine (or a server) as an execution node. Its messages are in French.

Install​

With npm (Node.js 18 or later), on macOS, Linux (x64, arm64) and Windows (x64):

npm install -g @breign/cli

Check it works:

breign --version

Shell completion: breign completions zsh > ~/.zfunc/_breign (also bash, fish, powershell, elvish).

Sign in​

breign login

Your browser opens Breign: sign in if needed, then click Authorize. The CLI stores its access in your system keychain and renews it on its own; after 30 days without any command, sign in again.

On a machine without a browser (SSH, server), the CLI shows a code instead. You can also ask for it directly:

breign login --device

Open the /device page of Breign on any device, enter the code and click Authorize.

For scripts and containers, use an API key instead: breign login --with-api-key < key.txt, or set BREIGN_API_KEY.

Other commands: breign whoami (who you are), breign status (server, account, reachability), breign logout (revokes the access on this machine).

Server and organization​

By default the CLI talks to https://api.breign.eu. For another server, create a profile:

breign profile add dev https://api-dev.example.com --use

breign profile list, breign profile use <name> and -p <name> on any command switch between servers.

If you belong to several organizations, choose one: breign org list, then breign org use <slug>. --org overrides it for one command.

Chat with an agent​

breign chat Support "How do I reset a customer's password?"
  • Without a message, breign chat Support opens an interactive session; /new starts a new conversation, /quit leaves.
  • Pipe content in: cat requirements.md | breign chat PO.
  • Continue a conversation: breign chat PO -c <conversation-id> "And ticket 3?". breign conversations list --agent PO lists them; breign conversations show <id> prints one.

Tool calls show as they happen. If a tool needs your approval, the CLI tells you to approve it in Breign.

Manage agents​

breign agents list --search support
breign agents get Support
breign agents create --name QA --persona "A meticulous tester." --prompt-init @instructions.md
breign agents update QA --description "Tests every release"
breign agents export Support -o support.yaml
breign agents import support.yaml
breign agents delete QA

Text options accept literal text or @file. Initialization instructions need at least 50 characters. Add --json to any command for machine-readable output.

Call any API route​

breign api sends an authenticated request; {org} is replaced by your organization:

breign api get /organizations/{org}/agents
breign api post /organizations/{org}/projects -d '{"name":"Demo"}'
breign api patch /agents/<agent-id> -d @agent.json

See the API documentation.

Run your machine as an execution node​

  1. Check the coding tools the node can use: breign node runtimes. Claude Code and OpenCode are detected if installed; fx is installed on first start (macOS and Linux).
  2. Associate the machine with your organization: breign node associate.
  3. Allow a folder: breign node workspace add app ~/code/app --label "Main app". Only the alias and label are sent to Breign.
  4. Start the node: breign node start. It runs in the foreground; Ctrl-C stops it after the current turn.
  5. Bind an agent, from Breign (the agent's Execution block) or from the CLI: breign node attach <agent> -w app --runtime claude. breign node detach <agent> sends it back to the Breign server.

Useful settings, picked up without restarting:

CommandEffect
breign node slots 4Run up to 4 turns at once (a git repository gets one worktree per conversation).
breign node tools set Read Edit Glob GrepTools Claude Code may use without asking. breign node tools reset restores the default.
breign node model claude <model>Model used by Claude Code (or opencode). fx always uses the agent's model.
breign node join <group> / leave <group>Join or leave a node group.
breign node envs list / release <id>Kept environments (node stopped).
breign node statusIdentity, folders, runtimes, organizations and agents.
breign node unpairStop receiving tasks and forget this machine's identity.

To run nodes on servers or Kubernetes with an API key, see Run a cluster of execution nodes.

Configuration​

  • Settings live in ~/.config/breign/config.toml (%APPDATA%\breign\config.toml on Windows); breign config path prints it. Credentials are in the system keychain, never in this file.
  • Environment variables override settings: BREIGN_SERVER, BREIGN_PROFILE, BREIGN_ORG, BREIGN_API_KEY (or BREIGN_API_KEY_FILE), BREIGN_NODE_GROUP, BREIGN_NODE_NAME, BREIGN_LOG=debug.

If something goes wrong​

  • The browser doesn't open: use breign login --device.
  • "Unknown, expired or already used code" on the device page: run breign login --device again and use the new code.
  • breign status says the server is unreachable: check the profile's address (breign profile show) and your network.
  • An agent is not found: check the organization (breign org use), or use its id.
  • Signed out after a while: the access expires after 30 days without any command. Run breign login.