Directus CLI
$ d6s Official Med RiskDirectus 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.
npm install -g @directus/cli 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
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 --json, --no-interactive, CI detection, and declarative --from/--to profiles for automated sync.
--jsonemits structured sync reports on stdout--no-interactiveprevents prompts on ambiguous state
d6s sync diff provides a clean preview before sync push, though sync push can delete fields or permissions on target instances.
- Dedicated
sync diffstep before applying mutations withsync push
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
Focused specifically on Directus environment sync (pull, diff, push) rather than general data CRUD.
- Declaratively syncs schema, roles, policies, flows, and dashboards
Official Directus CLI repository (directus/cli) licensed under MIT.
- First-party Directus package under MIT license
Documented under Directus Environment Sync guides with CI/CD pipeline examples.
- Official Directus Environment Sync docs
Security, Auth & Guardrails
Reads Directus instance URLs and static admin tokens from directus.config.json profiles or environment variables referenced in config.
MIT open-source CLI; Directus Cloud and enterprise self-hosting are governed by Directus platform licensing.
# 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
d6s sync pull --from staging --json --no-interactive
Exports schema, roles, and flows from the staging profile into local Git-tracked JSON files.
d6s sync diff --to staging --json --no-interactive
Computes pending schema and configuration changes without mutating the target instance.
Controlled Writes & Previews
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 --jsonlets agents verify exact schema/flow deltas before pushing. - +
--no-interactiveanddirectus.config.jsonprofiles 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 pushmodifies system collections.