|
3 | 3 | - Status: Draft (awaiting approval) |
4 | 4 | - Author: Innei |
5 | 5 | - Date: 2026-05-14 |
6 | | -- Scope: v1 (content / config / maintenance / backup). v2 items are listed in roadmap only. |
| 6 | +- Scope: v1 — auth, content (post / note / page / category / topic), config. v2 (AI) and v3 (maintenance / backup / export-import) are listed in roadmap only. |
7 | 7 |
|
8 | 8 | ## 1. Goals & Non-Goals |
9 | 9 |
|
|
12 | 12 | - Ship a single-user, self-host-oriented CLI that lets the site owner — or an AI agent acting on their behalf — manage a deployed mx-core instance from anywhere. |
13 | 13 | - Authenticate via OIDC Device Authorization Grant (RFC 8628) against the mx-core server's Better Auth. |
14 | 14 | - Provide first-class authoring ergonomics centred on Lexical content, using `@haklex/rich-litexml` as the editing format so humans and AI agents both author in LiteXML XML instead of raw Lexical JSON. |
15 | | -- Cover four command domains in v1: content (post / note / page / category / topic), configuration (option), maintenance (cache / search / data-jobs / health), and backup (dump / restore / export / import). |
| 15 | +- Cover three command domains in v1: auth (device login / logout / whoami / status), content (post / note / page / category / topic), configuration (option). |
16 | 16 | - Be scriptable: every field exposed as a flag, every output renderable as `--json`, exit codes meaningful. |
17 | 17 |
|
18 | 18 | ### Non-Goals (v1) |
19 | 19 |
|
20 | | -- Multi-instance profiles (`mxs use <site>`) — single API URL only, deferred to v2. |
| 20 | +- Multi-instance profiles (`mxs use <site>`) — single API URL only, deferred to v3. |
21 | 21 | - AI commands (`mxs ai summary regen`, translation, insights) — deferred to v2 roadmap. |
22 | 22 | - Comment moderation (`mxs comment ...`) — v2. |
23 | | -- Observability (`mxs logs tail`, `mxs metrics`) — v2. |
| 23 | +- Maintenance (cache / search / data-jobs / health) — v3. |
| 24 | +- Backup (dump / restore / download) — v3. |
| 25 | +- Export / import of content as files — v3. |
| 26 | +- Observability (`mxs logs tail`, `mxs metrics`) — v3. |
24 | 27 | - Markdown → Lexical conversion. Markdown posts stay markdown; LiteXML round-trip only applies when the server's `contentFormat = lexical`. |
25 | 28 | - OS keychain integration; v1 stores credentials in `~/.config/mxs/credentials.json` (mode 0600) with env override. |
26 | 29 |
|
|
56 | 59 | │ category/{list,get,create,update,delete}.ts │ |
57 | 60 | │ topic/{list,get,create,update,delete}.ts │ |
58 | 61 | │ config/{list,get,set,edit}.ts │ |
59 | | -│ cache/{clear,stats}.ts │ |
60 | | -│ search/{reindex,status}.ts │ |
61 | | -│ job/{list,run}.ts │ |
62 | | -│ health.ts │ |
63 | | -│ backup/{create,list,download,restore}.ts │ |
64 | | -│ export.ts, import.ts │ |
65 | 62 | │ │ │ |
66 | 63 | │ core/ │ |
67 | 64 | │ api-client.ts — wraps @mx-space/api-client │ |
@@ -271,36 +268,6 @@ mxs config set <key> <value> [--type=json|string|number|bool] |
271 | 268 | mxs config edit # pull full options as YAML, $EDITOR, diff + push |
272 | 269 | ``` |
273 | 270 |
|
274 | | -### 4.6 Maintenance |
275 | | - |
276 | | -``` |
277 | | -mxs cache clear [--scope=all|view|post|note|page|aggregate] |
278 | | -mxs cache stats |
279 | | -mxs search reindex # full rebuild |
280 | | -mxs search status |
281 | | -mxs job list # list data-jobs (apps/core maintenance/jobs) |
282 | | -mxs job run <name> |
283 | | -mxs health # extended /health |
284 | | -``` |
285 | | - |
286 | | -### 4.7 Backup |
287 | | - |
288 | | -``` |
289 | | -mxs backup create [--output ./backup.tar.gz] |
290 | | -mxs backup list |
291 | | -mxs backup download <id> [--output <path>] |
292 | | -mxs backup restore <id-or-file> [--force] |
293 | | -``` |
294 | | - |
295 | | -### 4.8 Export / Import (content only) |
296 | | - |
297 | | -``` |
298 | | -mxs export <dir> [--type=post,note,page] [--format=markdown|litexml] |
299 | | -mxs import <dir> [--type=post] [--update-existing] |
300 | | -``` |
301 | | - |
302 | | -Each item exported as `<dir>/<type>/<slug>.xml` (or `.md`). Import reads filenames as slug hint; envelope `<meta>` takes precedence. |
303 | | - |
304 | 271 | ## 5. Content Conversion Flow |
305 | 272 |
|
306 | 273 | ### 5.1 Write (`create` / `edit` with `--file` or `--content`) |
@@ -685,15 +652,33 @@ Documented in `packages/cli/test/manual.md`: |
685 | 652 | - `docs/CODEMAPS/cli.md` (if codemap discipline applies): generated map of `packages/cli/src/`. |
686 | 653 | - Update `apps/core/readme.md` with new auth header rule (§10). |
687 | 654 |
|
688 | | -## 13. v2 Roadmap (declared, not built) |
| 655 | +## 13. Roadmap (declared, not built) |
689 | 656 |
|
690 | | -To be captured in `packages/cli/ROADMAP.md`: |
| 657 | +To be captured in `packages/cli/ROADMAP.md`. |
| 658 | + |
| 659 | +### v2 |
691 | 660 |
|
692 | 661 | - **AI module commands**: `mxs ai summary regen <id>`, `mxs ai translate <id> --to ja`, `mxs ai insights refresh`, `mxs ai tokens`. Depends on existing `apps/core/src/modules/ai`. |
693 | | -- **Multi-profile**: `mxs use <name>`, `~/.config/mxs/profiles.json`, profile-scoped credentials. |
694 | | -- **Observability**: `mxs logs tail`, `mxs metrics`. |
695 | 662 | - **Comment moderation**: `mxs comment list / approve / reject / delete`. |
696 | 663 | - **Markdown ↔ Lexical bridge**: contingent on haklex adding markdown → Lexical reader. |
| 664 | + |
| 665 | +### v3 |
| 666 | + |
| 667 | +- **Maintenance**: |
| 668 | + - `mxs cache clear [--scope=all|view|post|note|page|aggregate]`, `mxs cache stats` |
| 669 | + - `mxs search reindex`, `mxs search status` |
| 670 | + - `mxs job list`, `mxs job run <name>` (data-jobs from `apps/core/src/maintenance/jobs`) |
| 671 | + - `mxs health` |
| 672 | +- **Backup**: |
| 673 | + - `mxs backup create [--output <path>]` |
| 674 | + - `mxs backup list` |
| 675 | + - `mxs backup download <id> [--output <path>]` |
| 676 | + - `mxs backup restore <id-or-file> [--force]` |
| 677 | +- **Export / import (content)**: |
| 678 | + - `mxs export <dir> [--type=post,note,page] [--format=markdown|litexml]` |
| 679 | + - `mxs import <dir> [--type=post] [--update-existing]` |
| 680 | +- **Multi-profile**: `mxs use <name>`, `~/.config/mxs/profiles.json`, profile-scoped credentials. |
| 681 | +- **Observability**: `mxs logs tail`, `mxs metrics`. |
697 | 682 | - **OS keychain storage**: keytar / libsecret integration once monorepo Node version stabilises. |
698 | 683 | - **`mxs init`**: bootstrap a fresh mx-core deployment via compose. |
699 | 684 |
|
|
0 commit comments