Skip to main content
Back

CLI Commands

PilotDeck Agent Series

Provided by PilotDeck pilotdeck A command line tool that supports multiple running modes and subcommands.

Global Entrance​

Bash
pilotdeck [command] [options]

If no subcommand is specified, the default entry is CLI Channel mode, sending parameters directly to the Agent as user input.

Command Overview​

commandDescriptionServer required
pilotdeck "<message>"CLI single interactionNo
pilotdeck serverStart the Gateway resident service—
pilotdeck tuiEnter the interactive terminal UINo
pilotdeck cron listList scheduled tasksYes
pilotdeck cron createCreate a scheduled taskYes
pilotdeck cron deleteDelete scheduled tasksYes
pilotdeck cron stopStop a running taskYes

pilotdeck (Direct Use)​

Have a conversation with the Agent directly from the command line:

Bash
pilotdeck "Help me analyze the directory structure of the current project"

Behavior description:

  • Automatically create an In-Process Gateway in the current directory
  • Create a temporary CLI Channel session
  • Exit after outputting Agent response
Tip · Tip

CLI mode is suitable for scripting and automation scenarios. If multiple rounds of interaction are required, use pilotdeck tui。


pilotdeck server​

Start the Gateway resident service to accept WebSocket and HTTP connections.

Bash
pilotdeck server [--port <port>]

Parameters​

parametersDescriptionDefault value
--port <port>listening port18789

Environment Variables​

variableDescription
PILOTDECK_GATEWAY_PORTEquivalent to --port, with lower priority than command line parameters

Output Example​

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

Modules Loaded at Startup​

In Server mode, it will be automatically initialized according to the configuration:

moduleConditions
Gateway + SessionRouteralways loaded
Web UI static resourcesalways loaded (from ui/dist)
Always-On ManageralwaysOn.enabled: true
Cron Runtimecron segment exists
Feishu Channelalways loaded

Signal Processing​

signalbehavior
SIGINT (Ctrl+C)Graceful shutdown: stop Always-On, Cron, destroy Gateway
SIGTERMSame as SIGINT

pilotdeck tui​

Enter the interactive terminal UI (based on Ink/React).

Bash
pilotdeck tui

Request​

  • Must be run in an interactive terminal (TTY)
  • Non-TTY environments will report an error and exit.

Behavior​

  1. Load project configuration
  2. Try to create a local Gateway
  3. If local Gateway creation fails, try to connect to an already running Server
  4. Start the TUI rendering loop

Connection Logic​

Plain Text
Try to create an In-Process Gateway
│
├── Success → Use local Gateway
│
└── Failed → Detect http://127.0.0.1:<port>
│
├── There is a running Server → Connect to the remote Gateway
│
└── None → Use Fallback Gateway (limited functionality)

pilotdeck cron​

Manage scheduled tasks. All cron subcommands need to be connected to a running pilotdeck server。

pilotdeck cron list​

List all scheduled tasks.

Bash
pilotdeck cron list [--history] [--limit <n>]
parametersDescription
--historyContains historical execution records
--limit <n>Limit the number of items returned

pilotdeck cron create​

Create a new scheduled task.

Bash
pilotdeck cron create \
--session <sessionKey> \
--message <text> \
[--once <iso-datetime> | --cron <expression>] \
[--channel <channelKey>] \
[--project <projectKey>] \
[--timezone <tz>]
parametersRequiredDescription
--session✅sessionKey of the target session
--message✅Message content to be executed
--once✅*ISO time for one-time execution
--cron✅*Cron expression (periodic execution)
--channel❌Channel Key, inferred from sessionKey by default
--project❌Project path, defaults to the current directory
--timezone❌time zone
Note · Note

--once and --cron You must choose one of the two.

Example:

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

# Execute once tomorrow at 3pm
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​

Delete scheduled tasks.

Bash
pilotdeck cron delete <taskId> [--stop-running]
parametersDescription
<taskId>Task ID (positional argument or --task specified)
--stop-runningAlso stop the executing instance

pilotdeck cron stop​

Stop a running task instance.

Bash
# Stop by taskId
pilotdeck cron stop <taskId>

# Stop by runId
pilotdeck cron stop --run <runId>

Environment Variable Reference​

variableDescriptionDefault value
PILOT_HOMEPilotHome Directory~/.pilotdeck
PILOT_AGENT_MODELCover agent.model Configuration—
PILOTDECK_GATEWAY_PORTServer listening port18789
PILOTDECK_CONFIG_PATHConfiguration file path override—
ANTHROPIC_API_KEYAnthropic API Key—
OPENAI_API_KEYOpenAI API Key—

Exit Code​

exit codeDescription
0Completed normally
1Error exit (parameter error, configuration error, runtime error, etc.)

Developer Showcase

View all →