Skip to content

CLI Reference

Complete reference for all Odin CLI commands and flags.

All commands inherit these flags:

FlagShortDefaultDescription
--profile-pdefaultProfile to use from ~/.odin/config
--output-otextOutput format (text or json)
--verbose-vfalseEnable verbose logging

Configure Odin locally and authenticate with the backend.

Terminal window
odin configure [flags]
FlagRequiredDescription
--backend-addressYes*Host:port of the Odin backend
--org-idYes*Organization identifier
--insecure / -INoSkip TLS host verification
--plaintext / -PNoUse plaintext gRPC (no TLS)

*Required if not set via environment variables or config file

Terminal window
# Basic configuration
odin 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 profile
odin configure --profile staging \
--backend-address staging.odin.example.com:443 \
--org-id 12345
  • ODIN_BACKEND_ADDRESS
  • ODIN_ORG_ID
  • ODIN_LOG_LEVEL

Create a new environment.

Terminal window
odin create env <name> [flags]
ArgumentRequiredDescription
nameYesEnvironment name
FlagRequiredDescription
--accountsYesComma-separated list of provider accounts
Terminal window
# Create development environment
odin create env dev --accounts aws/dev
# Create staging with multiple accounts
odin create env staging --accounts aws/dev,aws/shared
# Create production environment
odin create env production --accounts aws/prod,aws/shared-services

Delete an existing environment.

Terminal window
odin delete env <name>
ArgumentRequiredDescription
nameYesEnvironment name
Terminal window
# Delete environment
odin delete env feature-auth-v2
# Delete with verbose output
odin delete env old-staging --verbose

Deploy a service to an environment.

Terminal window
odin deploy service [flags]
FlagRequiredDescription
--envYes*Target environment
--fileYesPath to service definition JSON
--provisioningYesPath to provisioning config JSON

*Uses default environment if set via odin set env

Terminal window
# Deploy to staging
odin deploy service --env staging \
--file service.json \
--provisioning provisioning.json
# Deploy with default environment
odin set env staging
odin deploy service \
--file service.json \
--provisioning provisioning.json
# Deploy with JSON output
odin deploy service --env production \
--file service.json \
--provisioning provisioning.json \
--output json

Get detailed information about an environment.

Terminal window
odin describe env <name> [flags]
ArgumentRequiredDescription
nameYesEnvironment name
FlagRequiredDescription
--serviceNoFilter to specific service
--componentNoFilter to specific component (requires --service)
Terminal window
# Describe entire environment
odin describe env staging
# Describe specific service
odin describe env staging --service user-api
# Describe specific component
odin describe env staging --service user-api --component database
# JSON output
odin describe env production --output json

List environments.

Terminal window
odin list env [flags]
FlagRequiredDescription
--accountNoFilter by provider account
--all / -ANoInclude all environments (requires access)
Terminal window
# List your environments
odin list env
# List all environments
odin list env --all
# Filter by account
odin list env --account aws/production
# JSON output
odin list env --output json

Execute lifecycle operations on a service.

Terminal window
odin operate service [flags]
FlagRequiredDescription
--nameYesService name
--envYes*Target environment
--operationYesOperation type
--optionsNo**JSON string with operation parameters
--fileNo**Path to JSON file with operation parameters

*Uses default environment if set **Either --options or --file required

  • redeploy: Redeploy service with new configuration
  • ADD_COMPONENT: Add a new component to the service
  • REMOVE_COMPONENT: Remove a component from the service
  • scale: Scale service components
  • restart: Restart service components
Terminal window
# Redeploy service
odin operate service --name user-api \
--env staging \
--operation redeploy \
--file updated-service.json
# Add component
odin 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 component
odin operate service --name user-api \
--env staging \
--operation REMOVE_COMPONENT \
--options '{"component_name": "old-cache"}'

Execute operations on a specific component.

