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

Atlas CLI

$ atlas Official Med Risk
Ariga · Database & Data · Apache-2.0 (Community) / Proprietary (Pro) · macos / linux / windows

Atlas CLI by Ariga manages database schemas declaratively in HCL or SQL across PostgreSQL, MySQL, SQLite, and more. Offers atlas schema inspect, atlas migrate diff, and atlas migrate apply --dry-run so agents can plan and verify DDL safely.

FCRS-1.0 Score
88 /100
Good
Medium Confidence
Zero-Friction Install
brew install ariga/tap/atlas
CLI vs MCP Decision CLI Preferred vs MCP

atlas computes deterministic SQL diffs, renders ER/JSON schemas, and previews migrations via --dry-run natively without needing an MCP 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 23 / 25

Supports Go template --format '{{ json . }}' output, --dry-run, non-interactive flags, and declarative atlas.hcl configs.

  • Supports --format '{{ json . }}' and migrate apply --dry-run
Trust & Safety 22 / 25

--dry-run on migrate apply and schema apply plus --dev-url sandboxing protect target databases from blind DDL.

  • Explicit --dry-run planning and isolated --dev-url diff calculation
Setup & Portability 14 / 15

Single static Go binary via Homebrew, npm wrapper, Docker, or direct curl across macOS, Linux, and Windows.

  • Static Go binary distributed via ariga/tap/atlas and @ariga/atlas
Utility & Efficiency 14 / 15

Replaces fragile hand-written SQL migration diffs with automated schema-as-code planning.

  • Declarative schema inspection, diffing, and migration execution
Maintenance & Lineage 7 / 10

Actively maintained by Ariga (ariga/atlas), though standard binary bundles proprietary Pro extensions.

  • Official ariga/atlas repo; split Community vs Pro licensing
Docs & Verifiability 8 / 10

Extensive CLI reference and database-specific guides at atlasgo.io.

  • Official CLI reference at atlasgo.io/cli-reference

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key Config File
Credential Storage

Local DB URLs passed via --url or atlas.hcl; optional Atlas Cloud token via atlas login or ATLAS_TOKEN.

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

Community features are free/Apache-2.0; advanced Pro drivers, migrate lint cloud policies, and enterprise features require paid Atlas Pro.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Atlas CLI Agent Rules
- Always run `atlas migrate apply --dry-run` before applying migrations.
- Use `atlas schema inspect` first to capture current schema state cleanly.
- NEVER run `atlas schema clean` or apply destructive `DROP` migrations without human review.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect live database schema to HCL or JSON
atlas schema inspect --url "$DB_URL" --format '{{ json . }}'

Reads current database tables, indexes, and foreign keys as structured JSON without modifying anything.

Preview pending migrations with --dry-run
atlas migrate apply --dir file://migrations --url "$DB_URL" --dry-run

Prints exact SQL statements that would execute without applying them.

Controlled Writes & Previews

Generate a versioned SQL migration diff
atlas migrate diff add_orders --dir file://migrations --to file://schema.hcl --dev-url "docker://postgres/16/dev"

Computes and writes a versioned migration file locally for review.

Strengths for Agents

  • + migrate apply --dry-run and schema apply --dry-run make DDL planning transparent for agents.
  • + schema inspect --format '{{ json . }}' outputs full normalized schema graphs as JSON.
  • + Works consistently across PostgreSQL, MySQL, MariaDB, and SQLite.

Caveats & Pitfalls

  • ! Advanced features like migrate lint and certain enterprise drivers require atlas login / Pro licensing.
  • ! atlas migrate diff needs an ephemeral --dev-url (often Docker) to normalize SQL cleanly.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI