Skip to content
CLI Reference

CLI Reference

This page is the canonical reference for the command tree. MCP transport types and qualified tool names live in MCP.

Every Ulmi command follows the pattern:

ulmi [global flags] <subcommand> [subcommand flags] [positional args]

Without a subcommand ulmi launches the interactive TUI. The full command tree is registered in internal/cli/root.go.

Global flags

These flags are accepted directly on ulmi (and forwarded to the implicit tui subcommand).

FlagDefaultDescription
-m, --model(from config)Model in <provider>/<model> format.
--agentbuildAgent name (build, plan, ask, or any user-defined agent).
--session(empty)Session ID to resume.
--continuefalseResume the most recently updated session.
--trust-projectfalseTrust project config, agents, and shell-capable custom commands for this invocation; accepted by every subcommand.

ulmi (TUI)

ulmi [flags]

Launches the BubbleTea TUI. See the TUI Guide for keybindings and slash commands.

ulmi run

ulmi run "<prompt>" [flags]

Runs the shared agent loop with built-in tools, streams visible assistant text from each round to stdout, and saves the conversation. Designed for shell pipelines and CI. Token totals and the session ID are printed to stderr.

FlagDescription
-m, --modelOverride the active model.
--formattext (default) or json. JSON is one object containing session_id, model, final content, and token totals for this invocation.
--sessionContinue a saved session by ID.
--continueContinue the most recently updated session; errors if none exists. Cannot be combined with --session.
--agentSelect a built-in or user-defined agent. Defaults to the saved session’s agent, or build for a new session. Unknown names are errors.

Explicit --model wins. Otherwise a resumed session keeps its model unless --agent was explicitly supplied; then the selected agent’s configured model (or model group), its definition’s model, and the global model are tried in that order. The system prompt is rebuilt for the selected agent and current working directory, while previous conversation messages are retained. Built-in agents remain available alongside user-defined agents.

Headless runs never ask for confirmation: both ask and deny reject a tool call and return that denial to the model. Configure specific permissions.tools entries or matching rules as allow for unattended mutations. Agent tool restrictions and read-only modes still apply. Tool errors and denials are inputs to the agent loop, not automatically a nonzero process exit; configuration, provider, storage and output errors are failures.

Completed tool rounds are saved even when a later provider request fails. After cancellation, saving has a separate five-second deadline. Partial text from an interrupted stream is not retained. Storage errors are returned. Sessions run in the current directory; resuming does not change directories.

This command registers the static built-in tools only. MCP, sub-agents, interactive questions, LSP, skill injection and snapshot undo are not wired into run; use the TUI for those integrations. The shell tool requires /bin/sh.

ulmi config

Manage configuration files.

SubcommandDescription
ulmi config init [-o path]Write a starter ulmi.yaml (default: cwd).
ulmi config validate [-f path]Validate the merged config and report errors / warnings.

See Configuration for the full reference.

ulmi session

Manage saved conversation history.

SubcommandDescription
ulmi session list [--search S] [--limit N] [--json]List saved sessions ordered by recency.
ulmi session export [id] [--format markdown|json] [-o path] [--subtask ID]Export a session, or a sub-agent transcript with --subtask.
ulmi session delete <id>Permanently delete a session.

Storage backend and path are taken from the sessions block of your config.

ulmi tasks

List and export persisted sub-agent jobs (SQLite session store).

SubcommandDescription
ulmi tasks list [--json] [--session ID] [--limit N]List subtasks across sessions (or filter by parent).
ulmi tasks export <id> [--format markdown|json] [-o path]Export one sub-agent transcript (short ID ok).

ulmi snapshot

Inspect file-mutation history captured by the snapshot manager.

SubcommandDescription
ulmi snapshot list [--session ID] [--limit N]Print the journal in reverse-chronological order.

The default --session is startup, the implicit session used when Ulmi runs outside of a saved conversation. See Snapshots.

ulmi agent

Manage agent definitions.

SubcommandDescription
ulmi agent listList built-in and user-defined agents discovered on disk.
ulmi agent create [--name N] [--description D] [--dir PATH] [--force]Scaffold a new markdown-defined agent under .ulmi/agents/.

See Agents.

ulmi mcp

Manage Model Context Protocol servers.

SubcommandDescription
ulmi mcp listPrint configured servers, their transport, and (for connected ones) their tools.
ulmi mcp get <name>Show one server: type, URL/command, tools, resource/prompt counts.
ulmi mcp add [--name N] [--type local|remote] [--command ...] [--url URL] [--enabled] [--allow-tools ...] [--block-tools ...]Append a server entry to ulmi.yaml. Use YAML for type: sse or streamable-http.
ulmi mcp remove <name>Delete a server entry from ulmi.yaml in the cwd.

See MCP for transports, mcp__server__tool names, and authoring entries by hand.

ulmi version

ulmi version
ulmi version --verbose

Prints the version, GOOS, and GOARCH. The version string is injected at build time by make build / goreleaser from git describe. --verbose also prints the resolved log directory and logging.level.

Hidden / planned commands

ulmi tui exists as an explicit form of the default TUI launch but is hidden from the help output. ulmi run supports tools and saved sessions — see the command section above. There is no ulmi serve yet (roadmap only).

Exit codes

CodeMeaning
0Success.
1Any other failure (configuration error, provider unreachable, model error, …). The error message is written to stderr.

Building the CLI tree from source

The Cobra command tree is built in internal/cli/root.go and the subcommands live alongside it (config.go, run.go, session.go, tasks.go, snapshot.go, agent.go, mcp.go, version.go). Add new subcommands by registering them with cmd.AddCommand(...) inside NewRootCmd.