import-workspace-definitions
Uploads a workspace definitions bundle — produced by export-workspace-definitions or by hand — into a target workspace. Apply the same artifact across environments to promote custom endpoints, tasks, and indexes from dev → staging → production.
Usage
# From a .zip file
curiosity-cli import-workspace-definitions \
--server https://my-workspace.example.com/ \
--token $CURIOSITY_TOKEN \
--import-path ./workspace-definitions.zip
# From a directory (CLI zips it for you)
curiosity-cli import-workspace-definitions \
--server https://my-workspace.example.com/ \
--token $CURIOSITY_TOKEN \
--import-path ./workspace-definitions \
--zip
Options
| Flag | Alias | Required | Default | Description |
|---|---|---|---|---|
--server |
-s |
yes | - | Workspace URL. |
--token |
-t |
yes | - | Library Token. Must have permission to manage custom code. |
--import-path |
yes | - | Path to a .zip file, or to a directory when --zip is set. |
|
--zip |
-z |
no | false |
Zip the directory before uploading. When false, the path must end in .zip. |
Result handling
The command prints one of three outcomes per definition file:
Definitions imported successfully.— everything applied cleanly.Definitions imported successfullywithWarning: ...lines — applied, but with non-fatal issues to review (typically migration warnings).Failed to import custom code.withError: ...lines — at least one definition was rejected; nothing changes silently. Address the errors and re-run.
The CLI exits with a non-zero code if any underlying call throws — pair it with set -e (Bash) or $ErrorActionPreference = 'Stop' (PowerShell) to fail your pipeline cleanly.
Idempotency
The import upserts: a definition that already exists is updated, a new one is created. Definitions present in the target but missing from the bundle are not deleted — purge them manually in the workspace UI if you want a strict mirror.
Permissions
The Library Token used here needs admin rights to manage custom code. Service tokens scoped to ingestion alone will fail with 401/403.
See also
export-workspace-definitions— produce the artifact this command consumes.- Custom Endpoints — the most common kind of definition in a bundle.
- Importing endpoint code — the
//ImportEndpoint(...)mechanism survives export/import.