Skip to main content

Complete Command Reference

This page lists all available CLI commands with their flags and descriptions. For usage examples, see Commands Overview and Managing Simulations.

Configuration Priority

The CLI resolves configuration in this order:

  1. Environment variables: SURESTAGE_BASE_URL, SURESTAGE_TOKEN, SURESTAGE_TENANT_SLUG
  2. CLI flags: --base-url, --token, --tenant
  3. Config file: ~/.surestage/config.yaml

Global Flags

All commands support these flags:

FlagDescription
--format json|table|yamlOutput format (default: table)
--no-colorDisable colored output
--verboseEnable debug logging
--api-urlOverride API endpoint
--base-urlAPI base URL
--tokenAuthentication token
--tenantTenant slug

auth

Authentication and tenant management.

CommandDescriptionFlags
auth loginLog in to SureStage--email, --password
auth logoutLog out and clear credentials
auth statusShow current authentication status
auth refreshRefresh JWT token
auth tenantsList available tenants
auth switch-tenantSwitch to a different tenant--slug

instances

Sandbox simulation management.

CommandDescriptionFlags
instances listList all simulations--status active|stopped
instances createCreate a new simulation--name, --description, --protocol http|graphql|grpc|websocket
instances startStart a stopped simulation--id, --name
instances stopStop a running simulation--id, --name
instances resetReset simulation state to initial--id, --name
instances deleteDelete a simulation--id, --name, --force
instances urlGet simulation URL--id, --name
instances logsView simulation logs--id, --name, --follow, --tail
instances importImport simulation from file--file, --format json|yaml
instances exportExport simulation to file--id, --name, --output, --format json|yaml

routes

Route configuration for simulations.

CommandDescriptionFlags
routes listList routes in a simulation--instance-id, --method GET|POST|PUT|DELETE|PATCH
routes createCreate a new route--instance-id, --method, --path, --response-id, --status-code
routes updateUpdate an existing route--id, --method, --path, --response-id, --status-code
routes deleteDelete a route--id, --force
routes importImport routes from file--instance-id, --file, --format json|yaml
routes exportExport routes to file--instance-id, --output, --format json|yaml

responses

Response templates for routes.

CommandDescriptionFlags
responses listList available responses--instance-id
responses createCreate a response template--instance-id, --name, --body, --status-code, --headers
responses updateUpdate a response template--id, --name, --body, --status-code, --headers
responses deleteDelete a response template--id, --force

collections

Reusable route environments.

CommandDescriptionFlags
collections listList environments--published
collections createCreate an environment--name, --description, --routes
collections updateUpdate an environment--id, --name, --description, --routes
collections deleteDelete an environment--id, --force
collections publishPublish an environment--id, --visibility public|private|tenant

flows

Test flows and automation.

CommandDescriptionFlags
flows listList all flows--instance-id
flows createCreate a new flow--name, --description, --steps
flows runExecute a flow--id, --variables
flows deleteDelete a flow--id, --force

proxy

Proxy configuration for record and replay.

CommandDescriptionFlags
proxy listList proxy configs--instance-id
proxy createCreate a proxy config--instance-id, --target-url, --mode record|replay|passthrough
proxy updateUpdate a proxy config--id, --target-url, --mode
proxy deleteDelete a proxy config--id, --force

ai

AI-powered mock generation and assistance.

CommandDescriptionFlags
ai generate-routeGenerate route from description--instance-id, --prompt, --method, --path
ai generate-responseGenerate response from schema--instance-id, --schema, --format json|xml
ai suggest-routesSuggest routes for an API--instance-id, --api-name, --api-type REST|GraphQL|gRPC

audit

Audit log access.

CommandDescriptionFlags
audit listList audit events--start-date, --end-date, --resource-type, --user-id

Global resource search.

CommandDescriptionFlags
searchSearch across resources--query, --resource-type instance|route|environment|flow

mockstate

