Reference

Command line

panto opens the interactive TUI; -p runs one turn and prints the answer. Subcommands handle everything else. Related: Getting started, Configuration, Key bindings, Lua extensions.

Starting a session

panto [flags] [-- prompt]Start a new session; a prompt after -- becomes the first message.
shellbash
panto
panto -- "fix the failing tests"
panto resume -p -- "continue the task"
  • Quote the prompt: it must be one argument after --. Anything else is a usage error.
  • In the TUI, a startup prompt acts like typed input, so / and ! run a slash command or shell line.
  • Without a startup prompt, the TUI opens with empty input.
  • The TUI needs a terminal; non-TTY stdin is an error.
  • Subcommands come right after panto, and actions right after their group. Put flags after that command path, anywhere before --.
  • Bare sessions, models, auth, and extensions default to list.
  • List filters are case-insensitive globs matched anywhere. * matches any run; ? matches one character.

Flags

Also valid on panto resume.

FlagEffect
-m, --model <provider:alias>Model for this run. A bare alias works when unique across providers; a qualified name can also name an upstream model directly.
-r, --reasoning <level>Reasoning level (Ctrl+R picker labels). Overrides model-specific reasoning and [defaults] reasoning. Extension protocols get it as their effort value; other providers reject an unoffered level and list valid ones.
--theme <name>Startup theme (case-sensitive Ctrl+Y picker name). Overrides [tui] theme. Extension themes work; unknown names warn and fall back to Panto.
-p, --printOne turn, no TUI. See Print mode.
--rig <file.rig|dir>Use a rig. See Rigs.
--ignore-rig-promptSkip the rig's PROMPT.md. Requires --rig.
--no-extensionsSkip the Lua/LuaRocks runtime. Built-ins remain, but shipped tools are extensions, so the agent has none.

Exit codes

CodeWhen
0Success, or help (printed to stdout).
1Operational failure.
2Usage error (usage printed to stderr).
otherNonzero Lua exit code from panto lua.

panto resume

panto resume [id] [flags] [-- prompt]Resume the latest session in this directory, or one selected by id prefix.
  • No sessions here: error, not a new session.
  • An ambiguous id prefix lists the matching ids.
  • Takes all the session flags.
  • A prompt after -- becomes a new message. The rig's PROMPT.md is never replayed.
panto -p, --print [-- prompt]Run the prompt as one agent turn without the TUI.

Use it in scripts and pipes.

shellbash
panto -p -- "summarize the README"
cat task.md | panto -p

A nonempty prompt is required. Choose its source in this order:

OrderSource
1The argument after --; an empty argument blocks fallback and fails.
2Piped stdin, if not all whitespace (read only in print mode)
3The rig's PROMPT.md: fresh sessions only, unless --ignore-rig-prompt
  • stdout: assistant text only, streamed, each block newline-terminated. No thinking or tool traffic.
  • stderr: errors and LuaRocks install progress.
  • Exit 0 on success, 1 on a failed turn or missing prompt.
  • / and ! prompts go to the model as text.
  • Extensions get the same events as in the TUI.
  • The session is saved.
  • No interactive OAuth login: an unauthenticated provider fails.
panto.ext.agent:submit
Extension submissions can start more turns. Panto waits for turns and background work to finish before exiting; see Agents, jobs & submissions.

Rigs

Use a rig to bundle config, models, extensions, and an optional PROMPT.md.

  • Pass --rig to panto, resume, or serve.
  • Rigs are trusted input.
FormHandling
ZIP archive (usually .rig)Extracted privately; removed on exit.
DirectoryUsed in place, unvalidated. Files written there persist.
SettingWith --rig
config.toml, models.toml, extensions, promptsFrom the rig, above the base layer. Built-in tools apply unless the rig denies them.
[auth], [providers], [defaults] modelOnly these user config settings apply; rig values override them. Project and local layers are ignored.
Model aliasesRig aliases layer over your base and user ones.
[server]Rig only; ambient server settings are ignored.
PROMPT.mdFresh sessions only, as the lowest-priority prompt source. Skipped with --ignore-rig-prompt, by resume, and by serve.

