Skip to main content

CLI Reference

PilotDeck provides the pilotdeck command with multiple runtime modes and subcommands.

Global Entry

pilotdeck [command] [options]

Without a subcommand, PilotDeck enters CLI Channel mode and sends the arguments as user input to the agent.

Commands

CommandDescriptionRequires Server
pilotdeck "<message>"One-shot CLI interactionNo
pilotdeck serverStart the Gateway service
pilotdeck tuiStart the interactive terminal UINo
pilotdeck cron listList scheduled tasksYes
pilotdeck cron createCreate a scheduled taskYes
pilotdeck cron deleteDelete a scheduled taskYes
pilotdeck cron stopStop a running taskYes

pilotdeck

Start a one-shot conversation from the command line:

pilotdeck "Analyze the directory structure of the current project"

Behavior:

  • Creates an in-process Gateway in the current directory
  • Creates a temporary CLI Channel session
  • Exits after printing the agent response
提示 · Tip

CLI mode is good for scripting and automation. For multi-turn interaction, use pilotdeck tui.

pilotdeck server

Start the long-running Gateway service for WebSocket and HTTP connections.

pilotdeck server [--port <port>]
OptionDescriptionDefault
--port <port>Listen port18789
Environment variableDescription
PILOTDECK_GATEWAY_PORTEquivalent to --port, lower priority than CLI args

Example output:

PilotDeck server listening: http://127.0.0.1:18789
WebSocket: ws://127.0.0.1:18789/ws
Token: /Users/me/.pilotdeck/server-token

Server mode initializes Gateway + SessionRouter, Web UI static files, Always-On Manager when enabled, Cron Runtime when configured, and Feishu Channel.

pilotdeck tui

Start the Ink/React-based interactive terminal UI:

pilotdeck tui

Requirements:

  • Must run inside an interactive TTY
  • Non-TTY environments exit with an error

Connection logic:

Try In-Process Gateway

├── success → use local Gateway

└── failure → probe http://127.0.0.1:<port>

├── server found → connect to remote Gateway

└── no server → use limited fallback Gateway

pilotdeck cron

Cron subcommands require a running pilotdeck server.

pilotdeck cron list

pilotdeck cron list [--history] [--limit <n>]
OptionDescription
--historyInclude execution history
--limit <n>Limit returned records

pilotdeck cron create

pilotdeck cron create   --session <sessionKey>   --message <text>   [--once <iso-datetime> | --cron <expression>]   [--channel <channelKey>]   [--project <projectKey>]   [--timezone <tz>]
OptionRequiredDescription
--sessionyesTarget sessionKey
--messageyesMessage to execute
--onceyes*One-time ISO datetime
--cronyes*Recurring Cron expression
--channelnoChannel key, inferred from sessionKey by default
--projectnoProject path, current directory by default
--timezonenoTime zone
备注 · Note

Choose exactly one of --once and --cron.

Examples:

# Run tests every Monday at 9 AM
pilotdeck cron create --session "cli:project=/Users/me/app:s_main" --message "Run all tests and report failures" --cron "0 9 * * 1"

# Run once tomorrow at 3 PM
pilotdeck cron create --session "cli:project=/Users/me/app:s_main" --message "Generate this week's code review report" --once "2025-06-01T15:00:00+08:00"

pilotdeck cron delete

pilotdeck cron delete <taskId> [--stop-running]

pilotdeck cron stop

pilotdeck cron stop <taskId>
pilotdeck cron stop --run <runId>

Environment Variables

VariableDescriptionDefault
PILOT_HOMEPilotHome directory~/.pilotdeck
PILOT_AGENT_MODELOverride agent.model
PILOTDECK_GATEWAY_PORTServer listen port18789
PILOTDECK_CONFIG_PATHConfig file path override
ANTHROPIC_API_KEYAnthropic API key
OPENAI_API_KEYOpenAI API key

Exit Codes

CodeDescription
0Completed successfully
1Error, such as argument error, config error, or runtime failure