CLI Overview
A single binary to deploy, manage, and monitor your apps from the terminal.
What is the sh0 CLI
The sh0 CLI is a standalone binary that talks to your sh0 server over its REST API. It provides 30+ commands for everything you can do in the dashboard -- deployments, logs, scaling, environment variables, cron jobs, templates, and more.
It works from any machine: your laptop, a CI runner, or a remote server. Authenticate once with sh0 login and you're ready.
Install
One command, no dependencies. Supports Linux and macOS on both x64 and ARM64.
curl -fsSL https://get.sh0.dev | bashThe script detects your OS and architecture, downloads the correct binary from GitHub Releases, and places it in /usr/local/bin/sh0. See Installation for manual download and configuration options.
Four Core Workflows
1. Push Deploy
Deploy directly from a local directory. The CLI detects your stack, uploads files, builds a container, and returns a live URL -- all in one command.
sh0 init # Optional: detect stack, create .sh0ignore
sh0 push # Deploy to live URLFirst push creates a new app. Subsequent pushes update it. The link is stored in .sh0/link.json so the CLI knows which app to update. Use sh0 link <app> to connect a directory to an existing app. See Push Deploy for the full guide.
2. Watch Mode
For development workflows, sh0 watch monitors your project for file changes and automatically re-pushes after a configurable debounce delay (default: 2 seconds).
sh0 watch # Watch current directory
sh0 watch --debounce 3000 # 3s debounceRespects .sh0ignore patterns. Press Ctrl+C to stop.
3. Git Deploy Management
For apps connected to a Git repository, the CLI lets you trigger deploys, manage environment variables, configure domains, and control the app lifecycle:
sh0 deploy myapi --wait
sh0 env myapi set DATABASE_URL="postgres://..."
sh0 domains myapi add api.example.com
sh0 restart myapi4. Monitoring & Operations
Stream logs, check status, SSH into containers, manage cron jobs, and control app lifecycle -- all without leaving your terminal:
sh0 logs myapi --follow --tail 50
sh0 status
sh0 ssh myapi -- ls /app
sh0 restart myapi
sh0 open myapi # Open in browser
sh0 cron lsDeveloper Ergonomics
The CLI includes commands to streamline your daily workflow:
sh0 init-- Detect your stack and generate a.sh0ignorefile with appropriate patternssh0 link <app>-- Connect a local directory to an existing app for future pushessh0 open [app]-- Open the app's URL in your default browsersh0 config show|set|get-- View and manage CLI configuration (server URL, token)sh0 restart|stop|start|delete-- Full app lifecycle control from the terminalsh0 domains <app> list|add|remove-- Manage custom domains for any app
CLI vs Dashboard
The CLI and dashboard are complementary. Both use the same REST API and have full feature parity.
| Scenario | Best choice |
|---|---|
| Quick deploy from local project | sh0 push |
| CI/CD pipeline integration | CLI with --json output |
| Visual stack and resource overview | Dashboard |
| One-click template deploys | Dashboard |
| Log streaming during debugging | sh0 logs --follow |
| Batch env var changes | CLI scripting |
--json for machine-readable output. Pipe to jq, feed into scripts, or integrate with any automation tool.