Skip to content

jarvis Command

jarvis is the main command for Jarvis Code CLI, used to start an interactive session in the terminal. Running it without any arguments opens a new session in the current working directory; combined with different flags, you can resume a previous session, skip approvals, start in Plan mode, or load Skills from a custom directory.

sh
jarvis [options]
jarvis <subcommand> [options]

Main command options

All flags are optional — run jarvis directly to enter an interactive session:

OptionShortDescription
--version-VPrint the version number and exit
--help-hShow help information and exit
--session [id]-SResume a session. With an ID, opens that session directly; without an ID, enters an interactive selector
--continue-cContinue the most recent session in the current working directory, without specifying an ID manually
--model <model>-mSpecify a model alias for this launch. When omitted, new sessions use default_model from the config file
--prompt <prompt>-pRun a single prompt non-interactively and print the response. This mode does not open the TUI
--output-format <format>Set the non-interactive output format; supports text and stream-json. Can only be used with --prompt; defaults to text
--yolo-yAuto-approve regular tool calls, skipping approval requests
--autoStart with auto permission mode; tool approvals are handled automatically and the Agent will not ask the user questions
--planStart a new session in Plan mode — the AI will prioritize read-only tools for exploration and planning
--skills-dir <dir>Load Skills from the specified directory, replacing the automatically discovered user and project directories. Can be repeated
--agent <name>Start a new session with the specified agent profile. Cannot be combined with --agent-file, --session, or --continue
--agent-file <path>Load a custom agent from a Markdown file for the new session and select it. Cannot be repeated or combined with --agent, --session, or --continue
--add-dir <dir>Add an extra workspace directory for this session. Relative paths resolve against the current working directory. Can be repeated

-r / --resume is a hidden alias for --session; --yes and --auto-approve are hidden aliases for --yolo and are not shown in help output.

WARNING

--yolo skips human approval for regular tool calls, including file writes and shell command execution. Use it only in trusted working directories. Plan mode exit approval is not bypassed by --yolo; Bash inside Plan mode is handled under the regular allow rules.

Flag conflict rules

The following combinations are rejected at startup:

  • --continue and --session are mutually exclusive — both mean "resume a previous session"
  • --yolo and --auto are mutually exclusive — the two permission modes cannot be combined
  • --prompt cannot be used with --yolo, --auto, or --plan — non-interactive mode uses auto permission by default
  • --output-format can only be used together with --prompt
  • --agent and --agent-file are mutually exclusive; either one cannot be used with --session or --continue
  • --session without an ID cannot be used with --prompt

When resuming a session, you can override its saved permission or plan mode by adding --auto, --yolo, or --plan. For example, jarvis --continue --auto resumes the latest session and switches it to auto permission mode.

Common usage

Start a new session directly:

sh
jarvis

Pick up where you left off (automatically finds the most recent session in the current directory):

sh
jarvis --continue

Choose from the session history list, or specify a known ID directly:

sh
jarvis --session
jarvis --session 01HZ...XYZ

Skip approval prompts — suitable for batch tasks that are known to be safe:

sh
jarvis --yolo

Let the Agent handle everything autonomously, without asking the user questions:

sh
jarvis --auto

Read the code and produce an implementation plan before making any file changes:

sh
jarvis --plan

Custom skills directories

There are two ways to specify Skills directories, with different semantics:

  • --skills-dir <dir> (CLI flag): Replaces the automatically discovered user and project directories for this launch only. Can be repeated to stack multiple directories:

    sh
    jarvis --skills-dir /path/to/team-skills --skills-dir ./local-skills
  • extra_skill_dirs (config.toml): Adds directories on top of the automatically discovered ones, taking effect permanently. Suitable for configuring team-shared Skills. See Agent Skills.

Custom agents

--agent and --agent-file select which agent drives a new session, in both print mode (jarvis -p) and the interactive TUI:

sh
jarvis --agent reviewer
jarvis -p --agent reviewer "Review the changes on this branch"

--agent-file registers a single agent file at the highest priority for this launch only and selects it; the flag cannot be repeated, and --agent and --agent-file are mutually exclusive. Both flags only apply when starting a new session — neither can be combined with --session/--continue, because the agent is bound at session creation and resuming restores the bound agent automatically. The selection is fixed at the session's first bind and cannot be switched later; in the TUI the flags bind only the startup session, and a session created later in the same process (for example via /new) starts with the default agent. See Agents and Sub-Agents for the agent file format and discovery directories.

