Skills2026年4月10日·1 分钟阅读

Directus — Open Source Backend & Headless CMS for Any Database

Directus wraps any SQL database with instant REST & GraphQL APIs, an admin app, auth, file storage, and automation — no migration or proprietary schema needed.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 29/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Stage only
信任
信任等级:Established
入口
step-1.md
安全暂存命令
npx -y tokrepo@latest install f431a500-349e-11f1-9bc6-00163e2b0d79 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

TL;DR
Directus wraps any SQL database with auto-generated REST/GraphQL APIs, an admin app, and workflow automation without schema migration.
§01

What it is

Directus is an open-source data platform that wraps any SQL database with instant REST and GraphQL APIs, an intuitive admin application, authentication, file storage with transforms, and workflow automation. It works with your existing database schema -- no migration, no proprietary tables, no vendor lock-in. Supported databases include PostgreSQL, MySQL, MariaDB, SQLite, MS SQL, and OracleDB. Built with Vue.js. Released under a BSL license transitioning to GPL-3.0.

Directus targets development teams that want to add a backend and admin panel to an existing database without rewriting the data layer. It is database-first rather than CMS-first.

§02

How it saves time or tokens

Directus generates APIs and admin interfaces from your existing database schema instantly. No backend code to write, no admin panel to build, no CRUD endpoints to maintain. The visual workflow builder (Flows) automates business logic without code. For AI applications, the REST and GraphQL APIs provide immediate structured data access for agents.

§03

How to use

  1. Scaffold a project with npx create-directus-project@latest my-project.
  2. Run npx directus start and access the admin app at localhost:8055.
  3. Connect an existing database or design your schema through the admin UI; APIs are generated automatically.
§04

Example

npx create-directus-project@latest my-project
cd my-project
npx directus start
# Admin app at http://localhost:8055

# Auto-generated REST API
curl http://localhost:8055/items/articles \
  -H 'Authorization: Bearer YOUR_TOKEN'
§05

Related on TokRepo

§06

Common pitfalls

  • Directus mirrors your database schema exactly; poorly designed schemas produce confusing admin interfaces. Clean up your schema before connecting Directus.
  • The Flows automation system runs within Directus; long-running workflows block the Node.js event loop and degrade API performance.
  • File storage defaults to local disk; production deployments should configure S3 or compatible object storage for reliability.

常见问题

Can Directus work with an existing database without changes?+

Yes. This is Directus's core value proposition. Point it at any supported SQL database, and it introspects the schema to generate APIs and an admin interface. Your tables, columns, and relationships remain unchanged. Directus adds its own system tables prefixed with 'directus_' but never modifies your data tables.

How does Directus compare to Strapi?+

Directus is database-first (connects to existing databases), while Strapi creates its own database schema. Directus provides instant APIs from any SQL database without migration. Strapi has a visual content-type builder and larger plugin marketplace. Directus is better for brownfield projects; Strapi is better for greenfield CMS projects.

Does Directus support real-time subscriptions?+

Yes. Directus provides real-time data subscriptions via WebSockets and GraphQL Subscriptions. Clients can subscribe to changes on any collection and receive live updates when data is created, updated, or deleted.

What is the Flows feature?+

Flows is a visual workflow builder within Directus. You create trigger-condition-action chains for automation. Triggers include data changes, schedules, and webhooks. Actions include sending emails, calling APIs, running scripts, and modifying data. It replaces simple backend logic without custom code.

Can I extend Directus with custom endpoints?+

Yes. Directus supports custom API endpoints, hooks, and modules through its extension system. Extensions are written in JavaScript/TypeScript and can add custom business logic, integrations, and admin UI panels.

引用来源 (3)
🙏

来源与感谢

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产