LatentCode
CLI reference
Running latentcode with no arguments opens the TUI. Add a subcommand to run headlessly — perfect for scripts, pipelines, and CI.
Run a single prompt
latentcode run executes one message and prints the result, without entering the interactive UI:
$
latentcode run "summarize what changed in the last commit"Common flags:
| Flag | Purpose |
|---|---|
| --model <provider/model> | Use a specific model for this run |
| --agent <name> | Run with a specific agent (e.g. plan) |
| --continue | Continue the most recent session |
| --session <id> | Continue a specific session |
| --format json | Emit structured JSON instead of plain text (good for scripts) |
| --file <path> | Attach a file to the message (repeatable) |
| --dangerously-skip-permissions | Auto-approve actions — only for trusted, sandboxed runs |
Permissions in headless mode
Without a TUI to approve actions, LatentCode will pause on anything sensitive. Use --dangerously-skip-permissions only inside an isolated environment you trust.Everyday commands
| Command | What it does |
|---|---|
| latentcode | Start the TUI (default) |
| latentcode run <message> | Run a single prompt headlessly |
| latentcode models | List the models available to your tier |
| latentcode stats | Show your token usage and cost (add --days N) |
| latentcode session list | List saved sessions (also: session delete) |
| latentcode export | Export session data as JSON |
| latentcode config | View or change your gateway connection |
Extending & accounts
| Command | What it does |
|---|---|
| latentcode plugin <module> | Install a plugin (an npm module) and wire it into your config |
| latentcode mcp auth | Authenticate an MCP server (also: mcp list, mcp logout) |
| latentcode agent create | Create a custom agent (also: agent list) |
| latentcode console login | Sign in to your account / organization (also: logout, switch, orgs) |
| latentcode pr <number> | Check out a GitHub PR branch, then start a session on it |
Global flags
These work on any command:
text
--help, -h Show help --version, -v Print the version --log-level LEVEL DEBUG | INFO | WARN | ERROR --print-logs Stream logs to the terminal --pure Run without external plugins