See Configuration: Rigs.

panto serve

panto serve [--rig <file.rig|dir>] [--host addr] [--port n] [--no-extensions]Run the Anthropic Messages proxy server.
--rig <file.rig|dir>
Serve with the rig's config, models, and extensions. See Rigs.
--host <addr>
Override [server] host.
--port <n>
Override [server] port; 1–65535.
--no-extensions
Skip Lua/LuaRocks extensions; native providers stay available.
  • Default listener: 127.0.0.1:8080.
  • No fallback model. Unknown providers and unknown or ambiguous bare aliases return HTTP 400.
  • Non-loopback binding needs a nonempty token via [server] auth_token_env.
  • Browser Origin requests are rejected.
Request modelRouting
provider:alias
provider:model
Name a configured provider and a model alias, or use an upstream model name directly.
aliasMust match exactly one configured model alias across providers.

Auth and limits: Configuration: [server].

panto sessions

panto sessions [list [filter]]List saved sessions for the current directory.
  • The filter matches id or last user message.
  • Columns: id prefix, modified time, message count, model, last user message. Newest first.
  • Printed id prefixes are unique across this directory's sessions, including filtered-out rows (8+ characters); pass one to panto resume.
  • With no sessions, prints the current directory and its session directory.

panto models

panto models [list [filter]]List merged model aliases: provider:alias, wire model, and reasoning levels.

An asterisk marks the effective default model. The filter matches provider:alias.

panto models sync [--no-live-models]Fetch models.dev and rebuild the base models.toml.
--no-live-models
Allow catalog-only output when a live listing is unavailable. Sync still attempts live listings and uses those it can read.

Without this flag, an unreadable live listing for a multi-endpoint provider makes sync fail and leaves the base file unchanged. See Configuration: models.toml.

panto auth

Show and manage auth sessions.

panto auth list [filter]
API-key sessions show as resolved or unresolved; OAuth device sessions as logged in or not. The filter matches session names. Bare panto auth runs this.
panto auth login <name>
Run the OAuth device flow for a configured OAuth session. API-key sessions can't log in.
panto auth logout <name>
Delete the session's stored token set.

panto extensions

Manage panto-installed git extensions and rocks. Git operations need git on your PATH.

panto extensions list [filter]
List managed git extensions and rocks recorded by the install command, labeled git or rock. The filter matches names. Bare panto extensions runs this.
panto extensions install rock:<spec> | <git-url>
Install a LuaRocks spec (recorded in state.toml) or clone a git extension. Extra words extend only a rock spec, such as a version; git URLs take no extra arguments. A git extension must contain an init.lua.
panto extensions update
Update managed git extensions and reinstall configured rocks.
panto extensions remove <name>
Remove a managed git extension or a rock recorded by the install command.

panto update

panto update [--check]Check, verify, and install the latest panto release. Extensions are not updated.
--check
Only report whether an update is available.

panto bootstrap

panto bootstrap [--force]Bootstrap the bundled LuaRocks runtime, then exit. Safe to rerun.
--force
Wipe the per-Lua-version rocks tree before reinstalling.

panto lua

panto lua [args…]Run the embedded Lua interpreter with panto's runtime initialized.
shellbash
panto lua -e 'print(_VERSION)'
  • Arguments go to the interpreter or script. Only the first argument after lua recognizes help.
Runtime entryUse
require("panto")Load the embedded module.
panto.extExtension utilities.
panto.textText-width helpers.

See Lua extensions.

panto version

panto versionPrint the installed version. There is no --version flag.

panto help

panto help [command…]Print help for any command path; -h and --help are aliases.
shellbash
panto help models sync
panto models sync --help
panto models sync -h

The help words are reserved before --; after it they are ordinary data. panto lua is the exception: see above.

Slash commands

