Skip to main content
Version: v5.6.1

opschain nodes create

Included from Basic tierassets

opschain nodes create <path> [-f <file.yaml>] [--name <name>] [--project-type standard|enterprise] [--template <code>:<version>] ...

Creates the node the path names — the path carries both where and what:

  • nodes create demo creates project demo,
  • nodes create demo/environments/dev the dev environment under it,
  • nodes create demo/environments/dev/assets/web --template web-template:1.0.0 the web asset pinned to that template version,
  • nodes create demo/assets/shared --template t:1.0.0 an asset directly under an Enterprise project.

The final path segment becomes the node's code (immutable thereafter); the parent must already exist. Assets always need --template (or the -f equivalents) and an Enterprise project above them. A project's type is chosen at creation and cannot be changed afterwards — pick --project-type enterprise up front when assets will live under the project, or the only recovery later is recreating the project.

Flags​

FlagMeaning
-f, --file <file.yaml>YAML node definition. Accepted keys: code, name, description, project_type, template_code, template_version — an unknown key is refused by name. A code in the file must match the path's code.
--name <name>Display name. Defaults to the node's code when neither the flag nor the file supplies one.
--description <text>Description.
--template <code>:<version>Template to pin an asset to (assets only). Shorthand for the file's template_code + template_version.
--project-type <type>Projects only; default standard. standard holds environments and git-remote work; enterprise additionally allows assets beneath it. Accepts standard or enterprise in any casing, refused by name otherwise. Immutable after creation — assets require an Enterprise project.

Flags win over -f file values. Supplying a project_type (by flag or file) for anything but a project is refused.

Exit codes​

CodeMeaning
0Created.
1The server refused the create (duplicate code, missing parent, validation, authorisation).
2Usage error — malformed path or --template, unknown file keys, no server target.

Named errors​

  • <file.yaml> defines code "…" but the command addresses /projects/…
  • --template wants <template-code>:<version>, got "…"
  • --project-type only applies when creating a project
  • --project-type (or the project_type file key) must be standard or enterprise, got "…"
  • <file.yaml>: unknown node attribute(s) … (accepted: code, name, description, project_type, template_code, template_version)
  • expected a node path like demo, demo/environments/dev or /projects/demo/environments/dev/assets/web, got "…"
  • nodes operate on a server's estate — pass --server <url> or 'opschain context use <name>'

All exit 2.

Server refusals are named too (exit 1) — an asset create under a Standard project answers:

assets require an Enterprise project: <project> is Standard (the type is
set at creation and cannot be changed — recreate the project with
project_type: enterprise)

Examples​

opschain nodes create demo --name "Demo" --description "Demo estate"
created project /projects/demo (01999a7e-…)
opschain nodes create acme --project-type enterprise
opschain nodes create acme/assets/shared --template base:2.1.0
opschain nodes create demo/environments/dev -f dev.yaml

-q prints only the created node's id; -o json / -o yaml print the created node object.

See also​

  • opschain docs cli/nodes-update — change the attributes later (code is immutable).
  • opschain docs cli/admin-nodes-import — recreate a whole exported subtree instead of one node.
  • opschain learn 1.1 — the estate, guided.