@mx-space/cli 0.3.1 → 0.4.1

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/README.md CHANGED
@@ -19,9 +19,11 @@ Node.js 22 or newer is required.
19
19
 
20
20
  ```bash
21
21
  mxs auth login
22
- mxs post create --file ./post.xml
23
- mxs post update my-slug --title "New title" --state publish
24
- mxs post get my-slug --output llm
22
+ mxs post create --file ./post.xml --open --silent # open admin preview, terse output
23
+ mxs post get my-slug --output xml > /tmp/post.xml # round-trip envelope
24
+ # edit /tmp/post.xml ...
25
+ mxs post update my-slug --file /tmp/post.xml --open
26
+ mxs post publish my-slug
25
27
  ```
26
28
 
27
29
  When the CLI cannot resolve an API URL, it starts an interactive onboarding prompt in TTY contexts. Use `MXS_API_URL` or `--api-url` for non-interactive environments.
@@ -31,7 +33,7 @@ When the CLI cannot resolve an API URL, it starts an interactive onboarding prom
31
33
  | Flag | Effect |
32
34
  | ------------------ | ----------------------------------------------------------------------------- |
33
35
  | `--json` | Emit `{ ok: true, data }` on stdout. Takes precedence over `--output`. |
34
- | `--output <mode>` | Output mode. Supported: `pretty-json`, `json`, `readable`, `llm`, `envelope`. |
36
+ | `--output <mode>` | Output mode. Supported: `pretty-json`, `json`, `readable`, `llm`, `xml`. |
35
37
  | `--api-url <url>` | Override the configured mx-core API origin. |
36
38
  | `--token <token>` | Override the stored access token. |
37
39
  | `--api-key <key>` | Authenticate with an API key through the `x-api-key` header. |
@@ -41,7 +43,7 @@ When the CLI cannot resolve an API URL, it starts an interactive onboarding prom
41
43
  | `--dry-run` | Resolve payloads without mutating the server where supported. |
42
44
  | `--profile <name>` | Profile to use (overrides `MXS_PROFILE` and the active pointer). |
43
45
 
44
- `readable`, `llm`, and `envelope` are document output modes for `post get`, `note get`, and `page get`. `post list` additionally supports `readable` and `llm` for concise list summaries. Other commands keep their existing JSON-oriented output.
46
+ `readable`, `llm`, and `xml` are document output modes for `post get`, `note get`, and `page get`. `post list` additionally supports `readable` and `llm` for concise list summaries. Other commands keep their existing JSON-oriented output.
45
47
 
46
48
  ## Output Modes
47
49
 
@@ -51,9 +53,9 @@ When the CLI cannot resolve an API URL, it starts an interactive onboarding prom
51
53
  | `json` | `{ ok: true, data }` JSON envelope. | Scripts and structured automation. |
52
54
  | `readable` | Compact key-value metadata plus readable body. | Human terminal reading. |
53
55
  | `llm` | Same stable readable structure as `readable`. | AI-agent context with lower structural noise. |
54
- | `envelope` | `<mxpost>` or `<mxnote>` LiteXML envelope. | Editable document round trips. |
56
+ | `xml` | `<mxpost>` or `<mxnote>` LiteXML envelope. | Editable document round trips. |
55
57
 
56
- For Lexical documents, `readable`, `llm`, and `envelope` render the body as LiteXML through `@haklex/rich-litexml` instead of exposing Lexical JSON.
58
+ For Lexical documents, `readable`, `llm`, and `xml` render the body as LiteXML through `@haklex/rich-litexml` instead of exposing Lexical JSON.
57
59
 
58
60
  Example:
59
61
 
@@ -206,6 +208,14 @@ Existing installations that use the legacy flat files (`~/.config/mxs/config.jso
206
208
  | `--related <csv>` | Comma-separated related document ids. |
207
209
  | `--meta <spec>` | JSON literal or `file=<path>`. |
208
210
  | `--file <path>` | LiteXML envelope. |
211
+ | `--open` | After success, open the admin edit page in the default browser. |
212
+ | `--silent` | On success, emit `ok` instead of the full server response. |
213
+
214
+ `--open` and `--silent` are also available on `post update`, `post edit`,
215
+ `note create`/`update`, and `page create`/`update`. The admin URL is
216
+ resolved from the server's `/options/url.admin_url` config; the opened
217
+ URL follows the admin-vue3 hash-router convention
218
+ (`${admin_url}#/<kind>/edit?id=<id>`).
209
219
 
210
220
  ## Notes
211
221
 
package/dist/bin/mxs.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { t as run } from "../mxs-D-YXaS2T.mjs";
2
+ import { t as run } from "../mxs-D9X72Mkv.mjs";
3
3
  export { run };
package/dist/index.d.mts CHANGED
@@ -1471,8 +1471,8 @@ interface ErrorEnvelope {
1471
1471
  }
1472
1472
  declare const toErrorEnvelope: (err: CliError) => ErrorEnvelope;
1473
1473
  //#endregion
1474
- //#region src/services/Renderer.d.ts
1475
- type OutputMode = 'pretty-json' | 'json' | 'readable' | 'llm' | 'envelope';
1474
+ //#region src/services/Renderer/options.d.ts
1475
+ type OutputMode = 'pretty-json' | 'json' | 'readable' | 'llm' | 'xml';
1476
1476
  interface OutputOptions {
1477
1477
  readonly json: boolean;
1478
1478
  readonly output: OutputMode;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-D-YXaS2T.mjs";
1
+ import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-D9X72Mkv.mjs";
2
2
  export { codeForTag, defaultGlobalFlags, defaultMessageFor, exitCodeForError, exitCodeForTag, parseGlobalFlags, run, tagToCode, toErrorEnvelope };