Commands Reference
All 30+ CLI commands organized by category.
Global Flags
These flags work with any command:
| Flag | Description |
|---|---|
| --json | Output as JSON instead of formatted tables |
| --url <url> | Override the server URL for this command |
| --token <token> | Override the auth token for this command |
| --verbose | Enable verbose output for debugging |
| --help | Show help for any command |
Authentication
sh0 login [--url <url>]
Authenticate with your sh0 server. Prompts for email and password interactively. Stores the session token in ~/.sh0/config.toml.
sh0 login --url https://panel.example.comsh0 whoami
Display the current authenticated user, server URL, and role.
sh0 whoamiDeveloper Ergonomics
sh0 init [path]
Initialize a project directory for sh0 deployments. Detects the stack (language, framework, package manager) and generates a .sh0ignore file with appropriate ignore patterns.
sh0 init
sh0 init ~/my-projectsh0 link <app> [--path <dir>]
Link the current directory (or a specified path) to an existing app on the server. Creates .sh0/link.json so that future sh0 push commands update the linked app.
sh0 link my-api
sh0 link my-api --path ~/projects/apish0 open [app]
Open the app's primary domain in the default browser. Uses the linked app if no name is specified.
sh0 open my-api
sh0 open # Uses .sh0/link.jsonsh0 config show|get|set
View and manage the CLI configuration stored in ~/.sh0/config.toml.
sh0 config show # Display current config (masked token)
sh0 config get url # Get specific value
sh0 config set url https://new-server.com # Update a valuesh0 watch [path] [--debounce <ms>] [--name <n>] [--no-check]
Watch for file changes and automatically re-push. Default debounce is 2 seconds. Runs an initial push, then re-pushes on every change. Respects .sh0ignore. Press Ctrl+C to stop.
sh0 watch
sh0 watch ~/my-project --debounce 3000 --name my-apiDeploy
sh0 push [path] [--name <n>] [--port <p>] [--no-check]
Deploy from a local directory. Detects stack, uploads files, builds, and deploys. See Push Deploy.
sh0 push ~/my-project --name api --port 3000sh0 deploy <app> [--wait]
Trigger a Git-based deployment for an existing app. With --wait, blocks until the deployment completes.
sh0 deploy myapi --waitsh0 check [path]
Run a Code Health Check on a local project directory. Returns a score from 0-100 with recommendations.
sh0 check ~/my-projectsh0 templates list|info|deploy
Browse and deploy from 170+ templates.
sh0 templates list --category database
sh0 templates deploy postgresqlsh0 compose deploy|validate <file>
Deploy or validate a Docker Compose file.
sh0 compose deploy docker-compose.ymlsh0 yaml apply|validate|export
Infrastructure as Code with sh0.yaml configuration files.
sh0 yaml apply sh0.yaml
sh0 yaml export --app myapiApp Management
sh0 status [app]
Show server status or detailed status for a specific app. Includes CPU, memory, uptime, and deployment info.
sh0 status
sh0 status myapish0 restart|stop|start <app>
Control app lifecycle.
sh0 restart myapi
sh0 stop myapi
sh0 start myapish0 delete <app> [--yes]
Permanently delete an app and its data. Requires confirmation unless --yes is passed.
sh0 delete myapish0 env <app> list|set|delete
Manage environment variables.
sh0 env myapi list
sh0 env myapi set DATABASE_URL="postgres://..."
sh0 env myapi delete OLD_VARsh0 domains <app> list|add|remove
Manage custom domains for an app.
sh0 domains myapi list
sh0 domains myapi add api.example.comsh0 scale <app> <replicas>
Set the number of replicas for an app.
sh0 scale myapi 3Monitoring
sh0 logs <app> [--follow] [--tail <n>]
Stream build or runtime logs. --follow keeps the connection open for real-time output.
sh0 logs myapi --follow --tail 100sh0 ssh <app> [command]
Execute a command inside the app container, or start an interactive shell.
sh0 ssh myapi -- ls /app
sh0 ssh myapish0 cron ls|create|trigger|runs|delete
Manage cron jobs.
sh0 cron ls
sh0 cron create --app myapi --schedule "0 * * * *" --command "npm run cleanup"
sh0 cron trigger <job-id>Infrastructure
sh0 hooks ls|create|delete
Manage deploy hooks (pre/post deployment scripts).
sh0 hooks ls --app myapish0 preview ls|delete|enable|disable
Manage preview environments for pull requests.
sh0 preview ls --app myapi
sh0 preview enable --app myapish0 export <format> --app <name>
Export app configuration as YAML, Docker Compose, or JSON.
sh0 export yaml --app myapiServices
sh0 db list|create|info|update|delete|start|stop|recreate
Manage database servers (PostgreSQL, MySQL, MariaDB, Redis). Aliases: database-servers, db.
sh0 db list
sh0 db create --name mydb --engine postgres
sh0 db connection-info <id>
sh0 db create-database <id> --name app_db
sh0 db create-user <id> --username app --password secret
sh0 db enable-postgrest <id>sh0 auth list|create|info|delete|start|stop
Manage authentication servers (Logto). Aliases: auth-servers, auth.
sh0 auth list
sh0 auth create --name my-auth --database-server <db-id>sh0 realtime list|create|info|delete|start|stop
Manage realtime servers (Centrifugo) for WebSocket communication. Aliases: realtime-servers, realtime.
sh0 realtime list
sh0 realtime create --name my-ws
sh0 realtime info <id> # Shows WebSocket URL, API keysh0 fn list|create|info|delete|start|stop
Manage function servers (Deno) for serverless edge functions. Aliases: function-servers, fn, functions.
sh0 fn list
sh0 fn create --name my-api
sh0 fn info <id> # Shows endpoint URL, API keysh0 mail list|create|info|delete|start|stop|dns-check|create-mailbox|create-alias
Manage mail domains, mailboxes, and email aliases.
sh0 mail list
sh0 mail create --domain example.com
sh0 mail dns-check <id>
sh0 mail create-mailbox <id> --email [email protected] --password secret
sh0 mail create-alias <id> --source [email protected] --destination [email protected]sh0 storage list|create|info|delete|start|stop|create-bucket|create-key|usage
Manage S3-compatible file storage instances (MinIO). Aliases: file-storage, storage.
sh0 storage list
sh0 storage create --name assets
sh0 storage create-bucket <id> --name uploads
sh0 storage create-key <id> # Returns access key + secret
sh0 storage usage <id>sh0 uptime list|create|info|delete|incidents
Manage uptime monitoring checks and view incidents.
sh0 uptime list
sh0 uptime create --app myapi --url https://api.example.com
sh0 uptime incidents --app myapish0 nodes list|create|info|delete|test
Register and manage remote server nodes (Bring Your Own Server).
sh0 nodes list
sh0 nodes create --name prod-1 --host 10.0.0.5 --ssh-user deploy --ssh-key <key-id>
sh0 nodes test <id>Admin
sh0 users list|invite|update|remove
Manage users and roles. Requires admin access.
sh0 users list
sh0 users invite [email protected] --role viewersh0 projects list|create|members
Manage projects for organizing apps.
sh0 projects list
sh0 projects create productionsh0 serve
Start the sh0 server. This is the main command for running sh0 on your server. Only one instance may hold a data directory: if another sh0 is already running there, the new one exits at once, names the running PID and touches nothing -- neither the database nor the proxy. A crashed instance leaves its lock file behind harmlessly; the next start proceeds.
sh0 serve
sh0 serve --port 9000 --host 0.0.0.0sh0 <command> --help for detailed usage information on any command, including all available flags and options.