enhancedocs
For agentsOpen Enhance ↗
CLI commands / enhance-dev prototype publish

Enhance documentation

enhance-dev prototype publish

Package and publish an unpacked static build directory. The CLI creates the upload artifact. To update a prototype, publish to its owner node: pass --prototype-id and that node as --node-id. Any other node that shows it forks into its own prototype. An update keeps the title the node shows; --title only names a new node.

↓ Markdown

enhance-dev prototype publish

enhance-dev prototype publish [options]

Arguments

This command takes no positional arguments.

Options

OptionRequiredDefaultMeaning
--canvas-id <uuid>YesNoneCanvas id, from enhance canvas list.
--directory <path>YesNoneUnpacked static build directory; do not pass a ZIP file.
--title <title>YesNoneLabel above a new prototype frame, up to 200 characters. An update or a fork ignores it and keeps the title the node shows.
--base-version <number>YesNoneDocument version returned by enhance canvas document get.
--prototype-id <uuid>NoNoneExisting prototype to update. Without --node-id it goes to the owner node, and is refused if that node is gone.
--client-token <uuid>NoNoneStable UUID to reuse when retrying the exact same mutation.
--node-id <id>NoNoneThe prototype’s owner node to update it. Pass it with --prototype-id; any other node that shows the prototype forks into its own prototype.
--entry <path>Noindex.htmlHTML entry relative to the uploaded directory.
--x <pixels>No48Canvas x coordinate.
--y <pixels>No48Canvas y coordinate.
--width <pixels>No1440Prototype viewport width.
--height <pixels>No900Prototype viewport height.

Input

This command presents the capability prototype.publish. It has external effect and composite idempotency.

Show complete input JSON Schema
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"canvasId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prototypeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Existing prototype id to redeploy, or null to create one."},"nodeId":{"type":"string","minLength":1},"targetMode":{"type":"string","enum":["node","prototype"]},"canvasPageId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"directory":{"type":"string","minLength":1,"description":"Absolute local directory containing the built prototype."},"entryPath":{"type":"string","minLength":1,"description":"HTML entry file path relative to directory, normally index.html."},"baseVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"box":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0}},"required":["x","y","width","height"],"description":"World-space position and size for the prototype node on the canvas."}},"required":["canvasId","prototypeId","nodeId","title","directory","entryPath","baseVersion","box"]}

Output

This command writes JSON records to standard output. Returns a typed prototype.publish result from the Enhance API without transport-specific prose.

Show complete output JSON Schema
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"canvasId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"deploymentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"nodeId":{"type":"string","minLength":1},"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"openUrl":{"type":"string","pattern":"^\\/c\\/.*"},"next":{"type":"array","items":{"type":"string"}}},"required":["canvasId","deploymentId","nodeId","version","openUrl","next"],"additionalProperties":{}}

Examples

enhance-dev prototype publish --canvas-id <uuid> --directory <path> --title <title> --base-version <number>
Show example input
{
 "canvasId": "00000000-0000-4000-8000-000000000010",
 "prototypeId": null,
 "nodeId": "prototype_ready",
 "title": "Ready prototype",
 "directory": "/absolute/build",
 "entryPath": "index.html",
 "baseVersion": 1,
 "box": {
  "x": 48,
  "y": 48,
  "width": 1440,
  "height": 900
 }
}
Show example output
{
 "canvasId": "00000000-0000-4000-8000-000000000010",
 "deploymentId": "00000000-0000-4000-8000-000000000010",
 "nodeId": "prototype_ready",
 "version": 2,
 "openUrl": "/c/00000000-0000-4000-8000-000000000010",
 "next": [
  "Open the prototype."
 ]
}

Exit behaviour

Exit codeMeaning
0The command succeeded.
1The command failed for another reason (INTERNAL). A write may have an unknown outcome.
2The command line was malformed. Nothing ran.
3The API refused the input (BAD_REQUEST).
4The credential is missing or expired (UNAUTHORIZED).
5The API refused the request (FORBIDDEN, NOT_FOUND, CONFLICT, RATE_LIMITED).
6A batch finished only in part. Retry with the same --client-token.

Versions

Minimum tested versions: Enhance CLI and MCP runtime 0.1.40, plugin 1.0.38, Node.js 24. No older floor is published.