Terminal window
odin operate component [flags]
FlagRequiredDescription
--nameYesComponent name
--serviceYesService name
--envYes*Target environment
--operationYesOperation type
--optionsNo**JSON string with operation parameters
--fileNo**Path to JSON file with parameters

*Uses default environment if set **Either --options or --file required

  • scale: Scale replicas
  • restart: Restart component
  • update-config: Update configuration
  • rollback: Rollback to previous version
Terminal window
# Scale component
odin operate component --name api \
--service user-api \
--env production \
--operation scale \
--options '{"replicas": 10}'
# Restart component
odin operate component --name api \
--service user-api \
--env staging \
--operation restart
# Update configuration
odin operate component --name api \
--service user-api \
--env staging \
--operation update-config \
--options '{"env": {"LOG_LEVEL": "debug"}}'

Set the default environment for the active profile.

Terminal window
odin set env <name>
ArgumentRequiredDescription
nameYesEnvironment name
Terminal window
# Set default environment
odin set env staging
# Now commands use staging by default
odin status env # Shows staging environment
odin deploy service --file service.json --provisioning prov.json

Switch the active profile.

Terminal window
odin set profile <profile>
ArgumentRequiredDescription
profileYesProfile name
Terminal window
# Switch to production profile
odin set profile production
# Switch to staging profile
odin set profile staging
# Profiles must exist (created via odin configure)

Check the deployment status of an environment.

Terminal window
odin status env <env-name> [flags]
ArgumentRequiredDescription
env-nameYesEnvironment name
FlagRequiredDescription
--serviceNoFilter to specific service
Terminal window
# Check environment status
odin status env staging
# Check specific service
odin status env staging --service user-api
# JSON output
odin status env production --output json
# Verbose output
odin status env production --verbose
Environment: staging
Status: 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 │
└──────────────┴─────────┴────────────┴────────────┘

Remove a service from an environment.

Terminal window
odin undeploy service <name> [flags]
ArgumentRequiredDescription
nameYesService name
FlagRequiredDescription
--envYes*Target environment

*Uses default environment if set

Terminal window
# Undeploy from staging
odin undeploy service user-api --env staging
# Undeploy with default environment
odin set env staging
odin undeploy service user-api
# Undeploy with verbose output
odin undeploy service user-api --env dev --verbose

Print the CLI version.

Terminal window
odin version
Terminal window
odin version
# Output: Odin CLI v1.2.0

Human-readable tables and formatted text:

Terminal window
odin list env

Output:

Environments:
┌──────────┬────────────┬──────────────────────┐
│ Name │ Status │ Accounts │
├──────────┼────────────┼──────────────────────┤
│ dev │ READY │ aws/dev │
│ staging │ READY │ aws/dev,aws/shared │
│ prod │ READY │ aws/prod │
└──────────┴────────────┴──────────────────────┘

Machine-readable JSON for automation:

Terminal window
odin list env --output json

Output:

{
"environments": [
{
"name": "dev",
"status": "READY",
"accounts": ["aws/dev"]
},
{
"name": "staging",
"status": "READY",
"accounts": ["aws/dev", "aws/shared"]
}
]
}

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}"

CodeMeaning
0Success
1General error
2Configuration error
3Authentication error
4Validation error
5Backend communication error

Create shell aliases for common commands:

Terminal window
# .bashrc or .zshrc
alias od="odin"
alias ods="odin status env"
alias odd="odin deploy service"
alias odu="odin undeploy service"

Generate shell completion (if supported):

Terminal window
# Bash
odin completion bash > /etc/bash_completion.d/odin
# Zsh
odin completion zsh > /usr/local/share/zsh/site-functions/_odin

Set defaults via environment variables:

Terminal window
export ODIN_BACKEND_ADDRESS=api.odin.example.com:443
export ODIN_ORG_ID=12345
export ODIN_LOG_LEVEL=debug

Use JSON output for scripting:

#!/bin/bash
# Check if all services are deployed
STATUS=$(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 1
fi