Author and migrate prompts with the CLI
Updated 2 days ago • October 10, 2026
Use independently authenticated named connections for the source and destination.
Connections store API URLs and environment-variable names, rather than raw keys.
--project-id on kortyx connections add selects a cloud project explicitly.
Modify the executable JSON file, validate it, and review the hash before saving:
edit is an alias of file-based update. versions lists identities and notes.
action <file> validates and applies category, group, draft, review, policy, or
asset mutations using the public action contract. archive and restore require
the reviewed asset revision. Assigned prompts cannot be archived.
Plan, apply, verify
The default copy exports the selected head and its exact dependency closure.
Use --version for one exact version or --history for histories, --groups for fully covered test groups, and
--rename source/key=destination/key for intentional key remapping. An unrelated
same-key conflict fails by default; --append explicitly allows new destination
versions. Identical executable content is reused. Category paths are portable;
internal category and prompt UUIDs are destination-owned. Dependency keys,
versions, and hashes are remapped together, so rewritten parents receive new
executable hashes while retaining their source provenance.
Plans freeze destination heads and expire after 24 hours. Applying a plan is
atomic: concurrent destination edits or group conflicts reject the operation.
Save the plan before applying; retrying that plan resumes the accepted operation
without duplicating versions. CLI apply reads destination versions back and checks
their exact hashes before reporting verification: "destination-read-back".
Copying never changes live assignments and never moves source keys, traces, eval results, or review approvals. Source identity and immutable version/hash provenance are retained. Run the imported version against the destination application's suite, then explicitly promote it under project promotion policy:
For disconnected deployments, use export <key...> --file bundle.json and
import bundle.json --plan-file transfer-plan.json. --apply combines planning
and application when the mapping is already controlled by your automation.
CLI failures use nonzero exit codes. --json reports versioned errors, including
prompt conflict codes, without reflecting arbitrary remote response bodies.
Editing inclusions with the CLI
Studio references appear in executable JSON as [[prompt:stable/key]]. Each key
needs an exact { id, version, hash } entry in content.dependencies; use
prompts get to read the child version and its hash. Keep inherited input
declarations in the parent's variablesSchema, review the diff, then update and
test the parent. Copy/export includes nested dependencies. Destination rename
mappings rewrite both the manifest and inline tokens before recomputing hashes.
Manage release tags from the CLI
Promotion updates only live; saving a new version and editing other tags do not:
Read current tag revisions with prompts get KEY --json. Revision 0 creates a new
tag; moving or removing one requires its current revision. live is reserved for
promotion/rollback. Copying between connections imports immutable candidates and
never copies or moves release tags automatically.