Reference

Command line

panto dispatches named commands, while agent flags start an interactive session or, with -p, one-shot print mode. run is the agent-bundle form: panto run <file.agent> extracts the bundle and starts a session; other dispatcher subcommands run and exit. --resume <id> consumes a positional session-id prefix, so not all positional text is an error.

CommandDoes
pantoStart a new interactive conversation in the current directory.
panto run <file.agent>Extract an agent bundle and start a session in the current project. A fresh bundle uses PROMPT.md; --interactive skips it.
panto --resume [<id>]Resume the most recent session, or a session whose id begins with the prefix.
panto -c, --continueAlias for bare --resume.
panto -p, --print [<prompt>]Run one non-interactive turn and print assistant text.
panto -m, --model <provider:alias>Override the model for this run.
panto -e, --effort <level>Override the reasoning level for this run.
panto -t, --theme <name>Override the startup theme for this run.
panto --no-extensionsRun with native built-ins only and no tools.
panto sessionsList saved sessions for this directory.
panto models syncFetch models.dev and rebuild the base models.toml.
panto auth …Show auth status, log in, or log out.
panto bootstrap [--force]Bootstrap the bundled LuaRocks runtime and exit.
panto versionPrint the panto version; --version is an alias.
panto update [--check]Update panto to the latest release, or report availability without installing.
panto extension install rock:<spec> | <git-url>Install a LuaRocks spec or a git extension.
panto extension updateUpdate git extensions and configured rocks.
panto extension remove <name>Remove a panto-managed git extension or configured rock.
panto lua [args…]Run the embedded Lua interpreter.
panto --helpShow command-line help; -h and help are aliases.

Configuration is merged in this order: state.toml at $XDG_DATA_HOME/panto/state.toml, then base, user, project, and local config.toml. State is the lowest-precedence remembered picker layer; delete it to reset picker selections. Git-ignore ./.panto/local/ when it contains machine-specific settings.

Starting a session

pantoStart a fresh interactive conversation.
panto --resume [<id>]Resume the latest session, or a session selected by id prefix.

Interactive mode requires both stdin and stdout to be ttys: panto exits with an error when either is not a tty. If no matching session exists for an explicit id, or the prefix is ambiguous, panto exits with an error. Bare --resume and -c/--continue resume the most recent session; when none exists, panto starts a fresh one.

-c, --continue
Alias for bare --resume.
-m, --model <provider:alias>
Override the model for this run. A bare alias also works when it is unique across providers.
-e, --effort <level>
Override the reasoning level for this run. The level must be available for the selected model; otherwise panto exits and lists the available levels. Extension protocols receive the value as their effort string. This overrides both models.toml knobs and [defaults] reasoning.
--no-extensions
Skip the Lua/LuaRocks runtime. Only native built-ins remain; because the shipped tools are extensions, the agent runs with no tools.

Argument errors

Agent-mode startup/parser failures print an error and exit 1. Extension and update usage errors print usage and exit 2; friendly extension failures exit 1.
panto -p, --print [<prompt>]Run exactly one agent turn without the TUI.

An inline prompt wins. Without one, panto reads a non-TTY stdin stream to EOF; all-whitespace input is an error unless panto run <file.agent> supplies a non-whitespace PROMPT.md. A fresh bundle can use that file even with a TTY; --interactive skips it. Print mode streams only assistant text to stdout, flushes each text delta, and adds a newline when a text block ends without one. Bootstrap and rock-install progress goes to stderr.

The selected or newly created session is persisted like an interactive session. Turn failures go to stderr as error: turn failed: <ErrorName> and exit 1; success exits 0. OAuth resolution is noninteractive, so an unauthenticated provider fails instead of starting device login. Combine -p with --resume/-c, -m/--model, -e/--effort, -t/--theme, and --no-extensions.

panto sessions

panto sessionsList sessions for the current directory.

