# Manage artifacts with the CLI

> Manage artifacts with the CLI - dr artifact commands for creating, inspecting, building, and
> managing the code that backs Workload artifacts.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-07-09T05:46:40.354976+00:00` (UTC).

## Primary page

- [Manage artifacts with the CLI](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [Subcommands](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#subcommands): In-page section heading.
- [dr artifact create](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-create): In-page section heading.
- [Spec file format](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#spec-file-format): In-page section heading.
- [Spec file validation](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#spec-file-validation): In-page section heading.
- [Container lifecycles](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#container-lifecycles): In-page section heading.
- [Examples](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#artifact-create-examples): In-page section heading.
- [dr artifact list](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-list): In-page section heading.
- [Examples](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#artifact-list-examples): In-page section heading.
- [dr artifact get](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-get): In-page section heading.
- [Examples](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#artifact-get-examples): In-page section heading.
- [dr artifact delete](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-delete): In-page section heading.
- [dr artifact lock](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-lock): In-page section heading.
- [dr artifact build create](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-build-create): In-page section heading.
- [Prerequisites](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#build-create-prerequisites): In-page section heading.
- [Examples](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#build-create-examples): In-page section heading.
- [dr artifact build get](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-build-get): In-page section heading.
- [dr artifact build list](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-build-list): In-page section heading.
- [dr artifact build logs](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-build-logs): In-page section heading.
- [dr artifact code init](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-code-init): In-page section heading.
- [Prerequisites](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#code-init-prerequisites): In-page section heading.
- [Examples](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#code-init-examples): In-page section heading.
- [dr artifact code sync](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-code-sync): In-page section heading.
- [Prerequisites](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#code-sync-prerequisites): In-page section heading.
- [Conflict handling](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#conflict-handling): In-page section heading.
- [JSON mode](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#json-mode): In-page section heading.
- [Examples](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#code-sync-examples): In-page section heading.
- [dr artifact code versions](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-code-versions): In-page section heading.
- [Output](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#versions-output): In-page section heading.
- [Prerequisites](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#versions-prerequisites): In-page section heading.
- [Examples](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#code-versions-examples): In-page section heading.
- [dr artifact code checkout](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#dr-artifact-code-checkout): In-page section heading.
- [Examples](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#code-checkout-examples): In-page section heading.
- [Error handling](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#error-handling): In-page section heading.
- [Exit codes](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#exit-codes): In-page section heading.

## Related documentation

- [Workload API](https://docs.datarobot.com/en/docs/workload-api/index.html.md): Linked from this page.
- [Workload interfaces](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/index.html.md): Linked from this page.
- [Workload CLI](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/index.html.md): Linked from this page.

## Documentation content

> [!NOTE] Preview
> The Workload API is a preview feature, on by default.
> 
> Feature flag: Enable Access to Workload API Experimental Features

The `dr artifact` command group manages Workload artifacts, server-side image builds, and the local code that backs them, from your terminal. Commands are structured as follows:

```
dr artifact <command> [flags]
```

The group is split into three sub-command groups:

| Subcommand | Description |
| --- | --- |
| dr artifact | Create, list, inspect, lock, and delete artifacts on the server. |
| dr artifact build | Trigger, monitor, and inspect server-side image builds for an artifact. |
| dr artifact code | Link a local project directory to an artifact and sync code in both directions. |

> [!NOTE] Code command state directory
> The `code` commands maintain a `.wapi/` state directory at the project root that tracks which artifact, catalog, and version a directory is bound to. The model is conceptually similar to `.git/` —local work happens in the project root, while `.wapi/` captures the remote binding and last-synced state used to detect drift on each operation.

Before you begin, enable the command group and authenticate.`dr artifact` and `dr workload` are hidden by default; a single environment variable enables both:

```
export DATAROBOT_CLI_FEATURE_WORKLOAD=true
dr auth login
```

The following is a typical code-to-Workload flow using these commands:

```
# Create the artifact on the server
dr artifact create --spec-file spec.json

# Link a local directory to it (use the printed ID)
dr artifact code init <artifact-id>

# Upload code and let sync fill in the codeRef
dr artifact code sync

# Build the container image server-side and wait for completion
dr artifact build create <artifact-id> --wait

