CLI
The developer REPL — slash commands, streaming, and debugging.
The CLI is the reference runtime's primary operator-facing surface. Same bundled runtime that ships via npm install -g motebit — when you run pnpm --filter @motebit/cli dev from a monorepo clone, you're invoking the same daemon, MCP server, policy engine, and relay code operators get from npm, with direct access to the motebit's internals for inspection. A Node.js REPL with streaming output and tool approval prompts.
Running the CLI
pnpm --filter @motebit/cli devOr with options:
pnpm --filter @motebit/cli dev -- \
--provider anthropic \
--model claude-sonnet-4-5-20250929 \
--operatorCLI flags
| Flag | Description |
|---|---|
--provider <name> | ollama or anthropic |
--model <name> | Model identifier |
--db-path <path> | Custom SQLite database path |
--no-stream | Disable streaming (wait for full response) |
--sync-url <url> | Sync relay server URL |
--sync-token <token> | Sync relay master token |
--operator | Start with operator mode enabled |
--allowed-paths <paths> | Comma-separated paths for file tools |
--version | Print version |
--help | Print help |
Slash commands
| Command | Action |
|---|---|
/help | Show available commands |
/model <name> | Switch model |
/memories | List stored memories (type, half-life, edge count, compounding status) |
/graph | Memory graph health — node/edge counts, compounding stats, curiosity targets, intelligence gradient |
/curious | Show decaying memories the agent is curious about (score, decay info, content) |
/state | Show current state vector |
/forget <nodeId> | Delete a memory by ID |
/export | Export all data (memories, events, identity) |
/clear | Clear conversation history |
/tools | List registered tools |
/sync | Trigger manual sync cycle |
/summarize | Summarize current conversation |
/conversations | List recent conversations |
/conversation <id> | Load a past conversation |
/goals | List all scheduled goals |
/goal add "<prompt>" --every <interval> [--once] | Add a scheduled goal |
/goal remove <id> | Remove a goal |
/goal pause <id> | Pause a goal |
/goal resume <id> | Resume a paused goal |
/goal outcomes <id> | Show execution history for a goal |
/approvals | Show pending approval queue |
/reflect | Trigger reflection -- see what the agent learned |
/mcp list | List connected MCP servers |
/mcp trust <name> | Trust an MCP server (skip approval for its tools) |
/mcp untrust <name> | Remove trust from an MCP server |
/mcp add <name> <url> [--motebit] | Add an HTTP MCP server (live, no restart) |
/mcp remove <name> | Remove an MCP server (live, no restart) |
/discover [capability] | Discover agents on the relay (optional capability filter) |
/agents | List known agents with trust levels and reputation scores |
/agents info <id> | Full trust record detail for an agent |
/agents trust <id> <level> | Set trust level (first_contact, verified, trusted, blocked) |
/agents block <id> | Block an agent |
/operator | Toggle operator mode |
quit / exit | Exit the CLI |
Tool approval flow
When the agent requests a tool that requires approval, the CLI pauses and prompts:
Tool approval required: shellExec
args: {"command": "ls -la"}
Allow? (Y/n):Type Y to approve, n to deny. The agent continues with the result (or denial) and completes the turn.
Identity bootstrap
The CLI uses the same identity system as the desktop app:
- First launch generates an Ed25519 keypair
- Private key is encrypted with PBKDF2 (AES-256-GCM) and stored in
~/.motebit/config.json - Identity and device are registered in the local SQLite database
- Optional: register with a sync relay using
--sync-urland--sync-token
Streaming output
By default, the CLI streams responses token-by-token. Tool calls appear inline:
> What files are in my home directory?
[calling readFile...]
[readFile done]
Your home directory contains the following files: ...Use --no-stream to wait for the complete response before printing.
Subcommands
The CLI supports several subcommands beyond the default interactive REPL:
| Subcommand | Description |
|---|---|
motebit id | Show your identity card (motebit_id, did:key, public key) |
motebit verify <path> | Verify a signed motebit.md identity file or exported bundle directory |
motebit export | Export full bundle (identity, credentials, presentation, budget, gradient, memories, events) |
motebit credentials | List earned verifiable credentials (gradient, reputation, trust) |
motebit credentials --presentation | Generate a verifiable credential presentation |
motebit ledger <goalId> | Show the signed execution ledger for a goal |
motebit run --identity <path> | Start daemon mode with goal scheduling |
motebit serve [flags] | Start MCP server mode (see MCP Server) |
motebit doctor | Diagnose configuration and connectivity issues |
motebit goal add/list/remove/pause/resume | Manage scheduled goals |
motebit approvals list/show/approve/deny | Manage the tool approval queue |
motebit rotate [--reason "..."] | Rotate Ed25519 keypair with signed succession record |
Serve flags
motebit serve exposes your motebit as an MCP server — other agents and tools can call it over stdio or HTTP.
| Flag | Default | Description |
|---|---|---|
--serve-transport <mode> | stdio | Transport: stdio or http |
--serve-port <port> | 3100 | HTTP port (only with --serve-transport http) |
--identity <path> | — | Path to motebit.md (loads governance thresholds) |
--tools <path> | — | JS module exporting tool definitions (array of {definition, handler}) |
--direct | off | Direct tool execution — no AI loop, maps prompt to tool input |
--self-test | off | Run self-test task via relay after registration |
--operator | off | Enable operator mode for high-risk tools |
# Stdio transport — for MCP host integration (Claude Desktop, etc.)
motebit serve
# HTTP transport — for remote agents
motebit serve --serve-transport http --serve-port 3100
# With identity governance
motebit serve --serve-transport http --identity ./motebit.md
# With external tools in direct mode (no LLM needed)
motebit serve --identity ./motebit.md --tools ./dist/tools.js \
--serve-transport http --direct --self-testIn HTTP mode, the server registers with the sync relay (if configured) and sends a heartbeat every 5 minutes. Authentication is configured via the authToken field in ~/.motebit/config.json — clients pass it as a bearer token.