@mx-space/cli 0.11.0 → 0.12.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/README.md +39 -0
- package/dist/bin/mxs.mjs +1 -1
- package/dist/{esm-eihI6wbY.mjs → esm-DFrz5rIo.mjs} +172 -172
- package/dist/esm-DXO9Afik.mjs +2 -0
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +1 -1
- package/dist/{mxs-BNvfyLLp.mjs → mxs-C-ZguIBQ.mjs} +896 -493
- package/package.json +8 -8
- package/skills/commands-auth.md +1 -1
- package/skills/commands-config.md +1 -1
- package/skills/commands-preview.md +1 -1
- package/skills/commands-profile.md +1 -1
- package/skills/commands-snippet.md +73 -0
- package/skills/output-modes.md +1 -1
- package/skills/overview.md +1 -0
- package/dist/esm-Bw9S3CPp.mjs +0 -2
package/README.md
CHANGED
|
@@ -408,6 +408,45 @@ Guard summary:
|
|
|
408
408
|
- Any `--all` invocation (`approve`, `reject`, `delete`) refuses to run in a non-TTY context without `--force`.
|
|
409
409
|
- `approve` and `reject` of explicit ids run without confirmation.
|
|
410
410
|
|
|
411
|
+
## Snippets
|
|
412
|
+
|
|
413
|
+
Snippets are addressed by Snowflake id or `<reference>/<name>`. A bare name without `/` resolves as `root/<name>`.
|
|
414
|
+
|
|
415
|
+
| Command | Description |
|
|
416
|
+
| ----------------------------------- | -------------------------------------------------------------------------- |
|
|
417
|
+
| `mxs snippet list` | List snippets (`--page` / `--size`); `--grouped` groups by reference. |
|
|
418
|
+
| `mxs snippet get <id\|ref/name>` | Show a single snippet, including `raw`. |
|
|
419
|
+
| `mxs snippet create --name <name>` | Create a snippet. |
|
|
420
|
+
| `mxs snippet update <id\|ref/name>` | Update a snippet (full-body merge onto the existing snippet). |
|
|
421
|
+
| `mxs snippet edit <id\|ref/name>` | Open the snippet `raw` content in `$EDITOR` (extension derived from type). |
|
|
422
|
+
| `mxs snippet delete <id\|ref/name>` | Delete a snippet. Requires `--force` in non-TTY contexts. |
|
|
423
|
+
|
|
424
|
+
### Snippet Write Flags
|
|
425
|
+
|
|
426
|
+
| Flag | Field |
|
|
427
|
+
| -------------------------- | ----------------------------------------------------------- |
|
|
428
|
+
| `--name <name>` | `name` (required for `create`) |
|
|
429
|
+
| `--reference <r>` | `reference` (defaults to `root` server-side) |
|
|
430
|
+
| `--type <t>` | `type`: `json`, `json5`, `function`, `text`, or `yaml` |
|
|
431
|
+
| `--file <path\|->` | Read `raw` content from a file; `-` reads stdin |
|
|
432
|
+
| `--raw <text>` | Inline `raw` content |
|
|
433
|
+
| `--private` / `--no-private` | `private` |
|
|
434
|
+
| `--comment <text>` | `comment` |
|
|
435
|
+
| `--enable` / `--no-enable` | `enable` |
|
|
436
|
+
| `--method <m>` | `method`: `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, or `ALL` |
|
|
437
|
+
| `--metatype <text>` | `metatype` |
|
|
438
|
+
| `--schema <text>` | `schema` |
|
|
439
|
+
| `--custom-path <p>` | `customPath` |
|
|
440
|
+
| `--secret <k=v>` | `secret` (qs string) |
|
|
441
|
+
|
|
442
|
+
Raw content sources are mutually exclusive and resolve in order: `--file`, then `--raw`. `create` additionally falls back to piped stdin when stdin is not a TTY, and with no source at all opens `$EDITOR` on an empty buffer when interactive (fails otherwise). `update` never reads stdin implicitly — pass `--file -` to read stdin explicitly.
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
mxs snippet create --name theme --reference web --type json --file theme.json
|
|
446
|
+
echo '{"a":1}' | mxs snippet create --name config
|
|
447
|
+
mxs snippet edit web/theme
|
|
448
|
+
```
|
|
449
|
+
|
|
411
450
|
## Configuration
|
|
412
451
|
|
|
413
452
|
| Command | Description |
|
package/dist/bin/mxs.mjs
CHANGED