Docs/ CLI/ Commands Reference

Commands Reference

All 30+ CLI commands organized by category.

Global Flags

These flags work with any command:

FlagDescription
--jsonOutput as JSON instead of formatted tables
--url <url>Override the server URL for this command
--token <token>Override the auth token for this command
--verboseEnable verbose output for debugging
--helpShow 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.

bash
sh0 login --url https://panel.example.com

sh0 whoami

Display the current authenticated user, server URL, and role.

bash
sh0 whoami

Developer 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.

bash
sh0 init
sh0 init ~/my-project

sh0 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.

bash
sh0 link my-api
sh0 link my-api --path ~/projects/api

sh0 open [app]

Open the app's primary domain in the default browser. Uses the linked app if no name is specified.

bash
sh0 open my-api
sh0 open          # Uses .sh0/link.json

sh0 config show|get|set

View and manage the CLI configuration stored in ~/.sh0/config.toml.

bash
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 value

sh0 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.

bash
sh0 watch
sh0 watch ~/my-project --debounce 3000 --name my-api

Deploy

sh0 push [path] [--name <n>] [--port <p>] [--no-check]

Deploy from a local directory. Detects stack, uploads files, builds, and deploys. See Push Deploy.

bash
sh0 push ~/my-project --name api --port 3000

sh0 deploy <app> [--wait]

Trigger a Git-based deployment for an existing app. With --wait, blocks until the deployment completes.

bash
sh0 deploy myapi --wait

sh0 check [path]

Run a Code Health Check on a local project directory. Returns a score from 0-100 with recommendations.

bash
sh0 check ~/my-project

sh0 templates list|info|deploy

Browse and deploy from 170+ templates.

bash
sh0 templates list --category database
sh0 templates deploy postgresql

sh0 compose deploy|validate <file>

Deploy or validate a Docker Compose file.

bash
sh0 compose deploy docker-compose.yml

sh0 yaml apply|validate|export

Infrastructure as Code with sh0.yaml configuration files.

bash
sh0 yaml apply sh0.yaml
sh0 yaml export --app myapi

App Management

sh0 status [app]

Show server status or detailed status for a specific app. Includes CPU, memory, uptime, and deployment info.

bash
sh0 status
sh0 status myapi

sh0 restart|stop|start <app>

Control app lifecycle.

bash
sh0 restart myapi
sh0 stop myapi
sh0 start myapi

sh0 delete <app> [--yes]

Permanently delete an app and its data. Requires confirmation unless --yes is passed.

bash
sh0 delete myapi

sh0 env <app> list|set|delete

Manage environment variables.

bash
sh0 env myapi list
sh0 env myapi set DATABASE_URL="postgres://..."
sh0 env myapi delete OLD_VAR

sh0 domains <app> list|add|remove

Manage custom domains for an app.

bash
sh0 domains myapi list
sh0 domains myapi add api.example.com

sh0 scale <app> <replicas>

Set the number of replicas for an app.

bash
sh0 scale myapi 3

Monitoring

sh0 logs <app> [--follow] [--tail <n>]

Stream build or runtime logs. --follow keeps the connection open for real-time output.

bash
sh0 logs myapi --follow --tail 100

sh0 ssh <app> [command]

Execute a command inside the app container, or start an interactive shell.

bash
sh0 ssh myapi -- ls /app
sh0 ssh myapi

sh0 cron ls|create|trigger|runs|delete

Manage cron jobs.

bash
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).

bash
sh0 hooks ls --app myapi

sh0 preview ls|delete|enable|disable

Manage preview environments for pull requests.

bash
sh0 preview ls --app myapi
sh0 preview enable --app myapi

sh0 export <format> --app <name>

Export app configuration as YAML, Docker Compose, or JSON.

bash
sh0 export yaml --app myapi

Services

sh0 db list|create|info|update|delete|start|stop|recreate

Manage database servers (PostgreSQL, MySQL, MariaDB, Redis). Aliases: database-servers, db.

bash
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.

bash
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.

bash
sh0 realtime list
sh0 realtime create --name my-ws
sh0 realtime info <id>  # Shows WebSocket URL, API key

sh0 fn list|create|info|delete|start|stop

Manage function servers (Deno) for serverless edge functions. Aliases: function-servers, fn, functions.

bash
sh0 fn list
sh0 fn create --name my-api
sh0 fn info <id>  # Shows endpoint URL, API key

sh0 mail list|create|info|delete|start|stop|dns-check|create-mailbox|create-alias

Manage mail domains, mailboxes, and email aliases.

bash
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.

bash
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.

bash
sh0 uptime list
sh0 uptime create --app myapi --url https://api.example.com
sh0 uptime incidents --app myapi

sh0 nodes list|create|info|delete|test

Register and manage remote server nodes (Bring Your Own Server).

bash
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.

bash
sh0 users list
sh0 users invite [email protected] --role viewer

sh0 projects list|create|members

Manage projects for organizing apps.

bash
sh0 projects list
sh0 projects create production

sh0 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.

bash
sh0 serve
sh0 serve --port 9000 --host 0.0.0.0
Tip
Run sh0 <command> --help for detailed usage information on any command, including all available flags and options.