CLI Commands
PilotDeck Agent Series
Provided by PilotDeck pilotdeck A command line tool that supports multiple running modes and subcommands.
Global Entrance
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
| command | Description | Server required |
|---|---|---|
pilotdeck "<message>" | CLI single interaction | No |
pilotdeck server | Start the Gateway resident service | — |
pilotdeck tui | Enter the interactive terminal UI | No |
pilotdeck cron list | List scheduled tasks | Yes |
pilotdeck cron create | Create a scheduled task | Yes |
pilotdeck cron delete | Delete scheduled tasks | Yes |
pilotdeck cron stop | Stop a running task | Yes |
pilotdeck (Direct Use)
Have a conversation with the Agent directly from the command line:
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
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.
pilotdeck server [--port <port>]
Parameters
| parameters | Description | Default value |
|---|---|---|
--port <port> | listening port | 18789 |
Environment Variables
| variable | Description |
|---|---|
PILOTDECK_GATEWAY_PORT | Equivalent to --port, with lower priority than command line parameters |
Output Example
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:
| module | Conditions |
|---|---|
| Gateway + SessionRouter | always loaded |
| Web UI static resources | always loaded (from ui/dist) |
| Always-On Manager | alwaysOn.enabled: true |
| Cron Runtime | cron segment exists |
| Feishu Channel | always loaded |
Signal Processing
| signal | behavior |
|---|---|
SIGINT (Ctrl+C) | Graceful shutdown: stop Always-On, Cron, destroy Gateway |
SIGTERM | Same as SIGINT |
pilotdeck tui
Enter the interactive terminal UI (based on Ink/React).
pilotdeck tui
Request
- Must be run in an interactive terminal (TTY)
- Non-TTY environments will report an error and exit.
Behavior
- Load project configuration
- Try to create a local Gateway
- If local Gateway creation fails, try to connect to an already running Server
- Start the TUI rendering loop
Connection Logic
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.
pilotdeck cron list [--history] [--limit <n>]
| parameters | Description |
|---|---|
--history | Contains historical execution records |
--limit <n> | Limit the number of items returned |
pilotdeck cron create
Create a new scheduled task.
pilotdeck cron create \
--session <sessionKey> \
--message <text> \
[--once <iso-datetime> | --cron <expression>] \
[--channel <channelKey>] \
[--project <projectKey>] \
[--timezone <tz>]
| parameters | Required | Description |
|---|---|---|
--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 |
--once and --cron You must choose one of the two.
Example:
# 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.
pilotdeck cron delete <taskId> [--stop-running]
| parameters | Description |
|---|---|
<taskId> | Task ID (positional argument or --task specified) |
--stop-running | Also stop the executing instance |
pilotdeck cron stop
Stop a running task instance.
# Stop by taskId
pilotdeck cron stop <taskId>
# Stop by runId
pilotdeck cron stop --run <runId>
Environment Variable Reference
| variable | Description | Default value |
|---|---|---|
PILOT_HOME | PilotHome Directory | ~/.pilotdeck |
PILOT_AGENT_MODEL | Cover agent.model Configuration | — |
PILOTDECK_GATEWAY_PORT | Server listening port | 18789 |
PILOTDECK_CONFIG_PATH | Configuration file path override | — |
ANTHROPIC_API_KEY | Anthropic API Key | — |
OPENAI_API_KEY | OpenAI API Key | — |
Exit Code
| exit code | Description |
|---|---|
0 | Completed normally |
1 | Error exit (parameter error, configuration error, runtime error, etc.) |