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

# CLI Overview

> Complete reference for the Kernle command-line interface

# CLI Overview

The Kernle CLI provides 32+ commands for managing SI memory.

## Global Options

```bash theme={null}
kernle [-s STACK_ID] <command> [options]
```

| Option                 | Description                                       |
| ---------------------- | ------------------------------------------------- |
| `-s, --stack STACK_ID` | Stack ID (can also use `KERNLE_STACK_ID` env var) |

If no stack ID is provided, Kernle will try to resolve one automatically from environment context.

## Commands at a Glance

<CardGroup cols={2}>
  <Card title="Memory Commands" icon="brain" href="/cli/memory-commands">
    episode, note, raw, belief, value, goal, drive, relation, playbook
  </Card>

  <Card title="Utility Commands" icon="wrench" href="/cli/utility-commands">
    load, checkpoint, search, status, anxiety, identity, trust, emotion, promote, process, model, export, export-full
  </Card>

  <Card title="MCP Server" icon="plug" href="/integration/mcp">
    mcp - Start MCP server for tool integration
  </Card>
</CardGroup>

Additional top-level commands include `auth`, `boot`, `doctor`, `audit`, `export-cache`, `import`, `seed`, `stack`, `migrate`, `entity-model`, `setup`, `hook`, `relation`, `meta`, `narrative`, and `epoch`.

## Command Quick Reference

### Session Lifecycle

| Command           | Description                          |
| ----------------- | ------------------------------------ |
| `load`            | Load working memory at session start |
| `checkpoint save` | Save current state                   |
| `checkpoint load` | Restore previous state               |
| `status`          | Show memory overview                 |

### Memory Capture

| Command    | Description                              |
| ---------- | ---------------------------------------- |
| `raw`      | Zero-friction capture                    |
| `note`     | Structured note (decision/insight/quote) |
| `episode`  | Experience with outcome and lessons      |
| `belief`   | Add or manage beliefs                    |
| `value`    | Define core values                       |
| `goal`     | Set active goals                         |
| `drive`    | Manage intrinsic motivations             |
| `relation` | Track relationships                      |
| `playbook` | Procedural memory                        |

### Search & Analysis

| Command    | Description                    |
| ---------- | ------------------------------ |
| `search`   | Semantic search across memory  |
| `when`     | Query by time period           |
| `promote`  | Extract patterns from episodes |
| `identity` | Synthesize identity            |
| `emotion`  | Emotional memory analysis      |
| `meta`     | Meta-memory operations         |

### Maintenance

| Command       | Description                                    |
| ------------- | ---------------------------------------------- |
| `anxiety`     | Check memory health                            |
| `forget`      | Controlled forgetting                          |
| `process`     | Run or check automated memory processing       |
| `model`       | Show, bind, or unbind inference model          |
| `export-full` | Export complete agent context to a single file |

### Data Export

| Command       | Description                   |
| ------------- | ----------------------------- |
| `dump`        | Export all memory (stdout)    |
| `export`      | Export to file                |
| `suggestions` | Review and manage suggestions |

### Setup & Admin

| Command  | Description                             |
| -------- | --------------------------------------- |
| `init`   | Initialize stack and generate CLAUDE.md |
| `stack`  | List and delete stacks                  |
| `doctor` | Validate boot sequence compliance       |
| `stats`  | Usage statistics and health checks      |

## Environment Variables

| Variable                | Description                                                       |
| ----------------------- | ----------------------------------------------------------------- |
| `KERNLE_STACK_ID`       | Default stack ID                                                  |
| `CLAUDE_API_KEY`        | Anthropic API key (preferred over `ANTHROPIC_API_KEY`)            |
| `ANTHROPIC_API_KEY`     | Anthropic API key (fallback)                                      |
| `OPENAI_API_KEY`        | OpenAI API key                                                    |
| `KERNLE_MODEL_PROVIDER` | Force a specific model provider (`anthropic`, `openai`, `ollama`) |
| `KERNLE_MODEL`          | Override the default model name for the chosen provider           |

## Common Workflows

### Session Start

```bash theme={null}
kernle -s mystack load
```

### During Work

```bash theme={null}
# Quick capture
kernle -s mystack raw "interesting observation"

# Record experience
kernle -s mystack episode "what I did" "outcome" --lesson "what I learned"

# Note a decision
kernle -s mystack note "chose X" --type decision --reason "because Y"
```

### Session End

```bash theme={null}
kernle -s mystack checkpoint save "where I left off" --pending "next task"
```

### Maintenance

```bash theme={null}
# Check health
kernle -s mystack anxiety --detailed --actions

# Bind a model for processing
kernle -s mystack model set claude

# Promote learnings to beliefs
kernle -s mystack promote

# Export backup
kernle -s mystack export backup.md
```
