Motebit

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 dev

Or with options:

pnpm --filter @motebit/cli dev -- \
  --provider anthropic \
  --model claude-sonnet-4-5-20250929 \
  --operator

CLI flags

FlagDescription
--provider <name>ollama or anthropic
--model <name>Model identifier
--db-path <path>Custom SQLite database path
--no-streamDisable streaming (wait for full response)
--sync-url <url>Sync relay server URL
--sync-token <token>Sync relay master token
--operatorStart with operator mode enabled
--allowed-paths <paths>Comma-separated paths for file tools
--versionPrint version
--helpPrint help

Slash commands

CommandAction
/helpShow available commands
/model <name>Switch model
/memoriesList stored memories (type, half-life, edge count, compounding status)
/graphMemory graph health — node/edge counts, compounding stats, curiosity targets, intelligence gradient
/curiousShow decaying memories the agent is curious about (score, decay info, content)
/stateShow current state vector
/forget <nodeId>Delete a memory by ID
/exportExport all data (memories, events, identity)
/clearClear conversation history
/toolsList registered tools
/syncTrigger manual sync cycle
/summarizeSummarize current conversation
/conversationsList recent conversations
/conversation <id>Load a past conversation
/goalsList 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
/approvalsShow pending approval queue
/reflectTrigger reflection -- see what the agent learned
/mcp listList 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)
/agentsList 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
/operatorToggle operator mode
quit / exitExit 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:

  1. First launch generates an Ed25519 keypair
  2. Private key is encrypted with PBKDF2 (AES-256-GCM) and stored in ~/.motebit/config.json
  3. Identity and device are registered in the local SQLite database
  4. Optional: register with a sync relay using --sync-url and --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:

SubcommandDescription
motebit idShow your identity card (motebit_id, did:key, public key)
motebit verify <path>Verify a signed motebit.md identity file or exported bundle directory
motebit exportExport full bundle (identity, credentials, presentation, budget, gradient, memories, events)
motebit credentialsList earned verifiable credentials (gradient, reputation, trust)
motebit credentials --presentationGenerate 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 doctorDiagnose configuration and connectivity issues
motebit goal add/list/remove/pause/resumeManage scheduled goals
motebit approvals list/show/approve/denyManage 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.

FlagDefaultDescription
--serve-transport <mode>stdioTransport: stdio or http
--serve-port <port>3100HTTP 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})
--directoffDirect tool execution — no AI loop, maps prompt to tool input
--self-testoffRun self-test task via relay after registration
--operatoroffEnable 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-test

In 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.

On this page