Sessions are stored per working directory. The listing is newest-modified first and prints a disambiguating id prefix of at least eight characters, the modified timestamp, message count, model, and last user message. Newlines, tabs, and carriage returns in the last message are flattened, and the message is width-truncated. Set COLUMNS to control the table width; an absent or invalid value defaults to 120.

panto · sessions
$ panto sessions
ID MODIFIED MSGS MODEL LAST MESSAGE
0197c2a4 2026-07-01 14:32 18 sonnet add json mode to stats
0197bfe1 2026-06-30 09:11 6 gpt-5 clean up the parser errors
~/.local/share/panto/sessions/--Users-travis-Code-ledger--

If there are no sessions yet, panto prints no sessions for <cwd> and then the directory it would use.

panto models

panto models syncFetch models.dev and rebuild the base models.toml.

This is the only valid models action. It fetches models.dev, builds the base catalog from configured providers, and writes it to $XDG_DATA_HOME/panto/models.toml (or ~/.local/share/panto/models.toml). Recognized reasoning capabilities are included for applicable OpenAI-style models. A skipped-provider notice is printed when applicable.

panto · models sync
$ panto models sync
synced 42 model(s) across 3 provider(s) to ~/.local/share/panto/models.toml

The base catalog is merged with user, project, and local models.toml layers, including ./.panto/local/models.toml for local overrides. An omitted action prints usage: panto models sync; an unknown action or extra argument prints that diagnostic and returns success.

panto auth

With no action, panto auth defaults to status.

panto auth status
Show each configured API-key session as resolved or unresolved, and each OAuth device session as logged in or not logged in. With no configured sessions, panto prints no auth sessions configured.
panto auth login <name>
Run the OAuth device flow for the named configured OAuth session, save its tokens, and report when it is ready. An API-key session or unknown name prints an explanation instead of logging in.
panto auth logout <name>
Delete the stored token set for the named session, reporting whether a token was present.

panto bootstrap

panto bootstrap [--force]Run the LuaRocks bootstrap pipeline, then exit.

Ordinary bootstrap is intended to be fast and idempotent. --force wipes the per-Lua-version tree before bootstrapping it. Unknown bootstrap flags are errors. Successful completion reports the ready tree.

panto version

panto versionPrint the installed semantic version.

panto version prints the version; --version is an alias.

panto update [--check]

panto update [--check]Update panto itself, not extension rocks.

Without --check, panto checks, verifies, and installs the latest release. --check reports availability without installing. Invalid update arguments print usage: panto update [--check] and exit 2; release or permission failures are reported as startup failures.

panto extension

panto extension install

panto extension install rock:<spec> | <git-url>Install a configured rock or clone a git extension.

panto extension update

panto extension updateUpdate git extensions and configured rocks.

panto extension remove <name>

panto extension remove <name>Remove a managed extension.

install rock:<spec> installs the LuaRocks spec and records it in state.toml. A git URL is cloned into the data-home dist/<name> and linked from the config-home extensions/<name>. update updates those git clones and all configured rocks. remove removes a managed git extension or a recorded rock. Missing arguments, an extra argument to the git form/update/remove, or an unknown action prints usage and exits 2; the rock: form consumes remaining words as the rock spec. Friendly failures such as an existing extension or missing init.lua exit 1.

panto lua

panto lua [args…]Run the embedded Lua interpreter with panto's runtime wired in.

panto bootstraps the LuaRocks runtime, then passes every argument after lua to the standalone embedded Lua interpreter. The standalone state provides require("panto"), including panto.ext tools, commands, protocols, foreground processes, events, highlighting, styles, JSON helpers, session/model queries, model resolution, and the panto.text.* helpers. A nonzero Lua exit code becomes panto's process exit code.

shellbash
panto lua my-script.lua
panto lua -e 'print(require("panto").text)'

Slash commands

Lines beginning with / are parsed locally inside the TUI and never sent to the model. Arguments are the trimmed remainder of the line. Unknown commands show [unknown command: <line>].

