Skip to content

pythinker Command

pythinker is the main command for Pythinker Code, used to start interactive sessions or execute single queries.

sh
pythinker [OPTIONS] COMMAND [ARGS]

Basic information

OptionShortDescription
--version-VShow version number and exit
--help-hShow help message and exit
--verboseOutput detailed runtime information
--debugLog debug information (output to ~/.pythinker/logs/pythinker.log)
--no-telemetryDisable all anonymous usage telemetry and error reporting (equivalent to setting PYTHINKER_DISABLE_TELEMETRY=1)

Agent configuration

OptionDescription
--agent NAMEUse built-in agent, options: default, ask, debug, okabe
--agent-file PATHUse custom agent file

--agent and --agent-file are mutually exclusive. See Agents and Subagents for details.

Configuration files

OptionDescription
--config STRINGLoad TOML/JSON configuration string
--config-file PATHLoad configuration file (default ~/.pythinker/config.toml)

--config and --config-file are mutually exclusive. Both configuration strings and files support TOML and JSON formats. See Config Files for details.

Model selection

OptionShortDescription
--model NAME-mSpecify LLM model, overrides default model in config file

Working directory

OptionShortDescription
--work-dir PATH-wSpecify working directory (default current directory)
--add-dir PATHAdd an additional directory to the workspace scope, can be specified multiple times

The working directory determines the root directory for file operations. Relative paths work within the working directory; absolute paths are required to access files outside it.

--add-dir expands the workspace scope to include directories outside the working directory, making all file tools able to access files in those directories. Added directories are persisted with the session state. You can also add directories at runtime via the /add-dir slash command.

Session management

OptionShortDescription
--continue-CContinue the previous session in the current working directory
--session [ID] / --resume [ID]-S / -rResume a session. With ID: resume that session (creates new if not found). Without ID: open interactive session picker (shell mode only)

--continue and --session/--resume are mutually exclusive.

Input and commands

OptionShortDescription
--prompt TEXT-pPass user prompt, doesn't enter interactive mode
--command TEXT-cAlias for --prompt

When using --prompt (or --command), Pythinker Code exits after processing the query (unless --print is specified, results are still displayed in interactive mode).

Loop control

OptionDescription
--max-steps-per-turn NMaximum steps per turn, overrides loop_control.max_steps_per_turn in config file
--max-retries-per-step NMaximum retries per step, overrides loop_control.max_retries_per_step in config file
--max-ralph-iterations NNumber of iterations for Ralph Loop mode; 0 disables; -1 is unlimited

Ralph Loop

Ralph is a technique that puts an agent in a loop: the same prompt is fed again and again so the agent can keep iterating one big task.

When --max-ralph-iterations is not 0, Pythinker Code enters Ralph Loop mode and automatically loops through task execution until the agent outputs <choice>STOP</choice> or the iteration limit is reached.

UI modes

OptionDescription
--printRun in print mode (non-interactive), implicitly enables --auto
--quietShortcut for --print --output-format text --final-message-only
--acpRun in ACP server mode (deprecated, use pythinker acp instead)
--wireRun in Wire server mode (experimental)

The four options are mutually exclusive, only one can be selected. Default is shell mode. See Print Mode and Wire Mode for details.

The following options are only effective in --print mode:

OptionDescription
--input-format FORMATInput format: text (default) or stream-json
--output-format FORMATOutput format: text (default) or stream-json
--final-message-onlyOnly output the final assistant message

stream-json format uses JSONL (one JSON object per line) for programmatic integration.

MCP configuration

OptionDescription
--mcp-config-file PATHLoad MCP config file, can be specified multiple times
--mcp-config JSONLoad MCP config JSON string, can be specified multiple times

Default loads ~/.pythinker/mcp.json (if exists). See Model Context Protocol for details.

Approval control

OptionShortDescription
--yolo-yDangerously skip permission approvals (user still reachable for AskUserQuestion)
--yesAlias for --yolo
--auto-approveAlias for --yolo
--no-yoloForce YOLO off for this run, overriding --yolo, config default_yolo, and any persisted/resumed YOLO state
--autoAuto mode: auto-dismiss AskUserQuestion, and auto-approve tool calls when the current trust/safe-mode policy permits (otherwise approval-required actions fail closed). Use when no user will be at the terminal

