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 deploy

Deploy 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 configure

Configure the CLI with an API token.

hatch login

Authenticate via browser OAuth.

hatch logout

Log out and clear local credentials.

hatch auth status

Show current authentication status.

hatch auth keys

List your API keys.

Egg management

hatch apps

List 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-secrets

List 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 list

List custom domains and their verification status.

hatch domain remove <domain>

Remove a custom domain.

Other

hatch mcp

Start the MCP tool server for AI assistants.

hatch version

Print the CLI version.

Hatch mascot