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 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 get use-case <projectId> [outputPath] [options]

Arguments

ArgumentDescription
<projectId>Project ID of the deployed use case (from project.json)
[outputPath]Output directory (defaults to ./<projectId>)

Options

OptionDescriptionDefault
--target-version <X.Y>Fetch specific versionLatest
--with-data-ingestionInclude data ingestion workflowtrue
--no-data-ingestionExclude data ingestion workflow
--di-version <version>Data ingestion version in X.Y formatLatest
--listList documents without downloading
--api-url <url>Override API URL
--api-key <key>Override API key
--profile <name>Use a specific profile instead of the active one
--jsonJSON output

Behavior

Download mode (default):
  1. Fetches metadata documents from the API
  2. Decodes file content
  3. Writes files to the output directory
List mode (--list):
  1. Fetches document listing only
  2. Displays file paths, sizes, and content types
  3. Does not download any files

Examples

# Download latest version
codika get use-case abc123

# Download to a specific directory
codika get use-case abc123 ./my-download

# Download a specific version
codika get use-case abc123 --target-version 1.2

# Download without data ingestion
codika get use-case abc123 --no-data-ingestion

# Download with specific data ingestion version
codika get use-case abc123 --di-version 1.0

# List documents without downloading
codika get use-case abc123 --list

# JSON output
codika get use-case abc123 --list --json

Output

Download mode

✓ Downloaded use case
  Project:   abc123
  Version:   1.3
  DI Ver:    1.2
  Files:     8
    config.ts
    version.json
    workflows/main-workflow.json
    workflows/helper.json
    workflows/scheduler.json
    data-ingestion/embedding-ingestion.json

List mode

✓ Found 4 document(s)

  Project:      abc123
  Version:      1.0
  DI Version:   1.2
  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)
    data-ingestion/embedding-ingestion.json  (3.2 KB, application/json)

Exit codes

CodeMeaning
0Success
1API error or project not found