superserve run command starts an interactive session with a deployed agent.
Basic Usage
Run an agent with an initial prompt:Example Session
Interactive Mode
If you don’t provide a prompt, the CLI prompts you:exit or press Ctrl+D to quit.
Command Arguments
Agent name or ID (e.g.,
my-agent or agt_abc123def456)Initial prompt to send to the agent. If omitted, the CLI prompts you interactively
Command Options
Exit after a single response instead of starting an interactive loop
Output raw JSON events from the agent (useful for debugging or integration)
Examples
Single-Shot Mode
Get one response and exit:JSON Output
Stream raw events in JSON format:Run by Agent ID
How It Works
- Pre-flight checks - Verifies agent exists and dependencies are ready
- Create session - Starts a new isolated session for this conversation
- Stream response - Sends your prompt and streams the agent’s response in real-time
- Interactive loop - Prompts for additional messages (unless
--singleis used)
Session Lifecycle
Eachsuperserve run command creates a new session:
- Isolated workspace:
/workspacefilesystem starts empty - Persistent state: Any files created persist across messages in the same session
- Automatic cleanup: Sessions expire after 24 hours of inactivity
superserve sessions resume.
Pre-flight Validation
Before starting, the CLI checks:Agent Status
If dependencies are still installing:Required Secrets
If the agent requires secrets that aren’t set:Streaming Behavior
The CLI streams agent responses in real-time:- Text output: Prints incrementally as the agent generates it
- Tool calls: Shows which tools the agent is using
- Errors: Displays errors inline
Canceling
Press Ctrl+C to cancel the current response:Exit Commands
To end the interactive loop:- Type
exit - Press Ctrl+D
- Press Ctrl+C (cancels and exits)
JSON Event Format
When using--json, the CLI outputs Server-Sent Events as JSON:
Message Event
Status Event
Error Event
Done Event
Error Handling
Agent Not Found
Agent Execution Failed
Connection Timeout
If the connection to Superserve Cloud times out:- Check your internet connection
- Verify Superserve Cloud status at status.superserve.ai
- Try again in a few moments
Best Practices
- Use
--singlefor scripting - Prevents hanging on interactive prompts - Use
--jsonfor integration - Parse structured events in your scripts - Resume long sessions - Use
superserve sessions resumeto continue previous conversations - Check agent status first - Run
superserve agents getbefore debugging failed runs