CLI
JSON Output
Use the --json flag for machine-readable CLI output.
Key CLI commands support a --json flag that outputs structured JSON instead of human-readable text. This is useful for scripting, CI pipelines, and LLM agent integrations.
Supported Commands
buildspace app list --json
{
"apps": [
{ "id": "app_123", "slug": "my-app", "name": "My App" }
],
"activeApp": { "slug": "my-app" }
}buildspace app create --name "My App" --json
{
"app": { "id": "app_123", "slug": "my-app", "name": "My App" },
"environments": [
{ "id": "env_1", "type": "dev" },
{ "id": "env_2", "type": "prod" }
],
"keys": [
{ "environment": "dev", "type": "secret", "key": "bs_secret_..." }
]
}This is the easiest way to capture the generated slug programmatically.
buildspace deploy status --json
{
"deployments": [
{
"id": "dep_abc",
"status": "success",
"trigger": "git_push",
"createdAt": "2025-01-15T10:30:00Z",
"deploymentUrl": "https://my-app.buildspace.dev",
"errorMessage": null,
"environment": "dev"
}
]
}buildspace env list --json
{
"variables": [
{ "key": "BUILDSPACE_SECRET_KEY", "value": "bs_secret_...", "isSecret": true, "source": "system" },
{ "key": "STRIPE_KEY", "value": "sk_test_...", "isSecret": true, "source": "creator" }
]
}buildspace app hosting status --json
{
"environments": [
{ "envType": "dev", "status": "active", "url": "https://my-app.buildspace.dev" },
{ "envType": "prod", "status": "disabled", "url": null }
]
}Usage with LLMs
When building agents or automations that interact with Buildspace, always use --json to get reliable, parseable output:
# Create an app and parse the result
buildspace app create --name "Agent App" --json | jq '.app.slug'
# Check deploy status programmatically
buildspace deploy status --json | jq '.deployments[0].status'
# List env vars for processing
buildspace env list --json | jq '.variables[] | select(.source == "creator")'