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

Directus CLI

$ d6s Official Med Risk
Directus · Workspace & SaaS · MIT · macos / linux / windows

Directus CLI (d6s / @directus/cli) implements Directus Environment Sync for version-controlling collections, fields, roles, permissions, and flows as local JSON files. Supports d6s sync pull, d6s sync diff, d6s sync push, --from/--to profiles, --json, and --no-interactive for CI/CD.

FCRS-1.0 Score
78 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g @directus/cli
CLI vs MCP Decision CLI Preferred vs MCP

d6s writes and diffs declarative directus/ JSON sync files directly in your Git repository, making schema/flow promotion auditable via pull requests.

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 --json, --no-interactive, CI detection, and declarative --from/--to profiles for automated sync.

  • --json emits structured sync reports on stdout
  • --no-interactive prevents prompts on ambiguous state
Trust & Safety 19 / 25

d6s sync diff provides a clean preview before sync push, though sync push can delete fields or permissions on target instances.

  • Dedicated sync diff step before applying mutations with sync push
Setup & Portability 12 / 15

Cross-platform Node.js CLI via npm install -g @directus/cli or npx @directus/cli.

  • Runs on macOS, Linux, and Windows via npm and npx
Utility & Efficiency 11 / 15

Focused specifically on Directus environment sync (pull, diff, push) rather than general data CRUD.

  • Declaratively syncs schema, roles, policies, flows, and dashboards
Maintenance & Lineage 8 / 10

Official Directus CLI repository (directus/cli) licensed under MIT.

  • First-party Directus package under MIT license
Docs & Verifiability 8 / 10

Documented under Directus Environment Sync guides with CI/CD pipeline examples.

  • Official Directus Environment Sync docs

Security, Auth & Guardrails

Auth Modes
Env API Key Config File
Credential Storage

Reads Directus instance URLs and static admin tokens from directus.config.json profiles or environment variables referenced in config.

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

MIT open-source CLI; Directus Cloud and enterprise self-hosting are governed by Directus platform licensing.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Directus CLI (d6s) Agent Rules
- Always run `d6s sync diff --to <env> --json --no-interactive` before `d6s sync push`.
- Pass `--no-interactive` in automated runs so missing credentials or ambiguous diffs fail safely.
- Keep static admin tokens in env vars rather than committing secrets into `directus.config.json`.

Agent-Ready Command Recipes

Safe Read-Only Queries

Pull Directus schema and flows to local JSON
d6s sync pull --from staging --json --no-interactive

Exports schema, roles, and flows from the staging profile into local Git-tracked JSON files.

Diff local sync files against target Directus instance
d6s sync diff --to staging --json --no-interactive

Computes pending schema and configuration changes without mutating the target instance.

Controlled Writes & Previews

Push validated sync changes to staging
d6s sync push --to staging --json --no-interactive

Applies reviewed local schema and flow changes to the staging Directus environment.

Strengths for Agents

  • + d6s sync diff --json lets agents verify exact schema/flow deltas before pushing.
  • + --no-interactive and directus.config.json profiles integrate cleanly with GitOps workflows.

Caveats & Pitfalls

  • ! Scope is focused on environment sync rather than arbitrary item queries or content CRUD.
  • ! Requires admin-level tokens on target instances because sync push modifies system collections.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI