> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oobo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands

> Complete CLI reference for oobo 2.0.0

All commands support the global `--agent`, `--json`, and `--interactive` output-mode flags.
Filter flags (`-n`, `--since`, `--tool`) are also global.

## Output Modes

Every command has three mutually exclusive output modes:

| Mode   | Flag        | Description                                                                                    |
| ------ | ----------- | ---------------------------------------------------------------------------------------------- |
| Pretty | *(default)* | Rich TTY output with color, alignment, and interactive TUIs                                    |
| Agent  | `--agent`   | Token-efficient plain text. Auto-activates when stdout is not a TTY or an agent env var is set |
| JSON   | `--json`    | Full-fidelity structured JSON (`jq`-parseable)                                                 |

Agent mode auto-activates when any of `CURSOR_AGENT`, `CLAUDECODE`, `AIDER`, `CONTINUE_SESSION`, `CONTINUE_IDE`, `AICOMMITS` is set.

## Global Options

| Flag              | Description                                              |
| ----------------- | -------------------------------------------------------- |
| `-n, --limit <N>` | Max items to list (default 50)                           |
| `--since <WHEN>`  | Time filter (e.g. `24h`, `7d`, ISO-8601 timestamp)       |
| `--tool <NAME>`   | Filter by tool name (case-insensitive)                   |
| `--agent`         | Minimal plain-text output (token-efficient)              |
| `--json`          | Full structured JSON output                              |
| `--interactive`   | Force TUI even when auto-detection would pick agent mode |
| `-V, --version`   | Print version                                            |

***

## Memory Feed (bare `oobo` or `oobo anchors`)

```bash theme={null}
oobo                                     # in-repo + TTY: scrollable anchor-feed TUI
                                         # in-repo + --agent/--json: list anchors
                                         # outside a repo: first-run hint or short status
oobo -n 20 --since 7d                    # filtered
oobo --tool cursor                       # per-tool
oobo anchors --agent                     # compact enriched commit log
oobo anchors --json                      # structured anchor summaries
```

Equivalent to `oobo anchors`. Shows a scrollable TUI in interactive mode, or a flat list in agent/JSON mode.

### TUI Keybindings

| Key         | Action                                                         |
| ----------- | -------------------------------------------------------------- |
| `↑/k` `↓/j` | Move selection                                                 |
| `g` / `G`   | Jump to top / bottom                                           |
| `enter`     | Open transcript (session picker if >1)                         |
| `d`         | View commit diff inline                                        |
| `b`         | Blame (file picker)                                            |
| `L`         | Goto selected anchor (time-travel)                             |
| `/`         | Live filter (local substring match)                            |
| `s`         | Remote recall - semantic memory + full-text (requires API key) |
| `t`         | Cycle time window (all / 24h / 7d / 30d)                       |
| `e`         | Toggle tracking on/off                                         |
| `r`         | Reload                                                         |
| `?`         | Help overlay                                                   |
| `q`         | Quit                                                           |

The **recall** (`s`) opens a full-screen view where you type a natural-language question (e.g. "why did we build the auth middleware?"). Results include both full-text and semantic memory hits from the remote server, with a synthesized answer displayed above the results when available.

## Anchor Show - drill into a commit

```bash theme={null}
oobo anchor show <sha>                   # drill-down: sessions, tokens, attribution
oobo anchor show <sha> --agent           # compact output
oobo anchor show <sha> --json            # full anchor detail as JSON
```

Accepts unambiguous SHA prefixes.

## Sessions - list active and recent sessions

```bash theme={null}
oobo sessions                            # list recent sessions
oobo sessions --active                   # currently active sessions only
oobo sessions -n 10                      # limit results
oobo sessions --since 7d                 # filter by time
oobo sessions --tool claude              # filter by tool
oobo sessions --json                     # structured output
```

Lists AI coding sessions discovered from tool storage and hook state. Shows session ID, tool, model, turn count, token usage, and timing.

## Session - drill into a session

```bash theme={null}
oobo session <id>                        # show session details
oobo session <id> --agent                # compact output
oobo session <id> --json                 # full structured output
```

Accepts prefix-matched session IDs. Shows session metadata, linked commits, per-turn breakdown, and token usage.

## Goto / Back - time travel

```bash theme={null}
oobo goto <turn-id-or-sha>              # travel to a turn or commit
oobo goto <id> --no-stash               # fail if worktree is dirty
oobo back                               # return to where you were
```

`goto` auto-stashes dirty changes, loads the target tree, and records a return point.
Multiple `goto` calls stack - each `back` pops one level, like a browser back button.

## Blame - git blame + AI attribution

```bash theme={null}
oobo blame src/main.rs                   # git blame with color-coded AI column
oobo blame src/main.rs abc123            # at a specific commit
oobo blame src/main.rs --json            # rich per-line attribution as JSON
oobo blame src/main.rs --agent           # compact text columns
```

