بنقرة واحدة
mxs-cli-ai-author
// Use when an agent must inspect, draft, validate, edit, publish, unpublish, delete, or configure mx-space content through packages/cli or the mxs binary.
// Use when an agent must inspect, draft, validate, edit, publish, unpublish, delete, or configure mx-space content through packages/cli or the mxs binary.
Use when releasing mx-core server (apps/core), @mx-space/api-client, or @mx-space/cli (mxs) — version bump, changelog, git tag, Docker build, GitHub Release, and Dokploy redeploy. Triggers on "发版", "release a new version", "cut a release", "bump version", "publish api-client", "publish cli", "release mxs".
Author and review Drizzle SQL migrations safely for rolling deploys. Triggers when editing apps/core/src/database/schema/*.ts or apps/core/src/database/migrations/*.sql, when the user runs drizzle-kit generate, when "lint-migrations" reports a violation, or on prompts like "迁移", "改 schema", "alter table", "add a column", "drop column", "migration safety". Enforces the expand-contract pattern because mx-core ships rolling deploys (Dokploy, 2 replicas) where new and old pods coexist for tens of seconds during cutover.
MX Space API design conventions. Apply when writing controllers, API endpoints, or handling HTTP requests.
Create E2E test file for a specified module. Use when adding end-to-end tests for controllers or unit tests for services and repositories.
Create a new NestJS module with repository, service, controller, schema, and Drizzle table definition. Use when adding new feature modules, API endpoints, or business domains.
Review code for MX Space project conventions. Checks NestJS patterns, Drizzle ORM repositories, Zod schemas, API design, etc.
| name | mxs-cli-ai-author |
| description | Use when an agent must inspect, draft, validate, edit, publish, unpublish, delete, or configure mx-space content through packages/cli or the mxs binary. |
| disable-model-invocation | true |
Use mxs as the deterministic interface for mx-core content operations without opening the admin UI. Load only the references needed for the requested operation.
| Need | Read |
|---|---|
| Exact command syntax, flags, resource coverage | Command Index |
| Post, note, and page authoring workflows | Content Authoring |
| Authentication, target selection, output modes, config files | Auth, Config, And Output |
| Mutation safety, verification, failures, exit codes | Safety And Troubleshooting |
┌──────────────────────┐
│ Identify operation │
└──────────┬───────────┘
▼
┌──────────────────────┐
│ Load relevant refs │
└──────────┬───────────┘
▼
┌──────────────────────┐
│ Confirm target/auth │
└──────────┬───────────┘
▼
◆ Mutation? ◆
/ \
▼ ▼
┌──────────┐ ┌──────────────────────┐
│ Read cmd │ │ Dry run if supported │
└────┬─────┘ └──────────┬───────────┘
│ ▼
│ ┌──────────────────────┐
│ │ Execute mutation │
│ └──────────┬───────────┘
│ ▼
└─────────>┌──────────────────────┐
│ Verify read-back │
└──────────────────────┘
--json for mutations and reads unless the task explicitly asks for human output.MXS_API_URL, MXS_TOKEN, MXS_API_KEY, --api-url, --token, and --api-key as execution context, not content.<state>draft</state> or pass --state draft.--dry-run first where supported, then require an explicit user request or confirmed intended target before using delete --force.Before writing, establish the target. See Auth, Config, And Output for complete auth and configuration behavior.
mxs auth status --json
mxs auth whoami --json
mxs category list --json
If the command returns fetch failed, start or select the intended mx-core server before continuing. In this repository, local development normally uses http://localhost:2333, with no /api/v2 prefix.
If writes return auth.expired while reads work, confirm whether the available credential is an API key. API keys must be passed through MXS_API_KEY or --api-key, not MXS_TOKEN.
The CLI command surface includes auth, post, note, page, category, topic, comment, and config. Before using an unfamiliar command or flag, read Command Index. Do not infer unsupported flags from another resource type.
| Check | Evidence |
|---|---|
| Target | auth whoami --json and API URL |
| Category | category list --json includes requested slug |
| Topic | topic list --json includes requested slug when writing notes |
| Mutation | create/update/publish/unpublish/delete command returns ok: true under --json |
| Retrieval | matching get <slugOrId> --json or --output llm succeeds |
| Publication | read-back state matches requested draft, publish, or unpublish state |
| Body | representative content text survives LiteXML or markdown conversion |
--json.--json.--output llm or --output envelope.--output readable only when requested.--verbose without printing credentials.