Skip to content

Commands & CLI

Slash commands

Command grammar

  • A singular noun names the current entity: /mode, /model, /provider, /session, /role, /plan, /todo.
  • A plural noun names the catalog: /modes, /models, /providers, /sessions, /roles, /plans, /todos.
  • A verb is a global action: /clear, /compact, /help, /exit, /summary, /status, /continue, /cancel.
  • An action on a catalog is <plural> <verb>: /providers connect, /sessions load, /roles show, /jobs run.
  • /quit, /new, and /connect are the only shorthand names. There are no one-letter aliases.
  • /help lists commands and tools. /help <name> shows detail for either.

Run polyglav and type / to tab-complete commands. Use /help or /help <cmd> for details.

Command Aliases Description
/cancel Close a paused turn as cancelled
/clear Clear the screen and reprint the header without leaving or changing the session
/compact Summarize the conversation and trim the provider context
/config Show, get, set, or unset config values (/config <key> <value>, /config unset <key>, /config --global <key> <value> for a global line). The default listing is grouped by owner and alphabetical within each group, with key, value, and origin columns ((default), (global), or (local)) and hides descriptions. /config <key> shows the value, origin, default, and description, and /config --verbose (or -v) adds every default and description on an indented line. A value too long for the value column prints as an indented value/source block
/connect Connect a provider. /connect picks interactively from the known providers. /connect <name> presets a known provider's defaults and (re)enters its API key through hidden input. /connect <url> detects a known host or creates a named custom provider (derived from the host, or /connect <url> <name> to name it). Tests the connection before saving, stores the API key + base URL in global providers.json, and writes base_url into config. The model is picked separately with /model
/context Show context and token usage: message count, used context tokens, the context window and percentage when known, current-turn input/output/thinking/requests, and session totals. /context window [tokens] shows or sets the active model's context window, and 0 clears it
/continue Resume the last active paused turn, or parent or a run or session ID
/exit /quit Save and exit
/help Show available commands and tools (/help <cmd|tool> for detail)
/init Generate an AGENTS.md skeleton, with --force and --update
/history List the active session's turns as a numbered index: /history [N|N-O|-O|N-|all] [session:<name> ...] [--thoughts [all]] [--tree]. With no selector it shows the last 10. --thoughts adds a dim thinking excerpt (all prints it in full), session:<name> reads another session, and --tree lists the root and its sub-runs. Turn lines include the turn's total tokens when the provider reported usage. See session.md
/jobs Manage scheduled and durable jobs: add, approve, disable, enable, list, reject, remove, run, show, status. See jobs.md
/mcp Manage MCP servers: connect (all if no name), disconnect (all if no name), list. See mcp.md
/memorize Summarize the active run into bounded memory: /memorize (active role), or /memorize <role\|team\|job> <name>. Writes .polyglav/memory/<scopes>/<name>.md. See config.md
/mode Show the current agent mode, or switch it (/mode <name>). See modes.md
/model Show or switch the active model. /model <name> sets it on the current provider. /model <provider>/<model> switches provider and model together and approves the model immediately
/models List configured models, or probe a provider's available models. /models shows the approved-model history grouped by provider ((key) when the provider has a stored key), marking (unused) when a model never completed a run and (failed) when its last run errored. /models list [provider] probes a provider's advertised models live (default: current provider), and /models remove <provider>/<model> drops a model from the registry, asking first when it is the active one
/modes List the available agent modes, marking the current one. /modes --verbose adds each mode's description, and /modes <name> prints that mode's instruction. See modes.md
/new Start a new session, the same as /session new
/onboard Set up this project (provider, model, mode, purpose, assistant, output log). See plugins.md
/plan Show the current run's internal plan, attach one (use <path>), or detach it (off). See modes.md
/plans List every stored plan, marking the attached one. /plans <id> prints one by plan id or session id. See modes.md
/plugins /plugin Manage plugins: disable, enable, install, list, uninstall, update
/print Reprint turns: /print [N|N-O|-O|N-|N.M] [session:<name> ...] [--full] [--tree]. N prints one turn, N-O a range, -O the last O turns, N- from N to the current turn, and N.M a part. session:<name> reads another session. --tree renders the root and its sub-runs. See session.md
/provider Show or switch the active provider
/providers List provider connections, alphabetical, with the active one marked and (key) when a key is stored, and (custom) for a provider with no built-in factory
/role Show the active run's role and session. See roles.md
/roles Manage roles: list (list <tag> filters), new <name> [prompt], remove <name>, show <name>. See roles.md
/session Show or switch the active session: /session new, /session load <name>, /session save. The summary shows message count and token context. Saved-session catalog operations live under /sessions
/sessions Manage the saved-session catalog: delete, export <name> [out] [--json] [--tree], import <file> [name] [--force], list (roots only), preview, prune --older-than <days> [--dry-run] (see session.md)
/skills Manage skills: list, new <name>, remove <name>, show <name>. See skills.md
/summary Summarize the current session into .polyglav/summaries/<session>.md without trimming the provider context
/spawn Launch, list, stop, or ask a scoped serve agent. /spawn <name> <path> launches one, /spawn ask <name> <prompt> delegates to it, /spawn stop <name> stops it, and /spawn lists agents
/status Show the model, mode, current session, token context and window, current-turn and session token usage, live runs, plugins, jobs, and fleet state
/teams Manage teams: list (list <tag> filters), new <name> [description], remove <name>, run <name> <task>, show <name>. See teams.md
/thinking /reasoning Show or set the reasoning scope: off, assistant, agent, or all (/thinking on = all, off = off). off hides the reasoning text but still prints the ✓ Thought marker. Prints @ Thinking: <scope>
/verbosity /verbose Show or set display scopes: /verbosity, /verbosity <scope>, /verbosity <scope> <value>, /verbosity preset quiet\|normal\|verbose, /verbosity reset [scope]
/todo Show or edit the current run's internal todo: add <title>, start <id>, done <id>, block <id> [note], remove <id>, list. See modes.md
/todos List every stored todo, marking the current one. /todos <id> prints one by session id or name. See modes.md
/version Show the Polyglav version

