@mx-space/cli 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/cli",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Command line interface for mx-space (mx-core) — auth, content, configuration",
5
5
  "keywords": [
6
6
  "mx-space",
@@ -2,7 +2,7 @@
2
2
  slug: commands-auth
3
3
  title: Auth commands
4
4
  description: auth login/logout/whoami/status
5
- order: 37
5
+ order: 38
6
6
  ---
7
7
 
8
8
  # Auth commands
@@ -2,7 +2,7 @@
2
2
  slug: commands-category
3
3
  title: Category commands
4
4
  description: category list/get/create/update/delete syntax
5
- order: 34
5
+ order: 35
6
6
  ---
7
7
 
8
8
  # Category commands
@@ -2,7 +2,7 @@
2
2
  slug: commands-comment
3
3
  title: Comment commands
4
4
  description: comment list/get/approve/reject/delete + moderation safety
5
- order: 33
5
+ order: 34
6
6
  ---
7
7
 
8
8
  # Comment commands
@@ -2,7 +2,7 @@
2
2
  slug: commands-config
3
3
  title: Config commands
4
4
  description: server-side options — config list/get/set/edit
5
- order: 36
5
+ order: 37
6
6
  ---
7
7
 
8
8
  # Config commands
@@ -2,7 +2,7 @@
2
2
  slug: commands-preview
3
3
  title: Preview command
4
4
  description: render LiteXML / envelope to HTML and open it in a browser
5
- order: 39
5
+ order: 40
6
6
  ---
7
7
 
8
8
  # Preview command
@@ -2,7 +2,7 @@
2
2
  slug: commands-profile
3
3
  title: Profile commands
4
4
  description: local CLI profiles — profile ls/show/use/mark/rm
5
- order: 38
5
+ order: 39
6
6
  ---
7
7
 
8
8
  # Profile commands
@@ -0,0 +1,57 @@
1
+ ---
2
+ slug: commands-project
3
+ title: Project commands
4
+ description: project list/get/view/create/edit/update/delete syntax
5
+ order: 33
6
+ ---
7
+
8
+ # Project commands
9
+
10
+ | Command | Purpose | Principal flags |
11
+ | -------------------------------- | ------------------------------------------------------------------------------------ | --------------------------------------- |
12
+ | `mxs project list` | List portfolio projects. | `--page <n>`, `--size <n>` |
13
+ | `mxs project get <nameOrId>` | Read a project by Snowflake id or unique `name` (raw envelope). | `--json`, `--output readable\|llm` |
14
+ | `mxs project view <nameOrId>` | Render a project for terminal / LLM consumption. | `--output readable\|llm` |
15
+ | `mxs project create` | Create a project. `--name` and `--description` are required. | project write flags |
16
+ | `mxs project edit <nameOrId>` | Open `$EDITOR` against a JSON envelope of editable fields; PATCH on save when the buffer changed. | `--open`, `--silent` |
17
+ | `mxs project update <nameOrId>` | Patch selected fields. Missing flags leave the field untouched. | project write flags |
18
+ | `mxs project delete <nameOrId>` | Delete a project. | `--force`; required in non-TTY contexts |
19
+
20
+ ## Identifier resolution
21
+
22
+ `<nameOrId>` accepts:
23
+
24
+ - a Snowflake id (`/^\d{15,}$/`) — passed through unchanged,
25
+ - the project's unique `name` — resolved client-side via `GET /projects/all` and a case-insensitive `name` match. No `slug` field exists.
26
+
27
+ A duplicate `name` on create or update is rejected by the server with `PROJECT_NAME_TAKEN` (HTTP 409).
28
+
29
+ ## Project write flags
30
+
31
+ | Flag | Field | Notes |
32
+ | ---------------------- | ----------------- | ----------------------------------------------------------- |
33
+ | `--name <s>` | `name` | Required on `create`. Server-enforced unique (max 80 chars). |
34
+ | `--description <s>` | `description` | Required on `create` (max 500 chars). |
35
+ | `--preview-url <url>` | `previewUrl` | http(s) URL. Pass empty via `--file` to clear. |
36
+ | `--project-url <url>` | `projectUrl` | http(s) URL. |
37
+ | `--doc-url <url>` | `docUrl` | http(s) URL. |
38
+ | `--avatar <url>` | `avatar` | http(s) URL. |
39
+ | `--images <csv>` | `images` | Comma-separated list of URLs (≤ 20). |
40
+ | `--text <s>` | `text` | Free-form plain text (max 50_000 chars). |
41
+ | `--file <path>` | (merge) | JSON object whose recognised keys merge in first; per-flag values override. |
42
+ | `--open` | — | Open the admin page (`#/projects/<id>`) after success. |
43
+ | `--silent` | — | Emit `{ ok: true }` instead of the full row on success. |
44
+
45
+ ## Edit envelope
46
+
47
+ `mxs project edit` writes a pretty-printed JSON object covering every editable field (clearable fields appear as `null`), spawns `$EDITOR`, and on save:
48
+
49
+ - byte-identical buffer → `no changes`, no API call;
50
+ - malformed JSON → exits with `validation.json` (exit code 5);
51
+ - otherwise → `PATCH /projects/:id` with the parsed body. Missing keys are no-ops; explicit `null` clears the column.
52
+
53
+ `id` and `createdAt` are intentionally excluded from the envelope.
54
+
55
+ ## Dry-run support
56
+
57
+ `create`, `edit`, `update`, `delete` all honour the global `--dry-run` flag.
@@ -2,7 +2,7 @@
2
2
  slug: commands-topic
3
3
  title: Topic commands
4
4
  description: topic list/get/create/update/delete syntax
5
- order: 35
5
+ order: 36
6
6
  ---
7
7
 
8
8
  # Topic commands
@@ -2,7 +2,7 @@
2
2
  slug: output-modes
3
3
  title: Output modes
4
4
  description: --json / --output (readable, llm, xml, pretty-json) and global flags
5
- order: 40
5
+ order: 41
6
6
  ---
7
7
 
8
8
  # Output modes
@@ -7,7 +7,7 @@ order: 0
7
7
 
8
8
  # mxs CLI — AI agent skill bundle
9
9
 
10
- `mxs` is the deterministic interface for managing an `mx-core` deployment from the command line — authentication, content (posts, notes, pages), moderation, configuration. This skill bundle is shipped inside the published `@mx-space/cli` package so any agent with the installed binary can read it via `mxs skill <slug>`.
10
+ `mxs` is the deterministic interface for managing an `mx-core` deployment from the command line — authentication, content (posts, notes, pages, projects), moderation, configuration. This skill bundle is shipped inside the published `@mx-space/cli` package so any agent with the installed binary can read it via `mxs skill <slug>`.
11
11
 
12
12
  The audience is **AI agents**. Pass `--output llm` for raw markdown suitable for direct context injection. Default output is `readable` (markdown rendered as ANSI for a terminal).
13
13
 
@@ -20,6 +20,7 @@ The audience is **AI agents**. Pass `--output llm` for raw markdown suitable for
20
20
  | Exact command syntax for posts | `commands-post` |
21
21
  | Notes | `commands-note` |
22
22
  | Pages | `commands-page` |
23
+ | Portfolio projects | `commands-project` |
23
24
  | Comments / moderation | `commands-comment` |
24
25
  | Categories | `commands-category` |
25
26
  | Topics | `commands-topic` |
package/skills/safety.md CHANGED
@@ -16,6 +16,7 @@ Use this reference for every mutation, deletion, publication change, or failed c
16
16
  | Create post/note/page | Confirm target and run `--dry-run` when practical. | `get <slugOrId>` and compare metadata plus body sample. |
17
17
  | Update post/note/page | Prefer partial flags when body is unchanged. | Confirm changed fields and unchanged body when applicable. |
18
18
  | Edit post/note/page | Avoid `$EDITOR` in non-interactive workflows unless explicitly requested. | Read back the full document. |
19
+ | Create/update project | `name` is server-unique; duplicates fail with `PROJECT_NAME_TAKEN` (409). Prefer `update` with partial flags over `edit` in non-interactive runs. | `project get <nameOrId>` and compare fields. |
19
20
  | Publish/unpublish | Confirm publication intent and target. | Read back `state` or `isPublished`. |
20
21
  | Delete | Confirm destructive intent and target; prefer `--dry-run`; use `--force` only when non-interactive deletion is intentional. | Confirm `get` fails with not found or list no longer includes the resource. |
21
22
  | Config set/edit | Confirm target because changes affect server behavior. | `config get <key>` or `config list`. |
@@ -95,6 +96,15 @@ mxs page get <slugOrId> --json
95
96
 
96
97
  Verify `title`, `slug`, `subtitle`, `order`, and representative body text.
97
98
 
99
+ ### Project
100
+
101
+ ```bash
102
+ mxs project get <nameOrId> --output llm
103
+ mxs project get <nameOrId> --json
104
+ ```
105
+
106
+ Verify `name`, `description`, link URLs (`previewUrl`, `projectUrl`, `docUrl`), avatar, image count, and representative `text`.
107
+
98
108
  ### Config
99
109
 
100
110
  ```bash