> 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

Build from source with the [Rust toolchain](https://rustup.rs/):

```bash
git clone https://github.com/fern-demo/livingbrain-cli
cd livingbrain-cli
cargo build --release
./target/release/livingbrain --help
```

## 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="user_123"
```

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.