Skip to main content

When to use

  • Download a deployed use case from the platform
  • Restore a previously deployed use case to local files
  • Inspect what documents are stored for a project
  • Pull the latest deployed version locally

Prerequisites

  • codika-helper CLI installed and authenticated
  • Project ID of the deployed use case

Resolving the project ID

The CLI requires a project ID, not a folder path. If the user provides a use case folder path instead, read project.json from that folder to get the projectId:
cat <use-case-path>/project.json
# Use the "projectId" value in the command below

Command

codika-helper get use-case <projectId> [outputPath] [options]

Arguments

ArgumentRequiredDescription
<projectId>YesProject ID of the deployed use case (from project.json)
[outputPath]NoOutput directory (defaults to ./<projectId>)

Options

OptionDescription
--version <X.Y>Fetch specific version (latest if omitted)
--listList documents without downloading
--api-url <url>Override API URL
--api-key <key>Override API key
--jsonJSON output
The global CLI version flag is -V / --cli-version. The --version flag on this subcommand specifies the use case version to fetch.

Examples

# Download latest version
codika-helper get use-case abc123

# Download to specific directory
codika-helper get use-case abc123 ./my-local-copy

# Download specific version
codika-helper get use-case abc123 ./restored --version 1.0

# List files without downloading
codika-helper get use-case abc123 --list

# List with JSON output
codika-helper get use-case abc123 --list --json

# Check CLI version (not use case version)
codika-helper -V

Output

Download mode

Fetching use case abc123...
  Output:  ./restored

  ✓ config.ts
  ✓ workflows/main-workflow.json
  ✓ workflows/sub-workflow.json

✓ Use Case Downloaded Successfully

  Project:  abc123
  Version:  1.0
  Output:   ./restored
  Files:    3 file(s) downloaded

List mode

✓ Found 3 document(s)

  Project:      abc123
  Version:      1.0
  Organization: org_456

  Documents:
    config.ts  (8.1 KB, text/typescript)
    workflows/main-workflow.json  (5.8 KB, application/json)
    workflows/sub-workflow.json  (2.0 KB, application/json)

Exit codes

CodeMeaning
0Success
1API error or project not found