Arbitrary metadata

Managing arbitrary metadata via the Cloudsmith CLI

Early Access

Arbitrary metadata is currently available in early access for Ultra and Enterprise customers. To request early access, contact us.

You can add, view, update, and delete arbitrary key-value metadata for a package by using the cloudsmith push command, or the cloudsmith metadata command group.

cloudsmith push command

Every cloudsmith push <format> subcommand now supports five metadata flags:

FlagInput
--metadata-content-fileThe path to a file containing the metadata payload as a JSON object, or - for stdin.
--metadata-contentThe metadata payload as a JSON object.
--metadata-content-typeThe schema of the metadata payload. For example, application/json.
--metadata-source-identityThe identifier for the source of the metadata entry.

Default: cloudsmith-cli@<version>
--on-metadata-failureThe metadata failure mode: error or warn (defaults to error)

Determines how validation/attach failures are handled.

The CLI validates the payload locally before any file upload starts.

  • If validation passes, the package is uploaded and metadata is attached in a single command.
  • If validation or attachment fails, the push aborts with the HTTP status as the exit code, so CI surfaces broken metadata immediately.

Examples

Push a new package with metadata:

bash
cloudsmith push raw ${ORG}/${REPO} payload.txt \
--name metadata-demo \
--metadata-content '{"build_id": "demo-inline", "git_sha": "abc123"}' \
--metadata-content-type application/json

Push a new package with metadata, downgrading failures via the --on-metadata-failure flag:

bash
cloudsmith push raw ${ORG}/${REPO} payload.txt \
--name metadata-demo \
--metadata-content-file metadata.json \
--metadata-content-type application/json \
--on-metadata-failure warn

Push a new package with metadata, downgrading failures by using an environment variable:

bash
CLOUDSMITH_METADATA_FAILURE_MODE=warn cloudsmith push raw ${ORG}/${REPO} payload.txt \
--name metadata-demo \
--metadata-content-file metadata.json \
--metadata-content-type application/json

To set the metadata failure mode persistently, add the following to ~/.cloudsmith/config.ini:

bash
[default]
metadata_failure_mode = warn

cloudsmith metadata command group

You can add, view, update, and delete arbitrary key-value metadata for an existing package by using the cloudsmith metadata command group:

CommandDescriptionFlags accepted
cloudsmith metadata addAttach a new metadata entry to an existing package.--content-type,
--source-identity,
--content or --file
cloudsmith metadata updateReplace the content or source-identity fields of a metadata entry.--content or --file, and --source-identity
cloudsmith metadata listList metadata entries for a package. Filter by source kind and classification, with paginated results.--source-kind and --classification
cloudsmith metadata removeRemove a specific metadata entry from a package.-y or --yes

cloudsmith metadata remove prompts for confirmation by default; use the -y or --yes flag to skip the prompt.

Attaching key-value metadata to a package

To add key-value metadata to an existing package, use the cloudsmith metadata add command with the following flags:

Command flagDescription
--content-typeThe content type describing the structure of the metadata payload. For example, application/json.
--source-identityThe identifier for the source of this metadata. For example, upstream:npmjs.
--content or --fileThe metadata payload as a JSON object, or the path to a file containing the metadata payload.
--output-formatCommand output formatting style.

Supported formats: json and pretty_json

Example:

bash
cloudsmith metadata add your-org/example-repo/package_slug_perm \
  --content-type application/json \
  --source-identity ci:release-42 \
  --content '{"release":"2026.06","commit":"abc123"}'

Update a metadata entry for a package

You can replace the source-identity and content values of a specific metadata entry by using the cloudsmith metadata update command.

Warning

Updating the metadata will replace the current values for the specified fields.

If you want to update the content field, you must also resubmit the key-value pairs that you want to retain unchanged.

Example:

bash
cloudsmith metadata update example-org/example-repo/package_slug_perm metadata_slug_perm \
  --content '{"release":"2026.05","commit":"def456"}'

View metadata for a package

You can list all of the metadata entries for a package, or retrieve a single entry by its slug_perm.

List all metadata entries for a package:

bash
cloudsmith metadata list your-org/your-repo/package_slug_perm

Retrieve a single metadata entry by using its slug_perm:

bash
cloudsmith metadata list your-org/your-repo/package_slug_perm metadata_slug_perm

Filter metadata for a package

The metadata list command supports filtering by --classification and --source-kind.

Note

Customer-provided key-value metadata has the GENERIC classification and the CUSTOM source kind.

List all metadata entries for a package which have the GENERIC classification:

bash
cloudsmith metadata list your-org/your-repo/package_slug_perm --classification GENERIC

Remove metadata from a package

You can remove a specific metadata entry from a package by using the slug_perm for the entry:

bash
cloudsmith metadata remove your-org/your-repo/package_slug_perm metadata_slug_perm

Search for packages with metadata filters

The cloudsmith list packages command supports a metadata: search filter.

For more information about searching packages via the CLI, see Searching packages via the Cloudsmith CLI.