Overview
The hive run command executes an exported agent with the given input.
hive run <agent_path> [options]
Arguments
Path to agent folder (containing agent.json)
Input context as JSON stringhive run exports/calculator --input '{"expression": "2 + 3"}'
Input context from JSON filehive run exports/calculator --input-file input.json
Output Options
Write results to file instead of stdouthive run exports/calculator --input '{...}' --output result.json
Only output the final result JSON (suppress execution logs)hive run exports/calculator --input '{...}' --quiet
Show detailed execution logs (steps, LLM calls, etc.)hive run exports/calculator --input '{...}' --verbose
Execution Options
LLM model to use (any LiteLLM-compatible name)hive run exports/calculator --model claude-sonnet-4-20250514 --input '{...}'
Overrides the agent’s default model.
Launch interactive terminal dashboardhive run exports/calculator --tui
Opens the TUI where you can monitor execution, see live logs, and interact with the agent.
Resume Options
Resume from a specific session IDhive run exports/calculator --resume-session session_20240315_143022
Loads the session state and continues from where it left off.
Resume from a specific checkpoint (requires —resume-session)hive run exports/calculator --resume-session session_123 --checkpoint checkpoint_5
Restores execution state from the specified checkpoint.
When execution completes, the output includes:
{
"success": true,
"steps_executed": 5,
"output": {
"result": 5,
"formatted_result": "The answer is 5"
},
"error": null,
"paused_at": null
}
Whether the agent achieved its goal
Final output data from the agent
Error message if execution failed
Node ID where execution paused (for HITL or resume)
Examples
Basic Execution
hive run exports/calculator --input '{"expression": "2 + 3"}'
Output:
Agent: Calculator
Goal: Perform calculations
Steps: 3
Input: {"expression": "2 + 3"}
============================================================
Executing agent...
============================================================
============================================================
Status: SUCCESS
Steps executed: 3
Path: input_parser → calculator → output_formatter
============================================================
--- Results ---
The answer is 5
Quiet Mode (JSON Only)
hive run exports/calculator --input '{"expression": "2 + 3"}' --quiet
Output:
{
"success": true,
"steps_executed": 3,
"output": {
"result": 5,
"formatted_result": "The answer is 5"
}
}
Verbose Mode
hive run exports/calculator --input '{"expression": "2 + 3"}' --verbose
Output:
Agent: Calculator
Goal: Perform calculations
[INFO] Executing node: input_parser
[INFO] Input: {"expression": "2 + 3"}
[INFO] LLM call: claude-haiku-4-5-20251001
[INFO] Tool call: parse_expression(expression="2 + 3")
[INFO] Output: {"parsed": {"op": "+", "left": 2, "right": 3}}
[INFO] ✓ input_parser completed (420ms, 150 tokens)
[INFO] Executing node: calculator
...
Save to File
hive run exports/calculator --input '{"expression": "2 + 3"}' --output result.json
cat result.json
Use Different Model
# Use Claude Sonnet instead of default Haiku
hive run exports/calculator \
--model claude-sonnet-4-20250514 \
--input '{"expression": "integrate x^2 from 0 to 10"}'
Interactive TUI
hive run exports/assistant --tui
Launches an interactive terminal dashboard where you can:
- Enter input naturally
- See live execution logs
- Monitor node transitions
- View conversation history
- Interact with HITL prompts
Resume from Session
# First run (pauses at HITL node)
hive run exports/workflow --input '{"task": "process data"}'
# Output: "paused_at": "approval_node", session saved as session_123
# Resume later
hive run exports/workflow --resume-session session_123 --input '{"approved": true}'
Resume from Checkpoint
# List checkpoints
hive sessions checkpoints exports/workflow session_123
# Output: checkpoint_1, checkpoint_2, checkpoint_3
# Resume from specific checkpoint
hive run exports/workflow \
--resume-session session_123 \
--checkpoint checkpoint_2
If the agent expects a user_id input but none is provided, the framework auto-injects the current user:
# No user_id in input
hive run exports/assistant --input '{"message": "Hello"}'
# Framework adds: "user_id": "your_username"
You can override this:
hive run exports/assistant --input '{"message": "Hello", "user_id": "alice"}'
Error Handling
If execution fails:
hive run exports/calculator --input '{"expression": "invalid"}'
Output:
============================================================
Status: FAILED
Steps executed: 2
Path: input_parser → calculator
============================================================
Error: Invalid expression: 'invalid'
Exit code: 1
# Create input.json
cat > input.json <<EOF
{
"lead_name": "Acme Corp",
"email": "[email protected]",
"budget": 50000
}
EOF
# Run with file input
hive run exports/lead-qualifier --input-file input.json
Piping Output
# Extract specific field
hive run exports/calculator --input '{"expression": "2 + 3"}' --quiet | jq '.output.result'
# Output: 5
# Check success
hive run exports/agent --input '{...}' --quiet | jq '.success'
# Output: true
Exit Codes
Success - Agent completed successfully
Failure - Agent failed, invalid input, or execution error