by iterative.ai
Get started
Edit on GitHub

Command Reference: asset publish

cml asset publish [options] <asset file>

Upload a file, such as an image, and print a URL for embedding it in a CML report. cml comment create does this automatically for local files linked from the report.

The default server, asset.cml.dev, no longer accepts uploads. Use --native on GitLab and Bitbucket, or --url with your own server. See Image Hosting.

Options

Any generic option in addition to:

  • --md: Produce output in Markdown format.
  • -t=<...>, --title=<...>: Title for Markdown output.
  • --mime-type=<...>: Content MIME type [default: inferred from content].
  • --native: Upload to the CI provider's own storage (GitLab and Bitbucket only).
  • --url=<...>: Self-hosted image server URL, also read from the CML_ASSET_URL environment variable.

Examples

To render an image in a Markdown file, using your own image server:

$ export CML_ASSET_URL="https://images.example.com/?token=..."
$ cml asset publish ./plot.png --md >> report.md

On GitLab or Bitbucket, using the provider's storage:

$ cml asset publish --native ./plot.png --md >> report.md
Content

๐Ÿ› Found an issue? Let us know! Or fix it:

Edit on GitHub

โ“ Have a question? Join our chat, we will help you:

Discord Chat