Import: directus
import_directusCopy collections, fields, and optional flows, files, roles, and records from a Directus instance into the active Anythink project. Preview with dry_run first, then apply with approval.
Instructions
Import collections, fields, flows, and data from a Directus instance. Writes into the active project: run with --dry-run first and add --yes only once the user has approved the plan. Copies a Directus instance's collections and fields into the active project as entities and fields; flows, files, roles and records come across only with include_flows, include_files, include_roles and include_data. Call it with dry_run first and show the user the plan, because a call without dry_run applies the import straight away. Returns JSON. It changes or deletes existing data, so check with the user before running it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Target Anythink project profile (defaults to the active profile) | |
| url | No | Directus instance base URL (e.g. https://cms.example.com) | |
| token | No | Directus static or admin token. Prefer the DIRECTUS_TOKEN environment variable: a flag lands in shell history and the process list | |
| dry_run | No | Preview what would be imported without making any changes | |
| include_data | No | Also import records from each collection (schema must already match) | |
| include_files | No | Also download files from Directus and re-upload to Anythink (runs before --include-data) | |
| include_flows | No | Also import Directus flows as Anythink workflows | |
| include_roles | No | Also import Directus roles + permissions, and promote collections to is_public when the Public policy can read them | |
| allow_insecure | No | Allow a plain http:// Directus URL (localhost is always allowed) |