CLI Reference

puq [command] [flags] [messages...]

If the first argument is not a known command, puq starts a session and uses the arguments as the first message. For example, puq "fix the build" starts a session with that prompt, while puq models runs the models command.

  • puq --help lists commands and common flags.
  • puq <command> --help shows the flags of a single command.

Starting a session

puq                                     # interactive session
puq "List all .ts files in src/"        # with an initial prompt
puq @prompt.md @image.png "Describe"    # attach files/images with @
puq -p "List all .ts files in src/"     # non-interactive: print and exit
puq --continue "What did we discuss?"   # continue the previous session
  • @<path> attaches a file or image to the first message.
  • Piped input (stdin) is read automatically as the prompt.
  • -- ends flag parsing; everything after it is treated as message text.

Common flags

Session and workspace

FlagDescription
--cwd <dir>Directory to start in
--add-dir <dir>Add another workspace directory (repeatable)
--profile <name>Use an isolated profile (separate auth, sessions, settings)
--config <file>Load an extra config.yml-style file for this run (repeatable)
--no-sessionDon’t save the session
--session-dir <dir>Directory for session storage and lookup
--allow-homeAllow starting in ~ instead of switching to a temporary folder
-c, --continueContinue the previous session
-r, --resume [id]Resume a session by ID, or open the session picker
--from-claude / --from-codexImport a Claude Code or Codex session
--export <file>Export a session file to HTML and exit

Models and thinking

FlagDescription
--model <id>Model to use, e.g. puq/claude-sonnet-5. Fuzzy matching works: sonnet, gpt-5.4, puq/openai/gpt-5.4
--smol <id>Fast model for lightweight tasks
--slow <id>Reasoning model for thorough analysis
--plan <id>Model for planning
--models <a,b,c>Models available for Ctrl+P cycling
--api-key <key>API key for the selected provider for this run (not saved; requires explicit model selection)
--thinking <level>off, minimal, low, medium, high, xhigh, max, or auto
--hide-thinkingHide thinking blocks in the UI (display only; the model still thinks)

Tools and approvals

FlagDescription
--tools <a,b,c>Enable only these tools
--no-toolsDisable all built-in tools
--no-ptyRun bash commands without an interactive terminal (PTY)
--no-lspDisable language-server features
--approval-mode <mode>always-ask, write, auto, or yolo (see Configuration)
--auto-approveUse yolo approval mode (explicit policies can still prompt or deny; see Configuration)
--max-time <duration>Stop after a duration (600, 10m, 1h)

Extensions, skills, and prompts

FlagDescription
-e, --extension <path>Load an extension (repeatable)
--hook <path>Load a hook file (repeatable)
--no-extensionsDisable extension discovery
--skills <globs>Only load matching skills (e.g. git-*,docker)
--no-skillsDisable skills
--no-rulesDisable rules
--system-prompt <text\|file>Replace the system prompt
--append-system-prompt <text\|file>Append text to the system prompt

-p / --print runs a single prompt, writes the answer to stdout, and exits. Use it for scripts and CI.

# Plain text answer
puq -p "Summarize the changes in the last commit"

# Structured JSON events
puq -p --mode json "List every TODO in src/" > todos.json

# Read the prompt from stdin
echo "review this diff" | puq -p

Useful options in print mode:

FlagDescription
--mode jsonEmit structured JSON events instead of text
--print-thoughtsInclude thinking blocks in the output
--no-titleSkip session title generation
--output-schema <json\|@file>Require the final answer to be JSON matching a JSON Schema

Example with an output schema:

puq -p --output-schema '{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}' \
  "Do the tests in test/ pass?"

If the answer never matches the schema, puq exits with code 1.

Output modes

ModeDescription
textDefault. TUI when interactive, plain text with -p
jsonJSON event stream
rpcJSON-RPC server over stdio
rpc-uiRPC with extension UI events
acpACP (Agent Client Protocol) server, same as puq acp

Commands

CommandPurpose
loginLog in with your puq API key (puq login puq)
modelsList, search, and refresh available models
configRead and change settings (list, get, set, reset, path, init-xdg)
updateInstall the newest release (-l also updates plugins)
setupOnboarding and optional dependencies (python, speech)
commitGenerate a commit message and update changelogs
gitFull-screen git UI with diff viewer and commit composer
findSemantic code search: describe a behavior, get matching files and lines
worktree, wtManage git worktrees
shareShare a saved session through an encrypted link
joinJoin a shared collaborative session
plugin, installInstall and manage plugins/extensions
agentsManage bundled task agents
acpRun puq as an ACP (Agent Client Protocol) server
github installAdd a GitHub Actions workflow so collaborators can comment /puq <request> on issues and PRs
usageShow provider usage limits
statsUsage statistics dashboard
sshManage SSH host configurations
completionsPrint a shell completion script (bash, zsh, fish)
gcReport stored data that can be cleaned up; add --apply to delete it

This table lists the most common commands. Run puq --help for the full list and puq <command> --help for the options of each command.