Docs/ CLI/ Overview

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.

Install sh0
curl -fsSL https://get.sh0.dev | bash

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

Push deploy
sh0 init              # Optional: detect stack, create .sh0ignore
sh0 push              # Deploy to live URL

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

Watch mode
sh0 watch                     # Watch current directory
sh0 watch --debounce 3000     # 3s debounce

Respects .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:

Git deploy workflow
sh0 deploy myapi --wait
sh0 env myapi set DATABASE_URL="postgres://..."
sh0 domains myapi add api.example.com
sh0 restart myapi

4. Monitoring & Operations

Stream logs, check status, SSH into containers, manage cron jobs, and control app lifecycle -- all without leaving your terminal:

Operations
sh0 logs myapi --follow --tail 50
sh0 status
sh0 ssh myapi -- ls /app
sh0 restart myapi
sh0 open myapi          # Open in browser
sh0 cron ls

Developer Ergonomics

The CLI includes commands to streamline your daily workflow:

  • sh0 init -- Detect your stack and generate a .sh0ignore file with appropriate patterns
  • sh0 link <app> -- Connect a local directory to an existing app for future pushes
  • sh0 open [app] -- Open the app's URL in your default browser
  • sh0 config show|set|get -- View and manage CLI configuration (server URL, token)
  • sh0 restart|stop|start|delete -- Full app lifecycle control from the terminal
  • sh0 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.

ScenarioBest choice
Quick deploy from local projectsh0 push
CI/CD pipeline integrationCLI with --json output
Visual stack and resource overviewDashboard
One-click template deploysDashboard
Log streaming during debuggingsh0 logs --follow
Batch env var changesCLI scripting
Tip
Every CLI command supports --json for machine-readable output. Pipe to jq, feed into scripts, or integrate with any automation tool.