Back to Prefect

artifact

docs/v3/api-ref/python/prefect-cli-artifact.mdx

3.8.01.8 KB
Original Source

prefect.cli.artifact

Artifact command — native cyclopts implementation.

Inspect and delete artifacts.

Functions

list_artifacts <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/artifact.py#L29" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
list_artifacts()

List artifacts.

inspect <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/artifact.py#L107" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
inspect(key: str)

View details about an artifact.

Examples:

$ prefect artifact inspect "my-artifact" --output json

json
[
  {
    "id": "ba1d67be-0bd7-452e-8110-247fe5e6d8cc",
    "created": "2023-03-21T21:40:09.895910+00:00",
    "updated": "2023-03-21T21:40:09.895910+00:00",
    "key": "my-artifact",
    "type": "markdown",
    "description": null,
    "data": "my markdown",
    "metadata_": null,
    "flow_run_id": "8dc54b6f-6e24-4586-a05c-e98c6490cb98",
    "task_run_id": null
  },
  {
    "id": "57f235b5-2576-45a5-bd93-c829c2900966",
    "created": "2023-03-27T23:16:15.536434+00:00",
    "updated": "2023-03-27T23:16:15.536434+00:00",
    "key": "my-artifact",
    "type": "markdown",
    "description": "my-artifact-description",
    "data": "my markdown",
    "metadata_": null,
    "flow_run_id": "ffa91051-f249-48c1-ae0f-4754fcb7eb29",
    "task_run_id": null
  }
]

delete <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/artifact.py#L191" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
delete(key: Annotated[Optional[str], cyclopts.Parameter(help='The key of the artifact to delete.')] = None)

Delete an artifact.

Examples:

bash
$ prefect artifact delete "my-artifact"