Skip to main content

create-collection

Create a new Directus collection with optional fields Arguments: <name> [--fields <field1:type,field2:type>] [--icon <icon>].

Source facts

Repository
Agents-Store/codex-plugins
Last source activity
November 1, 2026 at 02:46
Detected SKILL.md language
English
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
create-collection
description
Create a new Directus collection with optional fields Arguments: <name> [--fields <field1:type,field2:type>] [--icon <icon>].
# Create Collection Follow the `schema-design` skill (`${CLAUDE_PLUGIN_ROOT}/skills/schema-design/SKILL.md`) for the creation order, system fields and primary key rules; read it before the first call. ## Arguments - `name` (required) — Collection name (snake_case recommended) - `--fields <field1:type,...>` — Comma-separated field definitions (e.g., `title:string,content:text,price:decimal`) - `--icon <icon>` — Material icon name (default: `box`) ## Process 1. Parse arguments 2. Call `schema` tool (no params) to check collection doesn't already exist 3. Call `collections` tool to create the collection: ```json { "action": "create", "data": [{ "collection": "<name>", "schema": {}, "meta": { "icon": "<icon>", "display_template": "{{<first_string_field>}}" } }] } ``` 4. If `--fields` provided, parse and create fields: ```json { "action": "create", "collection": "<name>", "data": [ { "field": "<name>", "type": "<type>", "meta": { "interface": "<auto-mapped>" } } ] } ``` Auto-map types to interfaces: string→input, text→input-rich-text-md, integer→input, decimal→input, boolean→boolean, datetime→datetime, json→input-code 5. Display the created collection and its fields 6. Suggest adding relations or more fields ## Example Input: `products --fields name:string,description:text,price:decimal,active:boolean --icon inventory_2`
View on GitHub