CLI Reference
Complete reference for all Odin CLI commands and flags.
Global Flags
Section titled “Global Flags”All commands inherit these flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--profile | -p | default | Profile to use from ~/.odin/config |
--output | -o | text | Output format (text or json) |
--verbose | -v | false | Enable verbose logging |
odin configure
Section titled “odin configure”Configure Odin locally and authenticate with the backend.
odin configure [flags]| Flag | Required | Description |
|---|---|---|
--backend-address | Yes* | Host:port of the Odin backend |
--org-id | Yes* | Organization identifier |
--insecure / -I | No | Skip TLS host verification |
--plaintext / -P | No | Use plaintext gRPC (no TLS) |
*Required if not set via environment variables or config file
Examples
Section titled “Examples”# Basic configurationodin configure --backend-address api.odin.example.com:443 --org-id 12345
# Local development (plaintext)odin configure --backend-address localhost:8080 --org-id 1 --plaintext
# Configure different profileodin configure --profile staging \ --backend-address staging.odin.example.com:443 \ --org-id 12345Environment Variables
Section titled “Environment Variables”ODIN_BACKEND_ADDRESSODIN_ORG_IDODIN_LOG_LEVEL
odin create env
Section titled “odin create env”Create a new environment.
odin create env <name> [flags]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
name | Yes | Environment name |
| Flag | Required | Description |
|---|---|---|
--accounts | Yes | Comma-separated list of provider accounts |
Examples
Section titled “Examples”# Create development environmentodin create env dev --accounts aws/dev
# Create staging with multiple accountsodin create env staging --accounts aws/dev,aws/shared
# Create production environmentodin create env production --accounts aws/prod,aws/shared-servicesodin delete env
Section titled “odin delete env”Delete an existing environment.
odin delete env <name>Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
name | Yes | Environment name |
Examples
Section titled “Examples”# Delete environmentodin delete env feature-auth-v2
# Delete with verbose outputodin delete env old-staging --verboseodin deploy service
Section titled “odin deploy service”Deploy a service to an environment.
odin deploy service [flags]| Flag | Required | Description |
|---|---|---|
--env | Yes* | Target environment |
--file | Yes | Path to service definition JSON |
--provisioning | Yes | Path to provisioning config JSON |
*Uses default environment if set via odin set env
Examples
Section titled “Examples”# Deploy to stagingodin deploy service --env staging \ --file service.json \ --provisioning provisioning.json
# Deploy with default environmentodin set env stagingodin deploy service \ --file service.json \ --provisioning provisioning.json
# Deploy with JSON outputodin deploy service --env production \ --file service.json \ --provisioning provisioning.json \ --output jsonodin describe env
Section titled “odin describe env”Get detailed information about an environment.
odin describe env <name> [flags]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
name | Yes | Environment name |
| Flag | Required | Description |
|---|---|---|
--service | No | Filter to specific service |
--component | No | Filter to specific component (requires --service) |
Examples
Section titled “Examples”# Describe entire environmentodin describe env staging
# Describe specific serviceodin describe env staging --service user-api
# Describe specific componentodin describe env staging --service user-api --component database
# JSON outputodin describe env production --output jsonodin list env
Section titled “odin list env”List environments.
odin list env [flags]| Flag | Required | Description |
|---|---|---|
--account | No | Filter by provider account |
--all / -A | No | Include all environments (requires access) |
Examples
Section titled “Examples”# List your environmentsodin list env
# List all environmentsodin list env --all
# Filter by accountodin list env --account aws/production
# JSON outputodin list env --output jsonodin operate service
Section titled “odin operate service”Execute lifecycle operations on a service.
odin operate service [flags]| Flag | Required | Description |
|---|---|---|
--name | Yes | Service name |
--env | Yes* | Target environment |
--operation | Yes | Operation type |
--options | No** | JSON string with operation parameters |
--file | No** | Path to JSON file with operation parameters |
*Uses default environment if set
**Either --options or --file required
Operations
Section titled “Operations”redeploy: Redeploy service with new configurationADD_COMPONENT: Add a new component to the serviceREMOVE_COMPONENT: Remove a component from the servicescale: Scale service componentsrestart: Restart service components
Examples
Section titled “Examples”# Redeploy serviceodin operate service --name user-api \ --env staging \ --operation redeploy \ --file updated-service.json
# Add componentodin operate service --name user-api \ --env staging \ --operation ADD_COMPONENT \ --options '{ "component_definition": { "name": "cache", "type": "redis", "version": "7.0" }, "provisioning_config": { "component_name": "cache", "deployment_type": "elasticache-redis" } }'
# Remove componentodin operate service --name user-api \ --env staging \ --operation REMOVE_COMPONENT \ --options '{"component_name": "old-cache"}'odin operate component
Section titled “odin operate component”Execute operations on a specific component.
odin operate component [flags]| Flag | Required | Description |
|---|---|---|
--name | Yes | Component name |
--service | Yes | Service name |
--env | Yes* | Target environment |
--operation | Yes | Operation type |
--options | No** | JSON string with operation parameters |
--file | No** | Path to JSON file with parameters |
*Uses default environment if set
**Either --options or --file required
Operations
Section titled “Operations”scale: Scale replicasrestart: Restart componentupdate-config: Update configurationrollback: Rollback to previous version
Examples
Section titled “Examples”# Scale componentodin operate component --name api \ --service user-api \ --env production \ --operation scale \ --options '{"replicas": 10}'
# Restart componentodin operate component --name api \ --service user-api \ --env staging \ --operation restart
# Update configurationodin operate component --name api \ --service user-api \ --env staging \ --operation update-config \ --options '{"env": {"LOG_LEVEL": "debug"}}'odin set env
Section titled “odin set env”Set the default environment for the active profile.
odin set env <name>Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
name | Yes | Environment name |
Examples
Section titled “Examples”# Set default environmentodin set env staging
# Now commands use staging by defaultodin status env # Shows staging environmentodin deploy service --file service.json --provisioning prov.jsonodin set profile
Section titled “odin set profile”Switch the active profile.
odin set profile <profile>Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
profile | Yes | Profile name |
Examples
Section titled “Examples”# Switch to production profileodin set profile production
# Switch to staging profileodin set profile staging
# Profiles must exist (created via odin configure)odin status env
Section titled “odin status env”Check the deployment status of an environment.
odin status env <env-name> [flags]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
env-name | Yes | Environment name |
| Flag | Required | Description |
|---|---|---|
--service | No | Filter to specific service |
Examples
Section titled “Examples”# Check environment statusodin status env staging
# Check specific serviceodin status env staging --service user-api
# JSON outputodin status env production --output json
# Verbose outputodin status env production --verboseOutput Example
Section titled “Output Example”Environment: stagingStatus: READY
Services:┌──────────────┬─────────┬────────────┬────────────┐│ Service │ Version │ Status │ Components │├──────────────┼─────────┼────────────┼────────────┤│ user-api │ 1.2.0 │ DEPLOYED │ 3 ││ payment-svc │ 2.0.1 │ DEPLOYED │ 2 ││ analytics │ 1.0.0 │ DEPLOYING │ 4 │└──────────────┴─────────┴────────────┴────────────┘odin undeploy service
Section titled “odin undeploy service”Remove a service from an environment.
odin undeploy service <name> [flags]Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
name | Yes | Service name |
| Flag | Required | Description |
|---|---|---|
--env | Yes* | Target environment |
*Uses default environment if set
Examples
Section titled “Examples”# Undeploy from stagingodin undeploy service user-api --env staging
# Undeploy with default environmentodin set env stagingodin undeploy service user-api
# Undeploy with verbose outputodin undeploy service user-api --env dev --verboseodin version
Section titled “odin version”Print the CLI version.
odin versionExamples
Section titled “Examples”odin version# Output: Odin CLI v1.2.0Output Formats
Section titled “Output Formats”Text Output (Default)
Section titled “Text Output (Default)”Human-readable tables and formatted text:
odin list envOutput:
Environments:┌──────────┬────────────┬──────────────────────┐│ Name │ Status │ Accounts │├──────────┼────────────┼──────────────────────┤│ dev │ READY │ aws/dev ││ staging │ READY │ aws/dev,aws/shared ││ prod │ READY │ aws/prod │└──────────┴────────────┴──────────────────────┘JSON Output
Section titled “JSON Output”Machine-readable JSON for automation:
odin list env --output jsonOutput:
{ "environments": [ { "name": "dev", "status": "READY", "accounts": ["aws/dev"] }, { "name": "staging", "status": "READY", "accounts": ["aws/dev", "aws/shared"] } ]}Configuration File
Section titled “Configuration File”Odin stores configuration in ~/.odin/config (TOML format):
[default]backend_address = "api.odin.example.com:443"org_id = "12345"default_env = "staging"token = "{YOUR_TOKEN}"
[production]backend_address = "prod.odin.example.com:443"org_id = "12345"default_env = "production"token = "{YOUR_TOKEN}"Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Configuration error |
| 3 | Authentication error |
| 4 | Validation error |
| 5 | Backend communication error |
Tips and Tricks
Section titled “Tips and Tricks”Using Aliases
Section titled “Using Aliases”Create shell aliases for common commands:
# .bashrc or .zshrcalias od="odin"alias ods="odin status env"alias odd="odin deploy service"alias odu="odin undeploy service"Auto-completion
Section titled “Auto-completion”Generate shell completion (if supported):
# Bashodin completion bash > /etc/bash_completion.d/odin
# Zshodin completion zsh > /usr/local/share/zsh/site-functions/_odinEnvironment Variables
Section titled “Environment Variables”Set defaults via environment variables:
export ODIN_BACKEND_ADDRESS=api.odin.example.com:443export ODIN_ORG_ID=12345export ODIN_LOG_LEVEL=debugAutomation Scripts
Section titled “Automation Scripts”Use JSON output for scripting:
#!/bin/bash# Check if all services are deployedSTATUS=$(odin status env production --output json)FAILED=$(echo $STATUS | jq '[.services[] | select(.status == "FAILED")] | length')
if [ $FAILED -gt 0 ]; then echo "ERROR: $FAILED services failed" exit 1fiRelated Topics
Section titled “Related Topics”- Getting Started: Installation and first deployment
- Concepts: Understanding Odin concepts
- How-To Guides: Common tasks and workflows