Non-interactive execution

When running a single prompt in a script or CI environment, use -p:

sh
jarvis -p "Summarize the current repository status"

Output uses a transcript style: thinking content and Assistant text are both prefixed with , and wrapped lines are indented by two spaces. Assistant text goes to stdout; thinking, tool progress, and "resuming session" notices go to stderr. In -p mode, no human approval is requested — regular tool calls are handled under the auto permission policy, while static deny rules remain in effect.

Temporarily switch the model:

sh
jarvis -m jarvis-code/kimi-for-coding -p "Explain the latest diff"

When you need to parse output programmatically, use the stream-json format — each line on stdout is a JSON object:

sh
jarvis -p "List changed files" --output-format stream-json

In stream-json mode, regular replies produce an Assistant message; when the model calls a tool, an Assistant message with tool_calls is emitted first, followed by the corresponding Tool message, then subsequent Assistant messages. Thinking content is not written to JSONL; tool progress and "resuming session" notices are still written to stderr.

Subcommands

jarvis provides the following subcommands: login (non-interactive login), acp (ACP IDE mode), server (run the local REST/WebSocket API service), doctor (validate configuration files), export (export a session), upgrade (check for updates), search (manage web search and rerank), and provider (manage providers).

jarvis login

Log in to Jarvis Code CLI with the device-code flow, without entering the TUI. The command issues a device authorization request, prints the verification URL and user code to stderr, then polls until the browser-side authorization is complete. The generated token is written to the same local location as TUI /login and is loaded automatically the next time jarvis starts.

sh
jarvis login

Use --region <region> to select mainland-cn (kimi.com) or global (kimi.ai). Press Ctrl-C at any time during polling to cancel; the exit code is 1 on cancellation or failure, and 0 on success.

jarvis acp

Switch Jarvis Code CLI to ACP (Agent Client Protocol) mode, communicating with an IDE via JSON-RPC over stdin/stdout so the editor can directly drive the CLI's sessions and tool calls. You typically do not need to run this manually — the IDE starts it as a subprocess entry point. For configuration, see Using in IDEs; for technical details, see the jarvis acp reference.

sh
jarvis acp

jarvis acp --login runs the device-code login flow and exits. With --login, --region <region> accepts mainland-cn (kimi.com) or global (kimi.ai).

jarvis server

Run the local Jarvis API server in the foreground of the current terminal. The process exposes REST and WebSocket APIs without serving static browser assets or opening a browser. It stays attached to the terminal and shuts down cleanly on SIGINT / SIGTERM (for example, Ctrl-C).

When the server is running, GET /openapi.json returns the REST OpenAPI document and GET /asyncapi.json returns the local WebSocket AsyncAPI document. For an end-to-end walkthrough of driving sessions over the API, see Local server and API; for the protocol details, see the Server API reference.

sh
jarvis server
jarvis server --port 58628
jarvis server --host 127.0.0.1

Multiple instances can share one home directory: each registers itself under ~/.jarvis-code/server/instances/, and a busy port is retried with port + 1 (58628, 58629, …) for up to 100 attempts.