/help renders commands with subcommands indented below and then lists the allowed tools (policy- and mode-filtered, so read mode hides write and exec tools). Providers and models complete at the prompt: /connect, /provider, /providers, and /models list complete provider names, and /model completes a provider then its known models (from models.json and a cached live probe).

Delegation is a normal tool: the caller agent proposes it, or you ask for it in a prompt and the model routes the same call tool. A configured role is called without prompting (call defaults to allow. Set a role's call to ask to confirm), and a role outside the registry is denied. A named team runs through the same call tool with kind: "team". Anonymous help runs through delegate. See roles.md and swarm.md.

CLI

usage: polyglav [-h] [--path PATH] [-v] {config,eval,export,fleet,jobs,mcp,metrics,models,plugins,run,serve} ...

Global:

Flag Description
--path Project path (default: current directory)
--version, -v Print the installed version and exit

polyglav run

One-shot headless chat.

Flag Description
--prompt, -p Required. The prompt to send
--provider Provider override (e.g. ollama, openai, groq)
--model Model override (accepts a provider/model ref. Explicit --model auto-approves)
--approve-model Approve the configured model ref without prompting
--base-url Base URL override
--mode Agent mode override (read or write)
--output json (default) or text
--verbose Print tool status and diagnostics to stderr
--yes Auto-approve tools that require confirmation
--no Auto-deny tools that require confirmation (default)
--path Project path

polyglav export

Export a saved session to Markdown or JSON (see session.md).

Flag Default Description
name Required Session name to export
--out .polyglav/exports/<name>.md Output file, - for stdout
--json off Export JSON instead of Markdown (default .polyglav/exports/<name>.json)
--path Project path

polyglav import

Import a session from a JSON export (see session.md).

Flag Default Description
file Required JSON export to import
--name the file's session name Session name to import as
--force off Overwrite an existing session with that name
--path Project path

polyglav providers

Manage provider connections.

polyglav providers list
polyglav providers connect <name> --base-url <url> --key <key>
polyglav providers probe <name>
polyglav providers remove <name>

connect stores the connection in providers.json and sets the active provider and base URL. probe tests the stored endpoint. The key is never printed.

polyglav models

List configured models, or probe a provider's available models (mirrors /models).

polyglav models                          # approved-model history grouped by provider, `>` marks the active model, `(key)` a stored key, `(ctx=..., out=...)` the provider budgets
polyglav models list [provider]          # probe a provider's advertised models (default: current), exit 1 on failure
polyglav models context <ref> <tokens>   # set the context budget for a model, e.g. opencode-go/deepseek-v4.1-flash 1000000

The context budget is used for relative compaction thresholds and display, not as a hard model limit. It is stored on the model entry in models.json.

Flag Default Description
--path Project path

polyglav eval

Tool-use evaluation harness: run task fixtures through the agent loop and report metrics. See eval.md.

polyglav eval --path <project> list              # list discovered fixtures
polyglav eval --path <project> run [--fixture <id>] [--provider P] [--model M]
polyglav eval --path <project> run --compare ollama,openai --output json
Flag Default Description
--fixture Fixture id or substring (default: all)
--provider Provider override
--model Model override
--base-url Base URL override
--compare Comma-separated providers to compare
--output table table or json

polyglav metrics

Run metric tasks and write one JSON record per task and condition. See metrics.md.

polyglav metrics --path <project> list
polyglav metrics --path <project> run --task <id> --condition single
polyglav metrics --path <project> run --condition single,multi --output json
Flag Default Description
--task Task id or substring (default: all)
--condition single Comma-separated conditions: single, multi
--mode task mode (read) Override the task mode with read or write
--provider Provider override
--model Model override
--base-url Base URL override
--output table table or json
--out .polyglav/metrics/runs Record directory

polyglav config

Scoped, scriptable config management, with the same layers as /config (see config.md).

polyglav config get [key ...] [--show-origin]   # effective values, default all keys
polyglav config set <key> <value> [--global]    # JSON-parseable value, default local
polyglav config unset <key> [--global]          # drop a value from the selected scope
polyglav config reload                          # re-read the config files from disk
Flag Default Description
--global Operate on ~/.config/polyglav/config.json
--local (default) Operate on the project .polyglav/config.json
--path Project path
--show-origin get only - append default/global/local

polyglav serve

HTTP JSON API server. See api.md. Also serves POST /mcp (MCP server) when the polyglav-core-mcp plugin is loaded.

Flag Default Description
--host 127.0.0.1 Bind address
--port 8787 Bind port
--path Project path
--mode Agent mode override (read or write)

polyglav mcp

Run polyglav as an MCP server over stdio (newline-delimited JSON-RPC). See mcp.md. Requires the polyglav-core-mcp plugin.

Flag Default Description
--path Project path

polyglav jobs

Scheduled and durable jobs (cron / interval / one-shot), with retries, backoff, a user-in-the-loop approval gate, and recorded run history. See jobs.md.

Subcommand Description
add polyglav jobs add <name> --file jobs/<name>.md --cron "0 2 * * *" (or --interval N / --at ISO, with --prompt optional when --file given), plus --mode, --provider/--model, --role, --system-prompt, --tools-deny, --tool-permission, --retries, --backoff, --timeout, --require-approval, --approve-model, --approval auto
approve approve <name> - activate a job (or arm the next run for --require-approval jobs)
daemon daemon [--tick 15] [--quiet] - scheduler loop, Ctrl-C to stop
edit edit <name> - open the job's linked task file in $EDITOR (creates the template first)
enable / disable / stop Toggle the enabled gate (stop = disable)
list Table of jobs: schedule, status, next and last run
reject reject <name> - send back to proposed and disable
remove remove <name> - drop the definition (sessions are kept)
run run <name> [--no-retry] [--verbose] - run now, apply retries, print the answer. --verbose streams the live turn. Exit 0 verified / 1 failed
show polyglav jobs show <name> - definition plus full run history + last output
status Runtime summary per job: fired count, last error, uptime, approval state

polyglav fleet

Supervise a fleet of scoped polyglav serve agents: ports, health checks, restart policy, config generation. See fleet.md.

Subcommand Description
add add <name> [--dir] [--port N] [--max-restarts N] - add an agent
config config <name> --provider/--model/--role/--system-prompt/--mode/--tools-deny/--tool-permission - write only those keys into <dir>/.polyglav/config.json
down Stop the supervised agents and the daemon if running
init Scan immediate subdirectories holding .polyglav/config.json into the manifest
logs logs <name> [n] [--follow] - tail an agent's .polyglav/logs/<name>.log
remove remove <name> - remove an agent (stops it if running)
restart restart [name|all] - stop, reset restart backoff, relaunch (default: all)
status Live table: agent, enabled, port, pid, state, restarts, last error
up up [--detach] - start agents. Ctrl-C = graceful down, --detach = background daemon

--path may be given before the subcommand (polyglav --path X fleet status) or after it (polyglav fleet --path X status).

polyglav plugins

Manage plugins headlessly. See plugins.md.

Subcommand Description
disable polyglav plugins disable <name> - remove a plugin from the plugins list (applies on next start)
enable polyglav plugins enable <name> - add a plugin to the plugins list (applies on next start)
install polyglav plugins install <git-url\|path> [--global] [--deps] - install a plugin
list List installed plugins and their load status
uninstall polyglav plugins uninstall <name> - remove a plugin
update polyglav plugins update <name> - re-fetch from the recorded source

--path may be given before the subcommand (polyglav --path X plugins list) or after it (polyglav plugins --path X list).