> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.livingbrain.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.livingbrain.com/_mcp/server.

# CLI

Generated by Fern

Any coding agent that can run shell commands can use `livingbrain` directly. Install it, set
your key, and ask the agent to save or find something.

Example: a coding agent saving a note with the CLI.

> Save the notes from today's onboarding call to my Research brain

The agent runs:

```bash
livingbrain brains list --query "[?name=='Research'].id"
```

```json
["brn_01"]
```

```bash
livingbrain captures capture --brain-id brn_01 --json '{"kind": "note", "content": "The customer prefers weekly check-ins and dislikes long emails."}'
```

```json
{ "id": "src_01", "kind": "note", "status": "pending" }
```

Saved to Research. Living Brain links it to related pages once it finishes compiling.

## Install

### npm

Install globally on macOS, Linux, or Windows:

```bash
npm install -g @living-brain/cli
```

Or run it without installing:

```bash
npx @living-brain/cli --help
```

### Direct installer: macOS and Linux

```bash
curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/ChatAndBuild/livingbrain-cli/releases/latest/download/livingbrain-cli-installer.sh | sh
```

### Direct installer: Windows PowerShell

```powershell
powershell -ExecutionPolicy ByPass -c "irm https://github.com/ChatAndBuild/livingbrain-cli/releases/latest/download/livingbrain-cli-installer.ps1 | iex"
```

Confirm the installation:

```bash
livingbrain --version
```

## Authenticate

The CLI reads the same two values as the SDKs. Set them as environment variables, or pass
`--api-key` and `--subject-id` on any command:

```bash
export LIVING_BRAIN_API_KEY="lb_live_..."
export LIVING_BRAIN_SUBJECT_ID="3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c"
```

A `.env` file in the working directory is loaded automatically. To store the key in your OS
keyring instead, run `livingbrain auth login`.

## Usage

Commands follow the SDK namespaces: `livingbrain <namespace> <method>`.

```bash
livingbrain brains list
livingbrain workspace list-pages --brain-id brn_123
livingbrain workspace archive --brain-id brn_123 --slug old-idea
livingbrain slack status --brain-id brn_123
```

Run `livingbrain <namespace> --help` to see every method and its flags.

## Request bodies

Pass request bodies as flags, or as JSON with `--json` (use `-` to read from stdin):

```bash
livingbrain captures capture --brain-id brn_123 \
  --json '{"kind": "note", "content": "Worth remembering."}'
```

## Output

Output is a table in a terminal and JSON when piped. Override it with `--format`
(`json`, `table`, `yaml`, `csv`, `jsonl`), and filter with a JMESPath `--query`:

```bash
livingbrain brains list --query '[].name' --format json
```

`--dry-run` prints the request without sending it, which helps when scripting.