OptionDescription
--port <port>Bind port; defaults to 58627; a busy port is retried with +1
--host [host]Bind host; omit for 127.0.0.1 (this machine only), pass a bare --host for 0.0.0.0 (all interfaces)
--allowed-host <host...>Extra Host header values allowed through the DNS-rebinding check; repeatable or comma-separated
--log-level <level>Enable server logs at the selected level; omitted by default
--debug-endpointsMount /api/v1/debug/* routes (off by default)
--insecure-no-tlsAllow a non-loopback bind without a TLS-terminating reverse proxy; enabled by default
--allow-remote-shutdownKeep the shutdown endpoint enabled on a non-loopback bind
--dangerous-bypass-authDisable bearer-token auth on all REST and WebSocket routes; only for trusted networks or behind an authenticating proxy

jarvis server binds to local loopback only by default and prints the bearer token in the startup banner.

DANGER

--dangerous-bypass-auth disables authentication entirely. Anyone who can reach the port gets full access to your sessions, filesystem, and shell. Only use it on a trusted network or behind your own authenticating reverse proxy, and stop the server with Ctrl+C when you are done.

jarvis server rotate-token

Generate a new persistent bearer token (written to ~/.jarvis-code/server.token); the previous token stops working immediately. The token is shared by the whole home directory, so every running instance picks the new one up on its next auth check — no restart needed.

sh
jarvis server rotate-token

jarvis doctor

Validate config.toml and tui.toml without starting the TUI or modifying either file. By default, the command checks the files under JARVIS_CODE_HOME (or ~/.jarvis-code when the environment variable is unset). Missing default files are reported as skipped because built-in defaults can apply.

sh
jarvis doctor
CommandDescription
jarvis doctorValidate the default config.toml and tui.toml
jarvis doctor config [path]Validate only config.toml, using path instead of the default file when provided
jarvis doctor tui [path]Validate only tui.toml, using path instead of the default file when provided

When an explicit path is passed, the file must exist. The command exits with 0 when all checked files are valid or skipped, and 1 when any requested file is missing or invalid.

sh
# Check the default config files
jarvis doctor

# Check only the default runtime config
jarvis doctor config

# Check a candidate TUI config before replacing the live config
jarvis doctor tui ./tui.toml

jarvis export

Package a session into a ZIP file for sharing, archiving, or submitting bug reports.

sh
jarvis export [sessionId] [options]
Parameter / OptionShortDescription
sessionIdThe ID of the session to export. When omitted, the most recent session in the current working directory is automatically selected and requires confirmation
--output <path>-oOutput ZIP file path. When omitted, writes to a default filename in the current directory
--yes-ySkip the confirmation prompt for the default session and export directly
--no-include-global-logDo not include the global diagnostic log. Included by default

The export contains all files in the target session directory. The global diagnostic log (~/.jarvis-code/logs/jarvis-code.log) is included by default because it may contain events from other sessions or projects; add --no-include-global-log if you do not want to share it.

sh
# Export the most recent session in the current directory, skipping confirmation
jarvis export -y

# Export a specific session to a custom path
jarvis export 01HZ...XYZ -o ./bug-report.zip

# Exclude the global diagnostic log
jarvis export 01HZ...XYZ -o ./bug-report.zip --no-include-global-log

jarvis upgrade

Immediately check for the latest version and display an update prompt; exits after you make a selection. jarvis update is an alias for this command.

sh
jarvis upgrade

For global npm, pnpm, yarn, and bun installations, jarvis upgrade shows update options; selecting Install update now runs the corresponding foreground install command. For native installations (including Windows), it downloads and verifies the new binary in the foreground and swaps it in on the next start. When the current installation method cannot be upgraded automatically, the manual update command is printed instead.

jarvis vis

Launch the session visualizer in your browser to inspect a session as it unfolds. The command starts an in-process server pointed at your local sessions, prints the URL, opens your browser, and keeps running until you press Ctrl-C.

sh
jarvis vis [sessionId] [options]
Parameter / OptionDescription
sessionIdOpen the visualizer directly to this session. When omitted, it opens the home view listing your sessions
--port <number>Port to bind. By default an available port is picked automatically
--host <host>Host to bind. Default: 127.0.0.1
--no-openDo not open the browser automatically; just print the URL
sh
# Start the visualizer and open the browser at the home view
jarvis vis

# Open directly to a specific session
jarvis vis 01HZ...XYZ

# Bind a fixed port and host without opening a browser (e.g. on a remote host)
jarvis vis --host 0.0.0.0 --port 8123 --no-open

Manage the web search backend and semantic rerank without opening the TUI. In Settings → Web Search, the current providers appear at the top: Web search provider only configures or edits Moonshot, LangSearch, or Brave (preserving the current selection), Active web search provider explicitly switches which configured backend serves WebSearch, and Rerank provider independently manages the reranker status and API key. Configuring Moonshot can reuse the current Jarvis Code OAuth login or accept an API key for the China or Global API region. Both the CLI and TUI persist changes to [services] in config.toml; on the CLI, jarvis search set brave|langsearch both configures and selects the backend (writes active_search_provider), while jarvis search use only switches the selection. Brave Search requires explicit selection and a valid API key. LangSearch web search works the same way. On the default agent-core-v2 engine, the selected provider is atomic: if its credentials are missing or invalid, WebSearch is unavailable rather than falling back to another backend.

CommandDescription
jarvis search statusShow the selected and active search backends and rerank status
jarvis search set langsearch --api-key <key>Configure and select LangSearch web search
jarvis search set brave --api-key <key>Configure and select Brave Search
jarvis search set rerankConfigure LangSearch semantic rerank; reuses the search API key by default
jarvis search use <provider>Select an already-configured backend: brave, langsearch, or moonshot
jarvis search clear langsearchRemove [services.langsearch]; clears the selection when it was active
jarvis search clear braveRemove [services.brave]; clears the selection when it was active
jarvis search clear rerankRemove [services.rerank]
jarvis search limitsShow the published LangSearch quotas for each tier

jarvis search set langsearch accepts --tier <free|tier1|tier2|tier3> and --count <1-10>. jarvis search set brave accepts an optional --base-url <url>. jarvis search set rerank accepts --provider langsearch, an optional --api-key <key>, and --enabled <true|false>.

sh
jarvis search set langsearch --api-key YOUR_API_KEY --tier free --count 10
jarvis search set brave --api-key YOUR_API_KEY
jarvis search use brave
jarvis search set rerank
jarvis search status
jarvis search clear rerank
jarvis search clear brave

See services for the complete configuration field reference and backend precedence.

jarvis provider

Manage providers in the shell — the non-interactive equivalent of /provider in the TUI. Suitable for scripted deployments, CI initialization, and one-line setup on a new machine.

sh
jarvis provider <action> [options]

Five actions are available:

jarvis provider add <url>

Bulk-import all providers from a custom registry (api.json). The command fetches the registry, creates a [providers.<id>] and [models.<alias>] entry for each item, and writes source metadata so the TUI refreshes providers and models from the same registry URL automatically on next startup.

Parameter / OptionDescription
<url>Registry URL
--api-key <key>Bearer token for accessing the registry. Falls back to the JARVIS_REGISTRY_API_KEY environment variable if not provided; required
sh
jarvis provider add https://registry.example.com/v1/models/api.json --api-key YOUR_KEY

# Or via environment variable (suitable for CI / .envrc)
JARVIS_REGISTRY_API_KEY=YOUR_KEY jarvis provider add https://registry.example.com/v1/models/api.json

If a provider ID already exists, it is removed and re-created. The default model is not set automatically; you can select one later with -m or /model in the TUI.

jarvis provider remove <providerId>

Remove the specified provider and all its model aliases. If the removed provider is the one referenced by default_model, default_model is also cleared.

sh
jarvis provider remove kohub

jarvis provider list

Print each configured provider on a separate line, including type, model count, and source. Add --json to output the raw providers and models tables for programmatic processing.

sh
jarvis provider list
jarvis provider list --json | jq '.providers | keys'

jarvis provider catalog list [providerId]

Browse the public models.dev model catalog without modifying any configuration. Without an argument, lists all providers along with their protocol type and model count; with a providerId, lists all models under that provider along with their context window and capabilities. If the catalog URL cannot be reached, a built-in snapshot of the catalog is used instead.

Parameter / OptionDescription
[providerId]Optional — the provider ID to inspect
--filter <substring>Case-insensitive substring filter on ID or name
--url <url>Override the catalog URL; defaults to https://models.dev/api.json
--jsonOutput matching entries as JSON
sh
jarvis provider catalog list
jarvis provider catalog list --filter anthropic
jarvis provider catalog list anthropic

jarvis provider catalog add <providerId>

Import a known provider directly from the catalog by ID. The protocol type, base URL, and model information are all supplied by the catalog — only an API key is required. Vendors whose protocol the catalog does not declare (e.g. xai, openrouter, and other vendor-specific SDKs) are imported as OpenAI-compatible and the output notes the guess; when the catalog provides no usable endpoint, --base-url is required. Proprietary protocols (e.g. Amazon Bedrock) cannot be imported. When the public catalog is unreachable, the import uses the built-in snapshot, so it still works offline or in blocked networks.

Parameter / OptionDescription
<providerId>Provider ID in the catalog, e.g., anthropic, openai
--api-key <key>Provider API key. Falls back to JARVIS_REGISTRY_API_KEY if not provided; required
--default-model <modelId>Optional — set default_model to <providerId>/<modelId> after import
--base-url <url>Override the catalog endpoint; required when the catalog declares none (or only an env placeholder)
--url <url>Override the catalog URL; defaults to https://models.dev/api.json
sh
jarvis provider catalog list anthropic          # Browse available models first
jarvis provider catalog add anthropic --api-key sk-ant-... --default-model claude-opus-4-7

Next steps

  • Slash Commands — Quick reference for control commands in the interactive TUI
  • Configuration Files — Persistent configuration for default_model, permission mode, and other startup parameters
  • Agent Skills — Skill file format for directories loaded via --skills-dir
  • Agents and Sub-Agents — Built-in sub-agents, custom agent files, and main Agent selection via --agent