H
Hostess

CLI Reference

Complete reference for the Hostess command-line interface — your primary tool for deploying, managing, and monitoring applications on the Hostess platform.

Overview

The Hostess CLI is your primary interface for deploying and managing applications on the Hostess platform. It handles everything from deploying your stack with a single command, to managing secrets, viewing logs, and connecting to databases.

Terminal
hostess deploy

The CLI is designed around the philosophy of Docker Compose for Production — define your services in hostess.yml, run one command, and your entire stack is live.

Installation

Terminal
curl -fsSL https://hostess.sh/install.sh | sh

After installation, authenticate with your Hostess account:

Terminal
hostess login

Common Targeting Flags

Many project-scoped commands use the same targeting flags:

FlagShortTypeDescription
--projectVaries by commandstringProject name or slug. Deployment-scoped commands commonly provide -p; secrets commands use --project only.
--envVaries by commandstringEnvironment name (e.g., production, staging). Deployment-scoped commands commonly provide -e; deploy and domains add use --env only.

Commands that accept --token use it with highest priority, followed by HOSTESS_TOKEN, then the token saved by hostess login. Check each command reference page for its exact flags.

Authentication Resolution

For commands that accept --token, authentication is resolved in this order:

  1. --token flag — Highest priority. Use this in CI/CD pipelines.
  2. HOSTESS_TOKEN environment variable — Useful for setting a default token in your shell profile or CI environment.
  3. Saved token — From hostess login. Stored in ~/.hostess/config.json.
Terminal
# CI/CD — pass token explicitly
hostess deploy --token $HOSTESS_TOKEN

# Or set as environment variable
export HOSTESS_TOKEN="pat_abc123..."
hostess deploy

Project and Environment Resolution

When a project-scoped command needs a project, the CLI resolves it in this order:

Project name:

  1. --project / -p flag
  2. name field in hostess.yml in the current directory

Environment targeting depends on the command:

  • hostess deploy and hostess domains add use --env when provided and choose an environment automatically when omitted.
  • Deployment-scoped commands such as hostess inspect, hostess ps, hostess logs, hostess connect, and hostess backups use the latest deployment when --env is omitted. Pass --env to select the latest deployment in that environment.
  • hostess jobs run requires --env because manual job triggers target an environment directly.

Command Aliases

For faster workflow, several common subcommands have top-level aliases:

AliasFull CommandDescription
hostess lshostess deployments listList deployments
hostess listhostess deployments listList deployments
hostess inspecthostess deployments inspectInspect a deployment
hostess rmhostess deployments removeRemove a deployment
hostess deletehostess deployments removeRemove a deployment
hostess pshostess services listList services
hostess logshostess services logsStream service logs

Some grouped commands also include shorter nested aliases:

AliasFull CommandDescription
hostess dephostess deploymentsDeployment command group
hostess deployments lshostess deployments listList deployments
hostess deployments rmhostess deployments removeRemove a deployment
hostess deployments deletehostess deployments removeRemove a deployment
hostess services lshostess services listList services
hostess jobs lshostess jobs listList jobs
Terminal
# These are equivalent:
hostess deployments list
hostess ls

# These are equivalent:
hostess services logs api --follow
hostess logs api --follow

Commands

Core Commands

Account Commands

Deployment Management

Configuration & Management