Command-line interface (CLI)
The Neotoma CLI provides full access to every operation available in the MCP and REST API, plus administration commands for server lifecycle, storage, backups, and configuration. Run neotoma with no arguments for an interactive session (neotoma> prompt), or invoke commands directly (e.g. neotoma entities list).
Installation
# Install globally npm install -g neotoma # Initialize data directory and database neotoma init # Start the API server (development) neotoma api start --env dev --background
From a source checkout: npm run setup:cli builds and links the global neotoma command. Use npm run watch:build to keep the global CLI in sync during development.
Environments
Target a specific environment with neotoma dev (port 3080) or neotoma prod (port 3180), or pass --env dev / --env prod. Server lifecycle commands (api start, api stop, api logs) always require --env.
Typical workflow
# Store entities
neotoma store --json='[{"entity_type":"task","title":"Review API rollout","status":"open"}]'
# List entities by type
neotoma entities list --type task --limit 10
# Search by identifier
neotoma entities search "Ana Rivera" --type contact
# Inspect provenance
neotoma observations list --entity-id <entity_id>
# Upload a file with AI interpretation
neotoma upload ./invoice.pdf
# Upload locally (no API server needed)
neotoma upload --local ./invoice.pdf
# Stream changes in real time
neotoma watch --tail --humanGlobal options
--offline: force in-process local transport (no API required)--api-only: fail if API server is unavailable--base-url <url>: target a specific API instance--env dev|prod: environment selector (required for server commands)--json: machine-readable JSON output--pretty: formatted JSON output--tunnel: start HTTPS tunnel (ngrok/cloudflared) with server start--debug: emit detailed initialization logs to stderr
Offline support
Data commands (entities, relationships, sources, observations, timeline, store, schemas, stats, corrections, snapshots) are offline-first and use in-process local transport by default - no API server required. Server lifecycle commands (api start|stop|status|logs) manage the API process and are unaffected.
Authentication
Local CLI commands run without login in development. For production or MCP OAuth:
neotoma auth login- OAuth PKCE flow for MCP Connectneotoma auth status- show auth mode and user detailsneotoma auth mcp-token- print key-derived MCP token (when encryption is enabled)neotoma auth logout- clear stored OAuth credentials
Storage and configuration
CLI config is stored at ~/.config/neotoma/config.json. Run neotoma storage info to see data directory, database path, sources directory, and log paths. Use neotoma storage set-data-dir to relocate the data directory with optional DB migration. Use neotoma storage merge-db to merge SQLite databases (safe mode by default).
Backups
neotoma backup create creates a timestamped backup of the database, sources, and logs with a manifest.json containing checksums. neotoma backup restore --from <dir> restores a backup into the data directory. Encrypted data stays encrypted; preserve the key file or mnemonic.
See MCP reference for agent-native transport, REST API reference for HTTP endpoints, and troubleshooting for common failure modes.