Mock state management for stateful scenarios.

CommandDescriptionFlags
mockstate getGet current state--instance-id, --key
mockstate setSet state value--instance-id, --key, --value
mockstate resetReset state to initial--instance-id

roles

Role management (admin only).

CommandDescriptionFlags
roles listList all roles

rbac

Role-based access control assignments (admin only).

CommandDescriptionFlags
rbac listList RBAC assignments--user-id, --role-id
rbac assignAssign role to user--user-id, --role-id
rbac revokeRevoke role from user--user-id, --role-id

permissions

Permission definitions (admin only).

CommandDescriptionFlags
permissions listList all permissions

users

User management (admin only).

CommandDescriptionFlags
users listList users--status active|inactive
users getGet user details--id, --email

memberships

Tenant membership management.

CommandDescriptionFlags
memberships listList tenant members
memberships inviteInvite user to tenant--email, --role
memberships removeRemove user from tenant--user-id

companies

Company (tenant) management.

CommandDescriptionFlags
companies listList companies
companies getGet company details--id, --slug
companies updateUpdate company info--id, --name, --slug

licenses

License and subscription information.

CommandDescriptionFlags
licenses listList licenses
licenses getGet license details--id

featureflags

Feature flag management.

CommandDescriptionFlags
featureflags listList feature flags--enabled
featureflags getGet flag status--key
featureflags updateUpdate flag value--key, --enabled true|false

compliance

Compliance policy management.

CommandDescriptionFlags
compliance listList compliance policies
compliance createCreate a policy--name, --type GDPR|HIPAA|SOC2, --rules
compliance updateUpdate a policy--id, --name, --rules

preferences

User preferences.

CommandDescriptionFlags
preferences getGet user preferences
preferences updateUpdate preferences--timezone, --theme light|dark, --notifications

templates

Template deployment and management.

CommandDescriptionFlags
templates listList available templates--category
templates getGet template details--id, --slug
templates deployDeploy template to simulation--template-id, --instance-id

systems

Global blueprint definitions.

CommandDescriptionFlags
systems listList global blueprints
systems getGet blueprint details--id, --name

library

Blueprint library browsing.

CommandDescriptionFlags
libraryBrowse blueprint library--category, --search

globalsystems

Global blueprint template management (admin only).

CommandDescriptionFlags
globalsystems listList global templates
globalsystems createCreate global template--name, --description, --config
globalsystems updateUpdate global template--id, --name, --description, --config
globalsystems deleteDelete global template--id, --force

tasks

Task execution and management.

CommandDescriptionFlags
tasks listList tasks--status pending|running|complete|failed
tasks getGet task details--id
tasks createCreate a new task--type, --config
tasks executeExecute a task--id

tours

Product tour progress tracking.

CommandDescriptionFlags
tours listList available tours
tours getGet tour details--id
tours progressGet tour progress--id

tui

Interactive terminal UI mode.

CommandDescriptionFlags
tuiLaunch terminal UI

version

Version information.

CommandDescriptionFlags
versionShow CLI version

config

CLI configuration management.

CommandDescriptionFlags
config initInitialize config file--path
config showShow current config

Examples

Basic Workflow

# Authenticate
surestage auth login --email you@example.com

# List tenants and switch
surestage auth tenants
surestage auth switch-tenant --slug your-tenant

# Create and start simulation
surestage instances create --name "My API" --protocol http
surestage instances start --name "My API"

# Get simulation URL
surestage instances url --name "My API"

Export and Import

# Export simulation config
surestage instances export --name "My API" --output ./my-api.json

# Import into another tenant
surestage auth switch-tenant --slug another-tenant
surestage instances import --file ./my-api.json

Working with JSON Output

# Get JSON output for scripting
surestage instances list --format json | jq '.[] | select(.status == "active")'

# Set state programmatically
surestage mockstate set --instance-id abc123 --key "user_id" --value "12345"