Note

In YOLO or auto mode, all file modifications and shell commands are automatically executed. Use with caution.

Plan mode

OptionDescription
--planStart a new session in plan mode

When started with --plan, the AI can only use read-only tools to explore the codebase and write an implementation plan. When resuming an existing session, --plan forces plan mode on; resuming without --plan preserves the session's existing state.

You can also set default_plan_mode = true in the config file to start new sessions in plan mode by default. See Configuration files.

Thinking mode

OptionDescription
--thinkingEnable thinking mode
--no-thinkingDisable thinking mode
--thinking-effort LEVELThinking effort level: off, minimal, low, medium, high, xhigh, or max (alias --thinking-level)

Thinking mode requires model support. If not specified, uses the last session's setting.

Skills configuration

OptionDescription
--skills-dir PATHAppend additional skills directories (repeatable)

When not specified, Pythinker Code automatically discovers user-level and project-level skills directories in priority order. See Agent Skills for details.

Subcommands

SubcommandDescription
pythinker loginLog in to your Pythinker account
pythinker logoutLog out from your Pythinker account
pythinker infoDisplay version and protocol information
pythinker acpStart multi-session ACP server
pythinker mcpManage MCP server configuration
pythinker pluginManage plugins (Beta)
pythinker termLaunch the Toad terminal UI
pythinker exportExport a session as a ZIP file
pythinker dashboardLaunch the Agent Tracing Visualizer (Technical Preview)
pythinker webStart the Web UI server

pythinker login

Log in to your Pythinker account. This automatically opens a browser; complete account authorization and available models will be automatically configured.

sh
pythinker login

pythinker logout

Log out from your Pythinker account. This clears stored OAuth credentials and removes related configuration from the config file.

sh
pythinker logout

pythinker export

Export session data as a ZIP file. The ZIP contains all files in the session directory (context.jsonl, wire.jsonl, state.json, etc.) and related diagnostic logs.

sh
pythinker export [<session_id>] [-o <output_path>] [--yes]
Argument / OptionDescription
<session_id>Session ID to export. If omitted, the CLI previews the previous session for the current working directory and asks for confirmation before exporting
--output, -oOutput ZIP file path (defaults to session-<id>.zip in the current directory)
--yes, -ySkip the confirmation prompt when exporting the default previous session
--formatTranscript format; only yaml is accepted (the transcript is always included as YAML)

Added

Added in version 1.20.

pythinker dashboard

Note

Technical Preview feature, may be unstable.

Launch the Agent Tracing Visualizer to view and analyze session traces in a browser.

sh
pythinker dashboard [OPTIONS]
OptionShortDescription
--host TEXT-HHost address to bind to (default: 127.0.0.1)
--network-nListen on all network interfaces (bind to 0.0.0.0) with auto-detected LAN IP display
--port INTEGER-pPort number to bind to (default: 5495)
--open / --no-openAutomatically open browser (default: enabled)
--reloadEnable auto-reload (development mode)

See Agent Tracing Visualizer for details.

pythinker web

Start the Web UI server to access Pythinker Code through a browser.

sh
pythinker web [OPTIONS]

If the default port is in use, the server will pick the next available port (by default 54945503) and print a notice in the terminal.

OptionShortDescription
--host TEXT-HHost address to bind to (default: 127.0.0.1)
--network-nListen on all network interfaces (bind to 0.0.0.0) with auto-detected LAN IP display
--port INTEGER-pPort number to bind to (default: 5494)
--reloadEnable auto-reload (development mode)
--open / --no-openAutomatically open browser (default: enabled)

Examples:

sh
# Default startup, automatically opens browser
pythinker web

# Specify port
pythinker web --port 8080

# Don't automatically open browser
pythinker web --no-open

# Bind to all network interfaces (allow LAN access)
pythinker web --host 0.0.0.0

See Web UI for details.