CommandBehaviour
/compact [extra instructions]Summarize older turns to free up context. Extra text becomes compaction instructions. It resolves auth before the call and retries once after an auth failure. A real compaction folds its statistics into the transcript's compaction header, which reads [context compacted: summarized <n> message(s), kept <n> recent turn(s)]; a no-op reports [nothing to compact: conversation already fits] and leaves scrollback untouched.
/helpList the live command registry, including extension commands, and the key bindings.
/quitExit panto.
/model [<provider:alias>]Open the model selector, or switch directly. A unique bare alias also works.
/reasoning [<level>]Open the reasoning selector, or set a valid level directly.
/themeOpen the live theme picker.
/newStart a fresh session in place, reloading the agent and extensions.
/resume [<id>]Open a session picker, or switch to a session by id prefix.
/treeBrowse session history and branch from a selected point. Its picker provides ^T no-tools, ^U user-only, ^A all, ^O default, ^L named rows, and ^F to name the selected row.
/statusShow provider, model, reasoning, session, and context usage.

Lua extensions can register additional commands with panto.ext.register_command { name, description, handler }. The live registry supplies /help and completion; names must not collide with native or other Lua commands. A Lua handler may await asynchronous work: input pauses while it runs, then its returned string or formatted error is emitted.

Shell lines

In the interactive TUI, a line beginning immediately with ! runs a shell command with /bin/sh -c. !<command> stages the formatted command result as a user message for the next model prompt; it does not open a turn. !!<command> stages the same result and immediately opens a model turn. A bare ! displays [empty shell command]; a leading space makes it ordinary model text.

The child shell's stdin is ignored, and its stdout and stderr are merged. Shell output is tail-capped at 50 KiB for the conversation and the transcript preview at 2 KiB. ANSI and control sequences are stripped except newline and tab, and invalid UTF-8 is repaired. Esc or Ctrl+C cancels the command; it times out after five minutes, then receives TERM followed by KILL after 250 ms.

The generated base config seeds [api] timeout = 300 and retries = 3, [compaction] keep_verbatim = 20000, and [tui] tools_collapsed, with default OpenAI and Anthropic providers and auth. The data home includes agent/, auth/, and versioned rocks/lua-5.4.7/ trees. state.toml also persists extensions.rocks.

Environment

VariableEffect
OPENAI_API_KEY
ANTHROPIC_API_KEY
Consumed by the default providers' generated auth sessions.
PANTO_DEBUGWhen nonempty and not 0, write all std.log output, including debug logs, to <data home>/debug/<session-id>.log instead of the terminal.
PANTO_SESSION_DIROverride the sessions base directory; panto still appends the encoded current-working-directory subdirectory.
PANTO_BOOTSTRAP_NO_RECONCILEInternal LuaRocks bootstrap re-entry guard. When present, battery reconciliation is skipped.
XDG_DATA_HOMEDefines the data home as $XDG_DATA_HOME/panto, including base config/models, sessions, auth, rocks, and debug locations.
XDG_CONFIG_HOMEDefines the user config/models location as $XDG_CONFIG_HOME/panto.
HOMEFallback for data and user configuration locations, and supplied to the Lua extension layer-directory bridge.
COLUMNSControls panto sessions table width; absent or invalid means 120.
VISUAL
EDITOR
On Ctrl+G, choose the external editor in this order, then fall back to vi. A configured [tui] editor overrides both.
TMPDIRControls the Ctrl+G editor temporary-file directory; the default is /tmp.
TERM
TERM_PROGRAM
KITTY_WINDOW_ID
Used for best-effort TUI synchronized-output and Kitty-keyboard capability detection.
CMAKE_PREFIX_PATHTemporarily overridden while installing the LuaRocks luv battery, then restored or unset.
${env:NAME}In configured auth-string fields, substitutes the value of any environment variable named NAME; an unset variable becomes empty.