Skip to main content

Working with Routes via CLI

Manage mock API routes and responses from the command line.

Listing Routes

# List all routes in a simulation
surestage routes list --instance <instance-id>

# Filter by method
surestage routes list --instance <instance-id> --method GET

Creating Routes

# Interactive creation
surestage routes create --instance <instance-id>

# With flags
surestage routes create \
--instance <instance-id> \
--method GET \
--path "/users/:id" \
--status 200 \
--body '{"id": 1, "name": "Alice"}'

Updating Routes

# Update a route's response body
surestage routes update <route-id> \
--body @response.json

# Update from a file
surestage routes update <route-id> \
--body-file ./fixtures/user-response.json

Deleting Routes

surestage routes delete <route-id>

Bulk Operations

# Import routes from a file
surestage routes import --instance <instance-id> --file routes.json

# Export all routes
surestage routes export --instance <instance-id> > routes.json

Next Steps