In the TUI, a line starting with / runs locally and is not sent to the model. Arguments are the trimmed rest of the line.

CommandBehavior
/compact [instructions]Summarize older turns to free context; extra text guides the summary. Retries once on auth failure; reports when nothing needs compacting.
/helpList slash commands and key bindings.
/quitExit panto.
/model [provider:alias]Pick a model, or switch directly (unique bare alias OK).
/reasoning [level]Pick a reasoning level, or set one directly.
/themePick a theme with live preview.
/collapseToggle all tool output between expanded and collapsed.
/thinkingToggle thinking visibility and remember the choice.
/redrawDrop render caches and redraw the TUI.
/newFresh session in place; reloads agent and extensions.
/resume [id]Pick a session, or switch by id prefix.
/lastSwitch to the previous session; repeat to toggle between the two most recent sessions.
/proceedRun the conversation as is, with no new prompt.
/treeBrowse history and branch from a point. See Key bindings.
/statusShow model, reasoning, session id, message count, and context usage.
SituationResult
Leading space before /Sent to the model as text.
Entered during a turnTyped slash-command lines wait until the turn ends. Only key bindings whose commands are registered for mid-turn dispatch run immediately; a typed slash command never does.
Unknown commandShows [unknown command: <line>].
Print modeNot run; sent to the model as text.

Extension commands

panto.ext.register_command { name, description, handler }
Register a slash command; see Lua extensions.
  • The handler gets the trimmed arguments (or an empty string); a returned string is shown.
  • Listed in /help and completion when extensions load.
  • A name collision with any other command stops the session from opening.
  • TUI input pauses while a handler awaits async work.

Shell lines

In the TUI, a line starting with ! runs through /bin/sh -c.

InputEffect
!<command>Add command and result to the conversation for your next prompt. No turn starts.
!!<command>Same, and start a turn right away if idle.
! or !!Shows [empty shell command].
␣!<command>A leading space sends the text to the model.

During a turn, shell input is injected at a safe tool boundary if one comes, otherwise after the turn.

AspectBehavior
Input/outputNo stdin; stdout and stderr merged.
SizeLast 50 KiB of output kept; transcript preview capped at 2 KiB.
CleanupANSI escapes and control characters stripped (newline and tab kept); invalid UTF-8 replaced.
CancelEsc or Ctrl+C: TERM, then KILL after 250 ms.
Timeout5 minutes.

Environment

Use environment variables to set credentials, paths, and runtime options.

VariableEffect
OPENAI_API_KEY
ANTHROPIC_API_KEY
Used by the default providers. See Authenticate.
PANTO_SERVER_TOKENInbound server token, when [server] auth_token_env names it.
PANTO_DEBUGNonempty and not 0: an agent session captures std.log output in the data home's debug/<session-id>.log.
PANTO_SESSION_DIRSessions base directory; a per-directory subfolder is still appended.
XDG_DATA_HOMEData home becomes $XDG_DATA_HOME/panto.
XDG_CONFIG_HOMEUser config root becomes $XDG_CONFIG_HOME/panto.
HOMEFallback when the XDG variables are unset.
COLUMNSpanto sessions table width; absent or invalid means 120.
VISUAL
EDITOR
Ctrl+G editor. Order: [tui] editor, then VISUAL, then EDITOR, then vi.
TMPDIRCtrl+G temp file and extracted rigs; defaults to /tmp. Rig extraction also uses /tmp when it is empty or relative.
TERM
TERM_PROGRAM
KITTY_WINDOW_ID
Hints for synchronized-output and Kitty-keyboard detection. See Terminal protocol.
PANTO_RELEASES_APIRelease API base for panto update.
PANTO_BOOTSTRAP_NO_RECONCILEInternal bootstrap guard: when present, skips battery reconciliation.
CMAKE_PREFIX_PATHTemporarily overridden while installing the luv battery, then restored or unset.
${env:NAME}In auth string fields, expands to variable NAME; unset expands to empty.