Hasura CLI
$ hasura Official Med RiskHasura CLI (hasura) manages database migrations, declarative GraphQL metadata (hasura metadata export / apply), and seed data for Hasura GraphQL Engine. Supports --skip-update-check, --endpoint, --admin-secret, and --output json on metadata exports.
brew install hasura-cli hasura synchronizes local YAML/SQL metadata/ and migrations/ directories in Git directly with the Hasura server.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --skip-update-check, --output json on metadata export, and metadata diff, though migration status output is plain text.
- Supports
--skip-update-checkandhasura metadata export --output json - Table/text output on
migrate status
Provides metadata diff and metadata inconsistency status, while metadata clear or migrate apply --down can break live APIs if misused.
hasura metadata diffpreviews changes beforeapply- Admin secret grants full control over metadata and SQL execution
Available via brew install hasura-cli, npm install -g hasura-cli, and release binaries, though npm wrapper downloads a Go binary per platform.
- Homebrew, npm, and direct binary installs across macOS, Linux, and Windows
Unifies SQL migrations, GraphQL permission/relationship metadata, and seed loading in one Git-friendly workflow.
- Manages
migrations/,metadata/, andseeds/together
Official CLI inside hasura/graphql-engine under Apache-2.0 license.
- Official
hasura/graphql-enginerepository
Detailed CLI reference per command and flag on hasura.io/docs.
- Full subcommand reference at hasura.io/docs
Security, Auth & Guardrails
Reads endpoint and admin secret from config.yaml, --admin-secret, or HASURA_GRAPHQL_ADMIN_SECRET / HASURA_GRAPHQL_ENDPOINT env vars.
Apache-2.0 open-source CLI; free for Hasura CE and Hasura Cloud.
# Hasura CLI Agent Rules - Always pass `--skip-update-check` in headless scripts to avoid update prompts or network delays. - Run `hasura metadata diff` and `hasura migrate status` before `apply`; never run `hasura console` (blocking web server) or `metadata clear`.
Agent-Ready Command Recipes
Safe Read-Only Queries
hasura migrate status --skip-update-check
Reports local vs database migration state while suppressing CLI update checks.
hasura metadata inconsistency status --skip-update-check
Verifies that Hasura GraphQL metadata references valid tables, columns, and permissions.
Controlled Writes & Previews
hasura metadata export --output json --skip-update-check
Writes the server's current GraphQL metadata snapshot locally in JSON format.
Strengths for Agents
- +
--skip-update-checkensures deterministic non-interactive execution in CI/agents. - +
hasura metadata diffandinconsistency statuscatch broken GraphQL schemas before deploy. - + Exports declarative metadata in YAML or
--output jsonfor Git tracking.
Caveats & Pitfalls
- !
hasura consolelaunches a blocking local UI server—agents must never invoke it. - ! Requires
HASURA_GRAPHQL_ADMIN_SECRETfor most remote operations, elevating blast radius.