Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Hasura CLI

$ hasura Official Med Risk
Hasura · Database & Data · Apache-2.0 · macos / linux / windows

Hasura 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.

FCRS-1.0 Score
80 /100
Good
Medium Confidence
Zero-Friction Install
brew install hasura-cli
CLI vs MCP Decision CLI Preferred vs MCP

hasura synchronizes local YAML/SQL metadata/ and migrations/ directories in Git directly with the Hasura server.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 20 / 25

Supports --skip-update-check, --output json on metadata export, and metadata diff, though migration status output is plain text.

  • Supports --skip-update-check and hasura metadata export --output json
  • Table/text output on migrate status
Trust & Safety 19 / 25

Provides metadata diff and metadata inconsistency status, while metadata clear or migrate apply --down can break live APIs if misused.

  • hasura metadata diff previews changes before apply
  • Admin secret grants full control over metadata and SQL execution
Setup & Portability 12 / 15

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
Utility & Efficiency 13 / 15

Unifies SQL migrations, GraphQL permission/relationship metadata, and seed loading in one Git-friendly workflow.

  • Manages migrations/, metadata/, and seeds/ together
Maintenance & Lineage 8 / 10

Official CLI inside hasura/graphql-engine under Apache-2.0 license.

  • Official hasura/graphql-engine repository
Docs & Verifiability 8 / 10

Detailed CLI reference per command and flag on hasura.io/docs.

  • Full subcommand reference at hasura.io/docs

Security, Auth & Guardrails

Auth Modes
Env API Key Config File
Credential Storage

Reads endpoint and admin secret from config.yaml, --admin-secret, or HASURA_GRAPHQL_ADMIN_SECRET / HASURA_GRAPHQL_ENDPOINT env vars.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

Apache-2.0 open-source CLI; free for Hasura CE and Hasura Cloud.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Check migration status without prompts
hasura migrate status --skip-update-check

Reports local vs database migration state while suppressing CLI update checks.

Check metadata consistency against database
hasura metadata inconsistency status --skip-update-check

Verifies that Hasura GraphQL metadata references valid tables, columns, and permissions.

Controlled Writes & Previews

Export live Hasura metadata as JSON
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-check ensures deterministic non-interactive execution in CI/agents.
  • + hasura metadata diff and inconsistency status catch broken GraphQL schemas before deploy.
  • + Exports declarative metadata in YAML or --output json for Git tracking.

Caveats & Pitfalls

  • ! hasura console launches a blocking local UI server—agents must never invoke it.
  • ! Requires HASURA_GRAPHQL_ADMIN_SECRET for most remote operations, elevating blast radius.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI