Skip to content

CLI Reference

Commands and flags for running and configuring Polytoken from a shell.

Polytoken CLI.

ArgumentTypeDescription
--config-dirCONFIGConfig directory for this invocation.
--working-dirWORKING_DIRWorking directory for this invocation.

Validate and manage Polytoken configuration.

Open the interactive configuration shell.

Edit a Polytoken configuration file, then validate it.

ArgumentTypeDescription
--userflagEdit the user/global config layer instead of the current project layer.
--formatyaml, toml, json5Format to use when creating a missing config file. Default: yaml.

Validate Polytoken configuration files.

ArgumentTypeDescription
--userflagValidate only the user/global config layer.
--projectflagValidate only the current project’s config layer.

Manage provider authentication state.

Manage authentication for a configured MCP server.

Log in to a configured MCP server with OAuth.

ArgumentTypeDescription
--serverSERVERConfigured MCP server name. Required.
--forceflagOverwrite existing OAuth state without prompting.
--no-openflagPrint the authorization URL without trying to open it in a browser.

Show whether a configured MCP server has stored OAuth state.

ArgumentTypeDescription
--serverSERVERConfigured MCP server name. Required.

Remove stored OAuth state for a configured MCP server.

ArgumentTypeDescription
--serverSERVERConfigured MCP server name. Required.
--yesflagConfirm logout without prompting.

Manage authentication for a configured provider.

Log in to a configured provider with its interactive auth flow.

ArgumentTypeDescription
--providerPROVIDERConfigured provider name. Required.
--forceflagOverwrite existing valid auth state without prompting.

Show whether a configured provider has stored auth state.

ArgumentTypeDescription
--providerPROVIDERConfigured provider name. Required.

Refresh stored auth state for a configured provider.

ArgumentTypeDescription
--providerPROVIDERConfigured provider name. Required.

Remove stored auth state for a configured provider.

ArgumentTypeDescription
--providerPROVIDERConfigured provider name. Required.
--yesflagConfirm logout without prompting.

Print the daemon’s OpenAPI specification to stdout.

ArgumentTypeDescription
--formatjson, json-pretty, yamlOutput format. Default: json-pretty.

Print the JSON Schema for the DaemonEvent wire envelope to stdout.

ArgumentTypeDescription
--formatjson, json-pretty, yamlOutput format. Default: json-pretty.

Print structured CLI command metadata to stdout.

ArgumentTypeDescription
--formatjson, json-pretty, yamlOutput format. Default: json-pretty. Alias: --formats.

Print structured tool documentation metadata to stdout.

ArgumentTypeDescription
--formatjson, json-pretty, yamlOutput format. Default: json-pretty. Alias: --formats.

Print structured slash-command documentation metadata to stdout.

ArgumentTypeDescription
--formatjson, json-pretty, yamlOutput format. Default: json-pretty. Alias: --formats.

Print structured TUI keyboard command-action metadata to stdout.

ArgumentTypeDescription
--formatjson, json-pretty, yamlOutput format. Default: json-pretty. Alias: --formats.

Print authored JSON Schemas to stdout.

ArgumentTypeDescription
<SCHEMA>app-config, agents-frontmatter, facet-frontmatter, subagent-frontmatter, skill-frontmatter, permissions-configRequired.
--outputjson, json-pretty, yamlDefault: json-pretty.

Run the daemon in the foreground (not forked).

ArgumentTypeDescription
--listenLISTENDefault: 127.0.0.1:0.
--sessions-dirSESSIONS_DIR
--log-dirLOG_DIR
--project-dirPROJECT_PATHRequired.
--session-idSESSION_ID
--parent-session-idPARENT_SESSION_ID
--listener-fdLISTENER_FD
--global-config-dirGLOBAL_CONFIGGlobal config directory.
--project-config-dirPROJECT_CONFIGProject-level config directory.
--todo-dirTODO_DIROverride where todo records are read from and written to.
--resumeflagResume an existing session from saved history. Requires --session-id.
--credential-fileCREDENTIAL_FILEPath to the daemon credential file. The CLI generates a credential file at startup and passes this path to the daemon. Required.

