CLI Reference
Complete reference for the Hatch command-line interface.
All commands auto-detect configuration from build output when flags are not provided. Use --deploy-target, --runtime, and --start-command flags to override.
Global flags: --token (API token override), --config (config file path), --verbose / -v
Deployment
hatch deployDeploy a pre-built app directory. Creates the egg if it doesn't exist.
Flags: --name, --deploy-target, --runtime, --start-command, --domain
hatch restart [slug]Restart a running egg.
hatch destroy [slug]Permanently delete an egg.
Flags: --yes to skip confirmation
Authentication
hatch configureConfigure the CLI with an API token.
hatch loginAuthenticate via browser OAuth.
hatch logoutLog out and clear local credentials.
hatch auth statusShow current authentication status.
hatch auth keysList your API keys.
Egg management
hatch appsList all your eggs.
hatch apps info [slug]Show detailed egg information.
hatch logs [slug]View egg logs.
Flags: --build for build logs, --follow / -f for streaming, --lines / -n number of lines
hatch open [slug]Open egg in your browser.
Energy
hatch energy [slug]Show energy status (account-wide or per-egg).
hatch boost [slug] [day|week]Boost an egg with extra energy.
Environment variables
hatch env set KEY=VAL [KEY=VAL...]Set environment variables.
Flags: --from-env / -f import from a .env file
hatch env unset KEY [KEY...]Remove environment variables.
hatch env --show-secretsList environment variables with full secret values visible (passwords, tokens, keys are masked by default).
Database
hatch db add [slug]Provision a PostgreSQL database for your egg. Free tier: 50 MB, 10,000 rows.
hatch db connect [slug] [-- psql-args...]Open a local TCP proxy to your egg's database and auto-launch psql.
Flags: --port / -p local port (default 15432), --host local address, --no-psql tunnel only
hatch db info [slug]Show database status and usage for your egg.
Custom domains
hatch domain add <domain>Add a custom domain to your egg. Outputs DNS records and verification token.
hatch domain verify <domain>Verify domain ownership via DNS TXT record and activate routing.
hatch domain listList custom domains and their verification status.
hatch domain remove <domain>Remove a custom domain.
Other
hatch mcpStart the MCP tool server for AI assistants.
hatch versionPrint the CLI version.
