Skip to main content

Command

sb0 query "<question>"

Description

Sends a query to your default agent hosted on the sb0 platform and streams the response.

Usage

Query your deployed agent:
sb0 query "What is the weather like today?"

Expected Output

What is the weather like today?

I don't have access to real-time weather data. To check the current weather, I recommend:

1. Using a weather website like weather.com
2. Checking your phone's weather app
3. Using a voice assistant

Is there something else I can help you with?

Quoting

Always use quotes around your question:
# Correct
sb0 query "What is 2+2?"

# Incorrect - shell will interpret spaces
sb0 query What is 2+2?

Streaming Response

The command streams the response in real-time as the agent generates it, similar to ChatGPT or Claude.ai.

Requirements

Before using sb0 query:
  1. Login - Authenticate with sb0 login
  2. Deploy agent - Push at least one agent with sb0 push
  3. Set default - The platform uses your most recently deployed agent by default

Multi-line Queries

For longer queries, use heredoc syntax:
sb0 query "$(cat <<'EOF'
Please analyze the following text and provide:
1. A summary
2. Key takeaways
3. Recommendations

Text: [Your text here]
EOF
)"

Selecting a Specific Agent

If you have multiple deployed agents, you can specify which one to query:
sb0 query "test" --agent my-agent-name
The --agent flag is coming soon. Currently, queries are sent to your default (most recently deployed) agent.

Common Issues

Not Authenticated

Error: Authentication required
Solution:
sb0 login

No Agents Deployed

Error: No default agent found
Solution: Deploy an agent first:
cd agent
sb0 build
sb0 push

Network Errors

Error: Connection failed
Possible solutions:
  • Check your internet connection
  • Verify the platform is accessible
  • Try again in a few moments

Development Workflow

Use sb0 query to verify your deployed agent works correctly:
# 1. Make changes and test locally
sb0 run --prompt "test"

# 2. Build and push updates
sb0 build
sb0 push

# 3. Test deployed version
sb0 query "test"

Comparison with Local Testing

Featuresb0 run --promptsb0 query
LocationLocal Python environmentPlatform (cloud)
SpeedInstantNetwork latency
ChangesImmediateAfter sb0 push
PurposeDevelopment/testingProduction verification
Use sb0 run --prompt for rapid iteration during development. Use sb0 query to verify your deployed agent works in production.

Next Steps