Run a single non-interactive prompt and print the final result.

ArgumentTypeDescription
<PROMPT>PROMPTPrompt text. If stdin is piped, stdin content is appended.
--modelMODELOverride the configured default model for this invocation.
--facetFACETOverride the exec facet for this invocation.
--max-tool-turnsMAX_TOOL_TURNSOverride the maximum number of tool turns for this invocation.
--output-schemaOUTPUT_SCHEMAJSON Schema file that the assistant must capture before exit.
--todo-dirTODO_DIROverride where todo records are read from and written to.
--print-session-logsflagMirror session id, JSONL session events, and exec trace logs to stderr.

List configured models and selectable reasoning variants.

ArgumentTypeDescription
--formathuman, json, json-pretty, yamlOutput format. Default: human.

Spawn a new daemon session and attach the TUI.

ArgumentTypeDescription
--sessions-dirSESSIONS_DIROverride the sessions registry directory. Useful for tests and for supervisors that want a non-XDG location.
--log-dirLOG_DIROverride the log directory.
--no-attachflagSpawn the daemon and print its session id and port without attaching.
--promptPROMPTImmediately submit this text as the session’s first prompt. With the TUI (default), the prompt is submitted after the TUI attaches. With —no-attach, the prompt is submitted via HTTP after the daemon is healthy so the agent starts working in the background.

Attach the TUI to a live session.

ArgumentTypeDescription
<SESSION_ID>SESSION_IDRequired.
--sessions-dirSESSIONS_DIROverride the sessions registry directory. Useful for tests and for supervisors that want a non-XDG location.

List live sessions (stale-cleans any dead entries as a side effect).

ArgumentTypeDescription
--sessions-dirSESSIONS_DIROverride the sessions registry directory.
--formathuman, json, json-pretty, yamlOutput format. Default: human.

Resume a previous session from history.

ArgumentTypeDescription
<SESSION_ID>SESSION_IDSession ID to resume directly, skipping the picker.
--sessions-dirSESSIONS_DIR
--log-dirLOG_DIR

Run startup-readiness checks and report a checklist.

ArgumentTypeDescription
--formathuman, json, json-pretty, yamlOutput format. Default: human.

Inspect shipped polytoken:// resources (ls and cat).

List VFS schemes or entries in a polytoken:// directory.

ArgumentTypeDescription
<URI>URIOptional polytoken:// URI to list. Omit to list available VFS schemes.

Print the exact contents of a polytoken:// file to stdout.

ArgumentTypeDescription
<URI>URIThe polytoken:// URI to read. Required.

Validate a skill, facet, or subagent definition file.

Validate a skill definition file by name or path.

ArgumentTypeDescription
<TARGET>TARGETSkill/subagent/facet name (resolved via standard discovery) or path to a markdown file. Required.

Validate a subagent definition file by name or path.

ArgumentTypeDescription
<TARGET>TARGETSkill/subagent/facet name (resolved via standard discovery) or path to a markdown file. Required.

Validate a facet definition file by name or path.

ArgumentTypeDescription
<TARGET>TARGETSkill/subagent/facet name (resolved via standard discovery) or path to a markdown file. Required.

Inspect discovered themes and the design token catalog.

List discovered theme files (built-in and user).

ArgumentTypeDescription
--formathuman, jsonOutput format. Default: human.

List the design token catalog with metadata and default resolved styles.

ArgumentTypeDescription
--formathuman, jsonOutput format. Default: human.

Validate theme files, reporting errors and warnings.

ArgumentTypeDescription
--allflagValidate all discovered themes instead of one file.
<PATH>PATHTheme file path or polytoken:// URI to validate. When omitted (and --all is not set), validates the built-in default.

Check for and apply Polytoken self-updates.

ArgumentTypeDescription
--channellatest, stableRelease channel to track. Defaults to the updates.channel config value, or latest if unset.
--target-versionTARGET_VERSIONInstall a specific version instead of the channel latest. Bypasses the newer-than check (allows downgrades).
--checkflagCheck for available updates without applying them.
--formathuman, jsonOutput format. human (default) prints progress messages; json emits structured JSON to stdout. Default: human.