ReferenceCLI reference
CLI reference
Every hydro command, grouped by purpose, with the flags it accepts. Run hydro help for the same list offline.
BASH
hydro helpCommands that need a configuration or a database accept the shared runtime flags below. Environment variables (see Environment variables) fill in anything you do not pass.
Runtime flags
| Flag | Meaning |
|---|---|
--config PATH | Path to config.yaml. |
--capacity-profile compact|standard|distributed | Capacity profile, see Modules and profiles. |
--address HOST:PORT | Listen address. |
--database-dialect sqlite|postgres | Database dialect override (mysql is set through config or HYDRO_DATABASE_DIALECT). |
--database-dsn DSN | Database connection string. |
Start a project
| Command | What it does |
|---|---|
hydro new DIR [--preset minimal|blog|corporate|news|tr-news|crm|erp-lite|docs|commerce|boutique|restaurant|saas] [--admin-email EMAIL [--admin-password-stdin]] | Create a new project folder: config, preset content types, SQLite database and, with --admin-email, the first admin. Refuses to overwrite an existing folder. |
hydro new --list-presets | List presets. |
hydro init [same options] | Scaffold in the current directory. |
Run and develop
| Command | What it does |
|---|---|
hydro serve [--cgi | --fastcgi --fastcgi-address 127.0.0.1:9001] [--dev] [runtime flags] | Start the server (admin, API, workers). --cgi and --fastcgi are for shared hosting; --dev enables development behaviour. |
hydro run [--address ADDR] [--app-address ADDR] [--database-dsn DSN] [--redis-url URL] [--dependencies auto|none|required] [--poll DUR] | Development runner that rebuilds and restarts on change. |
hydro dev [same options] | Alias for hydro run. |
hydro mcp [--config PATH] | Start the Model Context Protocol (MCP) stdio server (HTTP/SSE is served at /api/v1/mcp when running hydro serve). |
hydro mcp config | Print ready-to-paste MCP client configuration JSON for Claude, Cursor, and other stdio MCP hosts. |
hydro audit list / hydro audit verify | Inspect audit entries or verify the SHA-256 audit hash chain. |
hydro commerce reconcile [--provider NAME] [--hold 30m] [--stale-after 15m] [--limit N] [--json] [runtime flags] | Reconcile stale pending orders, payment callbacks, and stock reservations. |
hydro version [--json] | Print the version, optionally as JSON. |
hydro healthcheck | Probe /healthz (override the URL with HYDRO_HEALTHCHECK_URL); exit code reflects health. |
Database
| Command | What it does |
|---|---|
hydro migrate [runtime flags] | Apply pending migrations (snapshots SQLite first). |
hydro rollback [--snapshot PATH] --confirm [runtime flags] | Restore a SQLite snapshot taken by migrate. |
hydro migration create --id YYYYMMDDHHMM_name --module MODULE --out migrations | Scaffold a migration directory (contributors). |
hydro upgrade check [runtime flags] | Preview what an upgrade will change. |
hydro upgrade status [--json] | Check a signed release manifest for newer compatible versions. |
hydro upgrade apply --yes | Verify Ed25519 signature + SHA256 checksum, back up .prev, and atomically swap the binary. |
hydro upgrade rollback --yes | Restore the .prev binary created by apply. |
hydro schema diff --baseline RELEASE.json --current RELEASE.json --public-key KEY | Compare signed release migration ledgers. |
hydro db diff [runtime flags] | Compare the database with the expected schema. |
hydro db reindex [runtime flags] | Rebuild database indexes. |
Content and users
| Command | What it does |
|---|---|
hydro content-type new ID [--dir content-types] | Write a content type skeleton. |
hydro content-type validate [--dir content-types] | Validate every content type file. |
hydro create-admin --email EMAIL --password-stdin [runtime flags] | Create an admin user; the password is read from stdin. |
hydro seed --count=20 --locale=tr|en --clean --confirm-demo [--force-prod] [runtime flags] | Fill a database with demo content. Guarded: refuses production unless forced. |
hydro clean --demo [--target demo|staging|production] [--force-prod] [runtime flags] | Remove demo content. |
hydro sdk generate [--openapi PATH] [--out DIR] [--lang all|typescript|dart] | Generate a typed client from an OpenAPI document. |
Operations
| Command | What it does |
|---|---|
hydro doctor [--json] [--fix] [runtime flags] | Check the installation; --fix applies safe fixes. |
hydro validate [--json] [runtime flags] | Validate configuration and database access. |
hydro ban IP|CIDR [--for 24h] [runtime flags] | Ban an address or range, optionally for a duration. |
hydro unban IP|CIDR [runtime flags] | Lift a ban. |
hydro backup sqlite|postgres --destination PATH [--media-dir PATH] [runtime flags] | Create a backup. |
hydro backup prune --root PATH --keep N --dry-run|--confirm [--pinned NAME,...] | Delete old backups, keeping the newest N and any pinned names. |
hydro restore verify --snapshot PATH | Check a snapshot's integrity. |
hydro restore unpack --archive FILE.tar.gz --destination NEW_DIRECTORY --public-key HEX [--max-bytes N] | Unpack and verify a signed archive into a new directory. |
hydro restore stage --snapshot PATH --destination PATH --sessions-revoked --egress-quarantined --old-writes-blocked | Stage a restore (guard flags are mandatory). |
hydro restore postgres --snapshot PATH --destination PATH --sessions-revoked --egress-quarantined --old-writes-blocked [runtime flags] | Restore a PostgreSQL snapshot. |
hydro restore activate-media --staging PATH --active PATH --rollback PATH | Swap restored media into place, keeping the previous directory for rollback. |
hydro portable export --path PATH [--format json|ndjson] [--scope content|all] [runtime flags] | Export content (or all non-auth collections in NDJSON) across SQLite, PostgreSQL and MySQL. |
hydro portable import --path PATH [--format json|ndjson] --dry-run|--confirm [--max-bytes BYTES] [runtime flags] | Validate or apply a portable export into SQLite, PostgreSQL or MySQL. |
hydro release verify --manifest PATH --public-key PATH [--root PATH] | Verify a release manifest. |
hydro jobs dead-letter list [--limit N] [--json] [runtime flags] | List failed background jobs. |
hydro jobs dead-letter requeue --id ID --confirm [runtime flags] | Retry a failed job. |
hydro jobs dead-letter purge --older-than 720h --limit N --confirm [runtime flags] | Delete old failed jobs. |
hydro tenant validate|list [runtime flags] | Inspect tenant configuration. |
hydro tenant provision --tenant-id ID --admin-email EMAIL --admin-password-stdin [runtime flags] | Create a tenant with its first admin. |
hydro tenant backfill (--tenant-id ID|--active) [--dry-run|--confirm] [runtime flags] | Backfill tenant data. |
hydro scan-links --url https://example.test [--max-pages 500] [--concurrency 4] [--delay 100ms] | Crawl a site and report broken links. |
hydro test [--package ./...] [--timeout 5m] [--race] [--count N] | Run the Go test suite (contributors). |
hydro events catalog | List webhook event topics and payload versions. |
hydro icons --source LOGO --output DIRECTORY | Generate an icon pack from a logo. |
hydro help | Print usage. |
Common recipes
BASH
hydro validate --config config.yaml
hydro migrate --config config.yaml && hydro serve --config config.yaml
hydro test --package ./modules/news/... --timeout 2m
hydro run --address 0.0.0.0:8090Content types need no command to take effect: they are YAML files in
content-types/. hydro content-type only helps you scaffold and validate them.Failure remediation
| Symptom | Try |
|---|---|
| Config or database errors | hydro validate --config PATH, then check dialect, DSN and file permissions. |
| Migration errors | Run hydro migrate against a disposable database first. Never edit an applied migration; create a new one. |
| Test timeout or race failures | Narrow --package, raise --timeout, reproduce with go test -run TestName -count=1 ./path. |
| Dev port already in use | Pass another --address or --app-address, or stop the process that owns the port. |