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:

FlagPurpose
--model <provider/model>Use a specific model for this run
--agent <name>Run with a specific agent (e.g. plan)
--continueContinue the most recent session
--session <id>Continue a specific session
--format jsonEmit structured JSON instead of plain text (good for scripts)
--file <path>Attach a file to the message (repeatable)
--dangerously-skip-permissionsAuto-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

CommandWhat it does
latentcodeStart the TUI (default)
latentcode run <message>Run a single prompt headlessly
latentcode modelsList the models available to your tier
latentcode statsShow your token usage and cost (add --days N)
latentcode session listList saved sessions (also: session delete)
latentcode exportExport session data as JSON
latentcode configView or change your gateway connection

Extending & accounts

CommandWhat it does
latentcode plugin <module>Install a plugin (an npm module) and wire it into your config
latentcode mcp authAuthenticate an MCP server (also: mcp list, mcp logout)
latentcode agent createCreate a custom agent (also: agent list)
latentcode console loginSign 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