tag

Assign or remove a tag from an image. Tags are human-readable names that make images easier to reference.

Examples

# Tag an image
contree tag 3f2a7b... my-app:v1.0

# Remove a tag
contree tag 3f2a7b... my-app:v1.0 --delete

# Use the tagged image
eval $(contree use tag:my-app:v1.0)

Help output

$ contree tag --help usage: contree tag [-h] [-U] ARG [ARG ...] Assign or remove a tag from an image. Tags provide human-readable names for image UUIDs, making them easier to reference in commands like `contree use tag:NAME`. With one argument, tags the current session image. With two arguments, the first is the image reference and the second is the tag. Use -d/--delete to remove a tag instead of assigning one. positional arguments:   ARG                 TAG (current image) or IMAGE_REF TAG options:   -h, --help          show this help message and exit   -U, --delete, --rm  Remove tag from image examples:   contree tag python-dev:latest            # tag current session image   contree tag UUID python-dev:latest       # tag specific image by UUID   contree tag tag:alpine:latest my-alpine  # re-tag by reference   contree tag -d UUID my-tag               # remove a tag for coding agents:   mutating command   default action assigns tag; use --delete to remove mapping agent note:   Before using this command in an automated workflow, read:     contree agent

Usage

Tags are free-form strings. A common convention is scope/purpose:version:

contree tag UUID ubuntu-with-curl:latest
contree tag UUID my-project/dev-env:v2

Once tagged, reference the image anywhere with the tag: prefix:

contree use tag:ubuntu-with-curl:latest

Tagging an image that already has a different tag replaces the old tag.

See also