Skip to content

Commit 82fe96a

Browse files
docs(config): document single node CLI commands and permissions
Add user-guide documentation for `config nodes create`, `config nodes update`, and `config nodes archive`, and a top-level Permissions section covering Studio (edit package) vs OCDM (edit data pool) requirements and the `config list` permission filter behavior. SP-331 Includes-AI-Code: true Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5956f67 commit 82fe96a

1 file changed

Lines changed: 198 additions & 0 deletions

File tree

docs/user-guide/config-commands.md

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22

33
The `config` command group allows you to list, batch export, import packages of different flavors such as Studio and OCDM packages.
44

5+
## Permissions
6+
7+
All `config` commands run against the Pacman API and are subject to the same permission checks the platform applies in the UI. The required permission depends on the **flavor** of the target package:
8+
9+
| Package flavor | Required permission |
10+
|---|---|
11+
| **Studio** (Studio packages and their assets) | **Edit package** permission on the package |
12+
| **OCDM** (OCDM packages and their assets) | **Edit** (admin) permission on the **data pool** the OCDM package is connected to |
13+
14+
This applies to every command that reads or modifies a single package or its nodes, including:
15+
16+
- `config nodes get`, `config nodes list`, `config nodes diff`, `config nodes dependencies list`
17+
- `config nodes create`, `config nodes update`, `config nodes archive`
18+
- `config variables list`
19+
- `config versions get`, `config versions create`
20+
- `config validate`, `config diff`
21+
- `config export`, `config import`, `config metadata export`
22+
23+
If the authenticated profile does not have the required permission, the command fails with `Access is Denied`.
24+
25+
`config list` is the one exception: instead of failing, it **filters out packages the profile does not have permission to access**. If a package you expect to see is missing from the list, the most likely cause is missing edit permission on the package (Studio) or on its connected data pool (OCDM).
26+
527
## List Packages
628

