When to use
- Promote a deployed use case from dev to production
- Make a process available to end users for the first time
- Configure visibility (private, organizational, public) on first publish
- Enable dev/prod auto-toggle to pause dev when prod is running
Prerequisites
codikaCLI installed and authenticated- A deployed use case with
project.jsoncontaining adeploymentsmap (rundeploy use-casefirst) - API key with
deploy:use-casescope
Command
Arguments
| Argument | Description |
|---|---|
<templateId> | Deployment template ID (from project.json deployments map) |
Options
| Option | Description | Default |
|---|---|---|
--path <path> | Path to use case folder with project.json | Current directory |
--project-file <path> | Custom project file path | project.json |
--project-id <id> | Override project ID | project.json |
--visibility <scope> | private, organizational, or public (first publish only) | — |
--shared-with <scope> | owner_only, admins, or everyone (org processes only) | — |
--auto-toggle-dev-prod | Pause dev instance when prod is active | Off (both run simultaneously) |
--skip-prod-instance | Don’t auto-create/update prod instance | — |
--api-url <url> | Override API URL | — |
--api-key <key> | Override API key | — |
--profile <name> | Use a specific profile instead of the active one | — |
--json | JSON output | — |
Finding the template ID
After each deploy,project.json stores a deployments map keyed by version:
templateId from the version you want to publish.
What happens on publish
- Resolve project ID:
--project-id>--project-file>project.json - Resolve API key:
--api-key> env > active profile - Send publish request to platform with templateId, projectId, and options
- Platform publishes the deployment template (status: inactive → published)
- Platform deprecates any previously published templates for this project
- Platform auto-creates or updates the owner’s prod process instance
- If
--auto-toggle-dev-prod, deactivates dev instance - On success: saves
prodProcessInstanceIdtoproject.json
Visibility
Set on first publish only. Subsequent publishes inherit the existing visibility.| Level | Who can see and install |
|---|---|
private | Only the owner |
organizational | All org members |
public | Anyone on the platform |
Shared with
Controls who can use the prod instance. Applies to organizational processes only.| Scope | Who can use the prod instance |
|---|---|
owner_only | Only the process owner |
admins | Organization admins (default for org processes) |
everyone | All organization members |
Dev/Prod toggle
By default, both dev and prod instances run simultaneously. Use--auto-toggle-dev-prod to pause the dev instance when production becomes active:
Examples
Output
Need to change parameters without a new version? After publishing, use
codika redeploy to update deployment parameters on the prod instance without creating a new template version. Only the parameters you specify are changed — everything else stays the same.Error reference
| HTTP | Error | Fix |
|---|---|---|
| 401 | Invalid API key | Re-login with codika login |
| 403 | Missing scope | Create key with deploy:use-case scope |
| 404 | Template not found | Check templateId in project.json deployments |
| 400 | Invalid status | Template already published or not in inactive state |
Exit codes
| Code | Meaning |
|---|---|
0 | Publish successful |
1 | API error |
2 | CLI validation error (missing templateId, no project ID) |