`oobo blame` is a strict superset of `git blame`. It traces every line back to its **originating commit** (via `git blame --porcelain`), loads that commit's anchor from the orphan branch, and resolves per-line AI/human attribution. This gives historically accurate attribution across the full file history - not just the latest commit.

Every `git blame` flag (`-L`, `-w`, `--porcelain`, etc.) is forwarded. Machine-output formats (`--porcelain`, `--line-porcelain`, `--incremental`) bypass the AI column automatically.

### Output modes

| Mode               | Description                                                                               |
| ------------------ | ----------------------------------------------------------------------------------------- |
| Pretty *(default)* | Color-coded git blame overlay: magenta = AI, yellow = mixed, green = human, dim = unknown |
| Agent (`--agent`)  | Compact columns: `<sha> <attribution> <line> <content>`                                   |
| JSON (`--json`)    | Rich per-line data including session IDs, token counts, and commit metadata               |

### JSON output

Each line in the `--json` output includes:

```json theme={null}
{
  "line": 42,
  "content": "fn authenticate(token: &str) -> bool {",
  "origin_sha": "a1b2c3d",
  "ai": "cursor",
  "agent": "cursor",
  "session_ids": ["sess-abc", "sess-def"],
  "tokens": 15000,
  "committed_at": 1746450000,
  "message": "feat: add JWT auth"
}
```

| Field          | Type           | Description                                                                  |
| -------------- | -------------- | ---------------------------------------------------------------------------- |
| `line`         | number         | Line number in the current file                                              |
| `content`      | string         | Line content                                                                 |
| `origin_sha`   | string         | Short SHA of the commit that introduced this line                            |
| `ai`           | string \| null | Attribution: tool name (e.g. "cursor"), "human", "mixed", or null if unknown |
| `agent`        | string?        | Agent/tool name (when AI-authored)                                           |
| `session_ids`  | string\[]?     | Chat session IDs that produced this code                                     |
| `tokens`       | number?        | Total tokens (input + output) consumed                                       |
| `committed_at` | number?        | Unix timestamp of the originating commit                                     |
| `message`      | string?        | Commit message of the originating commit                                     |

The JSON output is designed for IDE plugins - a Cursor extension could render inline decorations showing who wrote each line, link to chat sessions, and display token costs.

Also available as `oobo anchor blame`.

## Search

```bash theme={null}
oobo search "auth middleware"                    # hybrid semantic code search (default)
oobo search "auth middleware" -p src/            # scope to a path
oobo search "auth middleware" --git-ref main     # search a specific git ref
oobo search "auth" -k 10                         # return top 10 results
oobo search "auth" -m semantic                   # pure vector search
oobo search "auth" -m bm25                       # pure keyword search
oobo search "auth" --content docs                # search only docs files
```

Semantic code search powered by sonar. Combines BM25 keyword matching with vector similarity (hybrid mode) for high-relevance results across your codebase.

| Flag                | Description                                                  |
| ------------------- | ------------------------------------------------------------ |
| `-p, --path <PATH>` | Scope search to a file or directory path                     |
| `--git-ref <REF>`   | Search a specific git ref (branch, tag, or SHA)              |
| `-k, --top-k <N>`   | Number of results to return (default 5)                      |
| `-m, --mode <MODE>` | Search mode: `hybrid` (default), `semantic`, or `bm25`       |
| `--content <TYPE>`  | Content filter: `code`, `docs`, `config`, or `all` (default) |

## Recall

```bash theme={null}
oobo recall "auth bug"                   # search current project sessions/memory
oobo recall "why did we build the auth?" # semantic memory search
oobo recall "auth bug" --global          # search across all projects
oobo recall "auth" --since 7d --tool claude   # filter by time/tool
oobo recall "auth" --project oobo-cli --json  # explicit project scope
```

Recall searches your session history and semantic memory. It is local-first. With an API key, default recall merges local and remote results (including semantic memory). Use `--local`, `--remote`, or `--both` to force a source.

When memory hits are available, the response may include a synthesized **answer** - a 1-3 sentence summary answering the query, displayed above the individual hits.

| Flag               | Description                                                            |
| ------------------ | ---------------------------------------------------------------------- |
| `--global`         | Search across all projects (default is current project when in a repo) |
| `--local`          | Local only (default when no API key)                                   |
| `--remote`         | Remote server only (requires API key)                                  |
| `--both`           | Local + remote merged (default when API key configured)                |
| `--project <name>` | Scope to a specific project by name                                    |
| `--tool <name>`    | Scope to a specific tool                                               |
| `--since <when>`   | Time window filter                                                     |
| `--limit <n>`      | Max results (default 20)                                               |