# Lock the artifact for production
dr artifact lock <artifact-id>
```

For more information, see the detailed subcommand documentation in [Subcommands](https://docs.datarobot.com/en/docs/workload-api/workload-interfaces/workload-cli/artifact-cli.html.md#subcommands).

## Subcommands

| Subcommand | Description |
| --- | --- |
| dr artifact create | Create a Workload artifact from a JSON or YAML spec file. |
| dr artifact list | List Workload artifacts with optional filtering. |
| dr artifact get | Display details for a single Workload artifact by ID. |
| dr artifact delete | Delete a Workload artifact by ID. |
| dr artifact lock | Lock a draft artifact, making it immutable. |
| dr artifact build create | Trigger a server-side image build for an artifact. |
| dr artifact build get | Display details for a single build by ID. |
| dr artifact build list | List builds for an artifact. |
| dr artifact build logs | Print the build log for a specific build. |
| dr artifact code init | Link a project directory to an existing Workload artifact. |
| dr artifact code sync | Push local edits and pull remote changes between this directory and the linked artifact. |
| dr artifact code versions | List the catalog version history for the artifact this project directory is linked to. |
| dr artifact code checkout | Download a specific catalog version into .wapi/.checkouts/<version-id>/ for read-only inspection. |

### dr artifact create

Create a Workload artifact from a JSON or YAML spec file.

```
dr artifact create --spec-file <path> [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| --spec-file <path> | Path to a JSON or YAML spec file. Required. |
| --output-format <text\\|json> | Output format. Defaults to text. |

#### Spec file format

The spec file defines the Workload artifact. JSON and YAML formats are both supported. To get started, see the examples below.

**Minimal spec (prebuilt image):**
```
{
  "name": "my-agent",
  "spec": {
    "containerGroups": [{
      "containers": [{
        "imageUri": "nginx:latest",
        "port": 8080,
        "primary": true
      }]
    }]
  }
}
```

**Minimal spec (build from a provided Dockerfile):**
```
{
  "name": "my-agent",
  "spec": {
    "containerGroups": [{
      "containers": [{
        "primary": true,
        "port": 8080,
        "imageBuildConfig": { "dockerfile": { "source": "provided" } }
      }]
    }]
  }
}
```

**Detailed spec (wire to an existing catalog version):**
```
{
  "name": "my-agent",
  "description": "Optional description shown in the DataRobot UI.",
  "spec": {
    "containerGroups": [{
      "containers": [{
        "primary": true,
        "port": 8080,
        "imageBuildConfig": {
          "dockerfile": { "source": "provided" },
          "codeRef": {
            "datarobot": {
              "catalogId": "67890abcdef1234567890abc",
              "catalogVersionId": "67890abcdef1234567890def"
            }
          }
        }
      }]
    }]
  }
}
```


#### Spec file validation

The following validation rules apply:

- Client-side: name must be non-empty; spec.containerGroups must contain at least one entry; each group's containers array must contain at least one entry.
- Server-side: the Workload API validates field-level shape and returns 422 with a JSON-path detail on a mismatch.
- Unknown fields are passed through to the server, so any field the server accepts is accepted here. The spec file is not parsed strictly.

#### Container lifecycles

The following container lifecycles are supported:

1. Prebuilt image —set imageUri (plus port and primary ) on the entry container.
2. Build from a provided Dockerfile —set imageBuildConfig.dockerfile.source = "provided" to build from ./Dockerfile in your synced code.
3. Build from a generated Dockerfile —set imageBuildConfig.dockerfile.source = "generated" together with executionEnvironmentId , executionEnvironmentVersionId , and entrypoint to have the server generate a Dockerfile from a base image.

> [!NOTE] Code sync fills incodeRef
> `dr artifact code sync` fills in `imageBuildConfig.codeRef` automatically after the first upload, so a freshly created artifact typically does not carry a `codeRef` until you sync code into it.

#### Examples

**Create with default human-readable output:**
```
dr artifact create --spec-file spec.json
```

```
ID:          67890abcdef1234567890abc
Name:        my-agent
Status:      draft
Catalog ID:  —
Version ID:  —
Created:     2026-05-14 10:00 UTC
Updated:     2026-05-14 10:00 UTC
```

**Create with machine-parseable JSON output:**
```
dr artifact create --spec-file spec.json --output-format json
```

```
{
  "id": "67890abcdef1234567890abc",
  "name": "my-agent",
  "status": "draft",
  "catalogId": "",
  "versionId": "",
  "createdAt": "2026-05-14T10:00:00Z",
  "updatedAt": "2026-05-14T10:00:00Z"
}
```


### dr artifact list

List Workload artifacts with optional filtering.

```
dr artifact list [--limit <n>] [--status draft|locked] [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| --limit <n> | Maximum number of artifacts to return. Defaults to 100. Must be a positive integer. |
| --status <draft\\|locked> | Filter by status. Optional; if omitted, all statuses are returned. |
| --output-format <text\\|json> | Output format. Defaults to text. |

#### Examples

**List all artifacts:**
```
dr artifact list
```

Renders as a bordered table:

```
╭──────────────────────────┬───────────┬────────┬──────────────────────────┬──────────────────────────┬──────────────────────╮
│ ARTIFACT ID              │ NAME      │ STATUS │ CATALOG ID               │ VERSION ID               │ UPDATED              │
├──────────────────────────┼───────────┼────────┼──────────────────────────┼──────────────────────────┼──────────────────────┤
│ 67890abcdef1234567890abc │ my-agent  │ draft  │ —                        │ —                        │ 2026-05-14 10:00 UTC │
│ 67890abcdef1234567890aaa │ chat-app  │ locked │ 67890abcdef1234567890cat │ 67890abcdef1234567890ver │ 2026-05-13 14:32 UTC │
╰──────────────────────────┴───────────┴────────┴──────────────────────────┴──────────────────────────┴──────────────────────╯
```

When no artifacts match, the text output is `No artifacts found.` and the JSON output is `{"artifacts": []}`.

**Filter by status with JSON output:**
```
dr artifact list --status draft --output-format json
```

```
{
  "artifacts": [
    {
      "id": "67890abcdef1234567890abc",
      "name": "my-agent",
      "status": "draft",
      "catalogId": "",
      "versionId": "",
      "createdAt": "2026-05-14T10:00:00Z",
      "updatedAt": "2026-05-14T10:00:00Z"
    }
  ]
}
```


### dr artifact get

Display details for a single Workload artifact by ID.

```
dr artifact get <artifact-id> [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| <artifact-id> | The artifact ID. Required. |
| --output-format <text\\|json> | Output format. Defaults to text. |

#### Examples

**Get an artifact by ID:**
```
dr artifact get 67890abcdef1234567890abc
```

```
ID:          67890abcdef1234567890abc
Name:        my-agent
Status:      draft
Catalog ID:  —
Version ID:  —
Created:     2026-05-14 10:00 UTC
Updated:     2026-05-14 10:00 UTC
```

**Get an artifact by ID with JSON output:**
```
dr artifact get 67890abcdef1234567890abc --output-format json
```

```
{
  "id": "67890abcdef1234567890abc",
  "name": "my-agent",
  "status": "draft",
  "catalogId": "",
  "versionId": "",
  "createdAt": "2026-05-14T10:00:00Z",
  "updatedAt": "2026-05-14T10:00:00Z"
}
```


### dr artifact delete

Delete a Workload artifact by ID. Two server-side rules apply: locked artifacts can never be deleted, and draft artifacts that are still referenced by a Workload cannot be deleted until the Workload is removed first.

```
dr artifact delete <artifact-id> [-y|--yes]
```

| Argument/Flag | Description |
| --- | --- |
| <artifact-id> | The artifact ID. Required. |
| -y, --yes | Skip the confirmation prompt. |

### dr artifact lock

Lock a draft artifact, making it immutable and eligible for production Workloads. Locking is irreversible—to iterate further, clone the artifact or create a new one.

```
dr artifact lock <artifact-id> [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| <artifact-id> | The artifact ID. Required. |
| --output-format <text\\|json> | Output format. Defaults to text. |

> [!NOTE] Locking is irreversible
> Once locked, an artifact's name, description, and spec become immutable and the artifact can never be deleted. To iterate further, create a new draft artifact with `dr artifact create`.

### dr artifact build create

Trigger a server-side image build for an artifact. The platform builds the container image from the artifact's current `codeRef`, pushes it to DataRobot's internal registry, and populates `imageUri` on the artifact. Only draft artifacts can be built.

```
dr artifact build create [<artifact-id>] [--wait] [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| <artifact-id> | The artifact ID. Optional when run inside a directory linked via dr artifact code init; the ID is read from .wapi/config.json. |
| --wait | Poll until the build reaches a terminal state (succeeded or failed); print the tail of the build logs on failure. |
| --output-format <text\\|json> | Output format. Defaults to text. |

#### Prerequisites

- The artifact must be in draft status.
- The artifact must have a codeRef pointing to at least one synced catalog version. Run dr artifact code sync first if the artifact has no code.

#### Examples

```
# Commands
# Trigger a build from a linked directory (no artifact-id needed)
dr artifact build create

# Trigger a build by artifact ID and return immediately
dr artifact build create 67890abcdef1234567890abc

# Trigger a build and wait for it to finish
dr artifact build create 67890abcdef1234567890abc --wait
```

### dr artifact build get

Display details for a single build by ID.

```
dr artifact build get <artifact-id> <build-id> [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| <artifact-id> | The artifact ID. Required. |
| <build-id> | The build ID. Required. |
| --output-format <text\\|json> | Output format. Defaults to text. |

### dr artifact build list

List builds for an artifact, newest first.

```
dr artifact build list <artifact-id> [--limit <n>] [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| <artifact-id> | The artifact ID. Required. |
| --limit <n> | Maximum number of builds to return. Defaults to 100. |
| --output-format <text\\|json> | Output format. Defaults to text. |

### dr artifact build logs

Print the build log for a specific build. When invoked with one positional argument, the artifact ID is read from `.wapi/config.json` in the current directory. When invoked with two, the first argument is the artifact ID.

```
dr artifact build logs [<artifact-id>] <build-id> [--level <level>] [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| <artifact-id> | The artifact ID. Optional when run inside a linked directory; the ID is read from .wapi/config.json. |
| <build-id> | The build ID. Required. |
| --level <level> | Minimum log level to show: debug, info, warn, error. Defaults to info. |
| --output-format <text\\|json> | Output format. Defaults to text. |

### dr artifact code init

Link a project directory to an existing Workload artifact. Creates a `.wapi/` state directory at the project root that records which artifact, catalog, and version the directory is bound to. Required before any other `code` command.

```
dr artifact code init [<artifact-id>] [--dir <path>] [-y|--yes] [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| <artifact-id> | Optional. If omitted in interactive mode, you'll be prompted. |
| --dir <path> | Project directory. Defaults to the current directory. |
| -y, --yes | Skip interactive prompts and use defaults. Can also be enabled via DATAROBOT_CLI_NON_INTERACTIVE=true. |
| --output-format <text\\|json> | Output format. Defaults to text. |

#### Prerequisites

- The artifact must already exist. Create it via dr artifact create or in the DataRobot UI.
- The artifact must be in draft status. Locked artifacts are immutable.

#### Examples

```
# Commands
# Interactive: prompts for the directory
dr artifact code init 67890abcdef1234567890abc

# Non-interactive: link the current directory
dr artifact code init 67890abcdef1234567890abc --yes

# Link a sibling directory
dr artifact code init 67890abcdef1234567890abc --dir ./service
```

### dr artifact code sync

Push local edits and pull remote changes between this directory and the linked artifact. Computes a three-way diff against the last known state, auto-resolves conflicts (remote wins; the local version is saved as a `*.LOCAL.<timestamp>` copy), and applies the resulting plan in a single versioned step.

```
dr artifact code sync [--dir <path>] [--dry-run | --diff] [-y|--yes] [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| --dir <path> | Project directory. Defaults to the current directory. |
| --dry-run | Show the plan without writing anything. Exits before any remote write. |
| --diff | Show the plan plus per-file unified diffs. Mutually exclusive with --dry-run. Exits before any remote write. |
| -y, --yes | Auto-confirm the post-plan prompt; also skips the interactive directory prompt. |
| --output-format <text\\|json> | Output format. Defaults to text. |

#### Prerequisites

The directory must already be linked via `dr artifact code init`. Otherwise the command returns `not linked: run 'dr artifact code init <artifact-id>' first`.

#### Conflict handling

When the same file has diverged on both sides, `sync` auto-resolves by taking the remote version and writing the local copy alongside as `<path>.LOCAL.<timestamp>`. In interactive mode the command pauses on conflicts so you can review the plan and abort; pass `--yes` to skip the prompt and apply unconditionally.

#### JSON mode

In JSON mode the plan is always emitted as the first document. If neither `--dry-run` nor `--diff` is set and the plan does not require explicit confirmation, the executed result is emitted as a second JSON document.

#### Examples

```
# Commands
# Preview what would change
dr artifact code sync --dry-run

# Preview with per-file diffs
dr artifact code sync --diff

# Push and pull; prompt on conflicts
dr artifact code sync

# Push and pull non-interactively
dr artifact code sync --yes
```

### dr artifact code versions

List the catalog version history for the artifact this project directory is linked to.

```
dr artifact code versions [--dir <path>] [--limit <n>] [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| --dir <path> | Project directory. Defaults to the current directory. |
| --limit <n> | Maximum number of versions to return. Defaults to 100. Must be a positive integer. |
| --output-format <text\\|json> | Output format. Defaults to text. |

#### Output

The output marks the version that the artifact's `codeRef` currently points to with `*` and reports which version the local `.wapi/` state was last synced to. This makes drift visible at a glance: a `*` next to a version other than the last-synced one means a `sync` would update local files.

#### Prerequisites

- The directory must be linked via dr artifact code init . Otherwise: not linked to an artifact. Run 'dr artifact code init <id>' first .
- At least one sync must have happened so the linked catalog has a version. Otherwise: no code has been synced yet. Run 'dr artifact code sync' first .

#### Examples

```
# Commands
dr artifact code versions
dr artifact code versions --limit 10
dr artifact code versions --output-format json
```

### dr artifact code checkout

Download a specific catalog version into `.wapi/.checkouts/<version-id>/` for read-only inspection. The working directory and `.wapi/` sync state are never modified.

```
dr artifact code checkout [<version-id>] [--dir <path>] [--clean] [-y|--yes] [--output-format text|json]
```

| Argument/Flag | Description |
| --- | --- |
| <version-id> | Full version ID or any unique prefix. If omitted (and --yes is not set), you'll be prompted. |
| --dir <path> | Project directory. Defaults to the current directory. |
| --clean | Remove checkout directories instead of downloading. No positional argument removes all checkouts; a positional argument removes only the matching one. |
| -y, --yes | Skip interactive prompts. |
| --output-format <text\\|json> | Output format. Defaults to text. |

#### Examples

```
# Commands
# Prompt for a version, then download
dr artifact code checkout

# Download a specific version (full ID or any unique prefix)
dr artifact code checkout abcdef12

# Download into a different project directory
dr artifact code checkout abcdef12 --dir ./service

# Remove all checkouts
dr artifact code checkout --clean

# Remove a single checkout
dr artifact code checkout abcdef12 --clean
```

## Error handling

| Error | Cause and resolution |
| --- | --- |
| not authenticated | Run dr auth login first; every dr artifact command requires authentication. |
| invalid spec: required field 'name' is missing or empty | The spec file's name is missing or empty. Add a non-empty string. |
| invalid spec: 'spec.containerGroups' must contain at least one entry | The spec.containerGroups array is empty. Add at least one group. |
| file not found: <path> | The --spec-file path does not exist. Check the path. |
| invalid status "...": use draft or locked | The --status value passed to artifact list is not one of the accepted values. |
| artifact <id> not found | The artifact ID does not exist. Check the ID with dr artifact list. |
| artifact is locked (immutable); cannot init on a registered artifact | Locked artifacts cannot be linked or modified. Create a new draft artifact with dr artifact create. |
| not linked: run 'dr artifact code init <artifact-id>' first | The directory has no .wapi/ state. Run dr artifact code init first. |
| init aborted: project already linked | The directory already has a .wapi/ state. Use dr artifact code sync or remove .wapi/ to re-link. |
| no code has been synced yet. Run 'dr artifact code sync' first | The linked artifact has no catalog version yet. Run sync to upload code. |

## Exit codes

| Code | Meaning |
| --- | --- |
| 0 | Success. |
| 1 | Error (validation failed, API error, conflict, not authenticated, etc.). |
| 130 | Interrupted (Ctrl+C). |