729
Packages can be listed using the following command:
@@ -363,6 +385,182 @@ You can combine options to export a versioned node with its configuration:
363385
content-cli config nodes get --packageKey <packageKey> --nodeKey <nodeKey> --packageVersion <packageVersion> --withConfiguration --json
364386
```
365387

388+
## Creating a Node
389+
390+
The **config nodes create** command creates a new node in the **staging (draft) version** of a package. Use it to add a single asset (View, Knowledge Model, Skill, etc.) to an existing package without going through the full package import flow.
391+
392+
This command requires **edit permission** on the target package (see [Permissions](#permissions)).
393+
394+
### Create a Node from a JSON Payload
395+
396+
The node payload can be provided either inline as a JSON string with `--body`, or as a path to a JSON file with `-f` / `--file`. Exactly one of these options must be provided.
397+
398+
```bash
399+
content-cli config nodes create --packageKey <packageKey> -f <path-to-node.json>
400+
```
401+
402+
```bash
403+
content-cli config nodes create --packageKey <packageKey> --body '{"key":"...","name":"...","parentNodeKey":"...","type":"...","configuration":{}}'
404+
```
405+
406+
### Payload Format
407+
408+
The payload must follow the `SaveNodeTransport` shape required by the Pacman public API:
409+
410+
| Field | Required | Description |
411+
|---|---|---|
412+
| `key` | yes | Unique key of the new node within the package. Must not collide with any existing (including archived) node key in the same package. |
413+
| `name` | yes | Human-readable name of the node. |
414+
| `parentNodeKey` | yes | Key of the parent node. To attach the node directly under the package root, use the package key. |
415+
| `type` | yes | Node type (e.g. `VIEW`, `KNOWLEDGE_MODEL`, `SKILL`). Must match a node type that is valid for the package's flavor. |
416+
| `configuration` | no | Object containing the type-specific configuration of the node. |
417+
| `schemaVersion` | no | Schema version of the configuration. Required for node types that use schema-based validation. |
418+
| `invalidConfiguration` | no | Stringified configuration to store as-is when `invalidContent` is `true`. Reserved for special migration / recovery flows. |
419+
| `invalidContent` | no | Mark the node as having invalid content. Reserved for special migration / recovery flows. |
420+
421+
A minimal example payload (`my-view.json`):
422+
423+
```json
424+
{
425+
"key": "my-new-view",
426+
"name": "My New View",
427+
"parentNodeKey": "my-package",
428+
"type": "VIEW",
429+
"configuration": {}
430+
}
431+
```
432+
433+
On success, the command prints the created node's metadata to the console:
434+
435+
```bash
436+
info: ID: node-id-123
437+
info: Key: my-new-view
438+
info: Name: My New View
439+
info: Type: VIEW
440+
info: Package Node Key: my-package
441+
info: Parent Node Key: my-package
442+
info: Created By: user@celonis.com
443+
info: Updated By: user@celonis.com
444+
info: Creation Date: 2025-10-22T10:30:00.000Z
445+
info: Change Date: 2025-10-22T10:30:00.000Z
446+
info: Flavor: STUDIO
447+
```
448+
449+
### Validate Without Persisting
450+
451+
Use `--validate` to run the same validation the Pacman API applies on create, **without** persisting the node. This is useful in CI pipelines to check a payload before committing to the change.
452+
453+
```bash
454+
content-cli config nodes create --packageKey <packageKey> -f <path-to-node.json> --validate
455+
```
456+
457+
If validation succeeds, the command prints:
458+
459+
```bash
460+
info: Validation successful for node <key> in package <packageKey>.
461+
```
462+
463+
If validation fails, the command exits with a non-zero status and prints the validation errors returned by Pacman.
464+
465+
### Export Created Node as JSON
466+
467+
To write the created node's metadata to a JSON file instead of printing it to the console, add `--json`:
468+
469+
```bash
470+
content-cli config nodes create --packageKey <packageKey> -f <path-to-node.json> --json
471+
```
472+
473+
## Updating a Node
474+
475+
The **config nodes update** command updates an existing node in the **staging (draft) version** of a package. The update is a full replacement of the mutable node fields — the payload represents the desired state of the node, not a partial patch.
476+
477+
This command requires **edit permission** on the target package (see [Permissions](#permissions)).
478+
479+
### Update a Node from a JSON Payload
480+
481+
As with create, the payload can be provided inline with `--body` or via a file with `-f` / `--file`. Exactly one of these options must be provided.
482+
483+
```bash
484+
content-cli config nodes update --packageKey <packageKey> --nodeKey <nodeKey> -f <path-to-node.json>
485+
```
486+
487+
### Payload Format
488+
489+
The payload must follow the `UpdateNodeTransport` shape required by the Pacman public API:
490+
491+
| Field | Required | Description |
492+
|---|---|---|
493+
| `name` | yes | Human-readable name of the node. |
494+
| `parentNodeKey` | yes | Key of the parent node. Use the package key to keep / move the node directly under the package root. |
495+
| `configuration` | no | Object containing the type-specific configuration of the node. |
496+
| `schemaVersion` | no | Schema version of the configuration. Required for node types that use schema-based validation. |
497+
| `invalidConfiguration` | no | Stringified configuration to store as-is when `invalidContent` is `true`. Reserved for special migration / recovery flows. |
498+
| `invalidContent` | no | Mark the node as having invalid content. Reserved for special migration / recovery flows. |
499+
500+
Note that `key` and `type` are **not** part of the update payload. They are immutable for an existing node — to change them you must archive the node and create a new one.
501+
502+
A minimal example payload:
503+
504+
```json
505+
{
506+
"name": "My Renamed View",
507+
"parentNodeKey": "my-package",
508+
"configuration": {}
509+
}
510+
```
511+
512+
On success, the command prints the updated node's metadata in the same format as `config nodes create`.
513+
514+
### Validate Without Persisting
515+
516+
`--validate` runs the same validation the Pacman API applies on update, without persisting the change. Useful for pre-flight checks in CI:
517+
518+
```bash
519+
content-cli config nodes update --packageKey <packageKey> --nodeKey <nodeKey> -f <path-to-node.json> --validate
520+
```
521+
522+
If validation succeeds, the command prints:
523+
524+
```bash
525+
info: Validation successful for node <nodeKey> in package <packageKey>.
526+
```
527+
528+
### Export Updated Node as JSON
529+
530+
```bash
531+
content-cli config nodes update --packageKey <packageKey> --nodeKey <nodeKey> -f <path-to-node.json> --json
532+
```
533+
534+
## Archiving a Node
535+
536+
The **config nodes archive** command archives a node in the **staging (draft) version** of a package. Archiving is a soft-delete: the node is hidden from the active package state but its history is preserved, so previously published versions of the package that include the node are unaffected.
537+
538+
This command requires **edit permission** on the target package (see [Permissions](#permissions)).
539+
540+
### Archive a Node
541+
542+
```bash
543+
content-cli config nodes archive --packageKey <packageKey> --nodeKey <nodeKey>
544+
```
545+
546+
On success, the command prints:
547+
548+
```bash
549+
info: Node <nodeKey> in package <packageKey> archived successfully.
550+
```
551+
552+
### Archive a Node That Has Dependants
553+
554+
By default, archiving a node fails if other nodes still depend on it. This protects you from accidentally breaking references in the package.
555+
556+
If you intentionally want to archive a node despite its dependants — for example because you are about to archive the dependants too, or because the references are known to be safe — use the `--force` flag:
557+
558+
```bash
559+
content-cli config nodes archive --packageKey <packageKey> --nodeKey <nodeKey> --force
560+
```
561+
562+
Use `--force` with care: dependants are not archived for you, and the package may temporarily contain broken references until you fix them.
563+
366564
## Listing Nodes
367565
368566
The **config nodes list** command allows you to retrieve all nodes within a specific package version.

0 commit comments

Comments
 (0)