### Result Sources

Results are tagged by source:

| Source   | Description                                                                   |
| -------- | ----------------------------------------------------------------------------- |
| `local`  | Matched locally from the orphan branch                                        |
| `fts`    | Full-text search from the remote server                                       |
| `memory` | Semantic memory hit - organizational knowledge synthesized from past sessions |

Memory hits include additional fields: `memory_id`, `session_ids`, and `author`.

## Delta - compare two anchors

```bash theme={null}
oobo delta                               # compare HEAD to its previous anchor
oobo delta abc123                        # compare a specific anchor to its previous
oobo delta abc123 def789                 # explicit pair
oobo delta --full                        # include sessions, decisions, techniques
oobo delta abc123 --full --json          # full structured output
```

Shows what changed between two anchors: category shifts, complexity changes, new areas, new techniques, files continued vs. files new, and a narrative summary.

| Flag           | Description                                           |
| -------------- | ----------------------------------------------------- |
| `anchor_sha`   | Commit SHA to inspect (defaults to HEAD)              |
| `previous_sha` | Commit SHA to compare against (auto-found if omitted) |
| `--full`       | Include detailed sessions, decisions, and techniques  |

Requires an API key (`oobo settings set key <...>`).

## Settings - declarative per-scope config

```bash theme={null}
oobo settings                            # list all effective settings
oobo settings key                        # get the API key (default scope)
oobo settings set key sk_...             # set API key globally
oobo settings project set key sk_...     # set API key for this project only
oobo settings set api_url https://api.staging.example.com  # custom API server
oobo settings project set remote oobo    # per-project anchor remote
oobo settings unset transparency         # remove a key
```

### Grammar

```
oobo settings [scope] [verb] <key> [value]
```

**Scopes:** `default` (implicit) or `project`

**Verbs:** `get` (default), `set`, `unset`

**Valid keys:** `key`, `api_url`, `remote`, `transparency`, `tools.experimental`, `setup.scan_roots`

## Project Tracking

```bash theme={null}
oobo enable                              # start tracking this repo
oobo disable                             # stop tracking this repo
```

Both are idempotent. Disabled projects are recorded in `.oobo/config` with `[project].enabled = false`.

## Setup & Maintenance

```bash theme={null}
oobo setup                               # interactive wizard: install hooks, discover tools
oobo setup --non-interactive             # CI-safe: accept defaults
oobo setup --reindex                     # forced full rescan
oobo setup --repair                      # fix broken symlinks / hooks
oobo setup --repair --reindex            # composable flags
```

Tool detection is automatic on every commit. No indexing step required.

## Update

```bash theme={null}
oobo update                              # self-update to the latest version
oobo update --check                      # check only, don't install
```

Post-update migrations run automatically: skill file refresh, hook re-install, config compatibility checks.

## Help - built-in documentation

```bash theme={null}
oobo help                                # list all help topics
oobo help anchors                        # what anchors are and how they work
oobo help recall                         # recall syntax and cloud configuration
oobo help blame                          # reading the AI attribution overlay
oobo help hooks                          # git and agent hooks explained
oobo help config                         # all settings explained
oobo help keyboard                       # TUI keybindings reference
```

Built-in documentation, always available offline. Works in all output modes.

## Hooks (internal plumbing)

These commands are called by tool integrations and git hooks, not typed by users:

```bash theme={null}
# Agent lifecycle events (piped via stdin)
echo '{"session_id":"<id>","agent":"cursor","model":"claude-opus-4"}' \
  | oobo hooks agent session-start --tool cursor

echo '{"session_id":"<id>","tool_name":"Read","file_path":"/src/main.rs"}' \
  | oobo hooks agent after-tool-use --tool cursor

echo '{"session_id":"<id>"}' | oobo hooks agent session-end --tool cursor

# Git hooks
oobo hooks post-commit
oobo hooks pre-push
oobo hooks post-merge
oobo hooks post-rewrite
```

### Agent Hook Events

| Event                  | Description                                |
| ---------------------- | ------------------------------------------ |
| `session-start`        | AI session begins                          |
| `session-end`          | AI session ends                            |
| `before-submit-prompt` | User prompt about to be submitted          |
| `pre-tool-use`         | Agent is about to invoke a tool            |
| `after-tool-use`       | Agent used a tool (Read, Edit, Bash, etc.) |
| `after-file-edit`      | Agent modified a file                      |
| `subagent-start`       | A subagent was spawned                     |
| `after-agent-thought`  | Agent reasoning/thinking completed         |
| `after-agent-response` | Agent response delivered                   |
| `stop`                 | Agent stopped (session complete)           |
| `subagent-stop`        | A subagent finished                        |

## Version

```bash theme={null}
oobo --version                           # print version string
oobo --version --json                    # structured version info
```
