cub unit tag
cub unit tag
Add or remove tags to/from unit revisions (supports space/tag syntax)
Synopsis
Add or remove tags to/from unit revisions using bulk operations.
This command allows you to tag specific revisions of units with a tag identifier. Use bulk selection options to tag multiple units at once.
Tag a specific revision type:
--revision HeadRevisionNum Tag the head revision (default)
--revision LastReleasedRevisionNum Tag the last released revision
--revision 42 Tag revision 42
--revision Tag:release-v1 Tag the revision another tag marks
--revision ChangeSet:rollout Tag the revision a changeset ended on
--revision Before:Tag:release-v1 Tag the revision before another tag's
--revision Remove Remove the tag from the revision
--revision - Remove the tag (shorthand for Remove)
Examples:
# Tag head revision of a single unit (uses current space)
cub unit tag my-tag --unit my-unit
# Tag the last released revision of all units with specific label
cub unit tag release-v1 --revision LastReleasedRevisionNum --where "Labels.version = 'v1'"
# Tag whatever revision a changeset ended on, across the units it touched
cub unit tag release-v1 --revision ChangeSet:rollout --where "Space.Slug = 'prod'"
# Remove tag from units
cub unit tag my-tag --revision Remove --unit my-unit,another-unit
# Remove tag using shorthand
cub unit tag my-tag --revision - --where "Labels.cleanup = 'true'"
# Tag units across all spaces (requires --space "*") with space/tag syntax
cub unit tag production/prod-release --space "*" --where "Labels.env = 'production'"
# Use space/tag syntax to target tag in specific space
cub unit tag dev-space/dev-tag --unit my-unit
cub unit tag <tag-slug-or-id> [flags]
Options
--filter string Filter entity to apply to the list. Specify as 'space/filter' for cross-space filters or just 'filter' for current space. Supports both slugs and UUIDs. The filter will be combined with any --where clause using AND logic. Examples: "production-filters/security-check", "my-filter-uuid", "validation-rules"
-h, --help help for tag
--revision string Which revision to tag: a named revision (HeadRevisionNum, LastReleasedRevisionNum), a revision number, a tag slug, Tag:slug, ChangeSet:slug, ChangeOrder:slug, any of those prefixed with Before:, or Remove (-) to remove the tag (default "HeadRevisionNum")
--unit strings target specific units by slug or UUID for bulk tag (can be repeated or comma-separated)
--where string Filter expression using SQL-inspired syntax. Supports conjunctions with AND. String operators: =, !=, <, >, <=, >=, LIKE, NOT LIKE, ILIKE, ~~, !~~, ~, ~*, !~, !~*. Pattern matching with LIKE/ILIKE uses % and _ wildcards. Regex operators (~, ~*, !~, !~*) support POSIX regular expressions. A related entity is referenced by prefix, as in "UpstreamUnit.Slug = 'base'"; when the reference names a list, a * segment matches any element, as in "FromLink.*.Slug = 'upgrade-app'". Examples: "Slug LIKE 'app-%'", "DisplayName ILIKE '%backend%'", "Slug ~ '^[a-z]+-[0-9]+$'"
Options inherited from parent commands
--context string The context to use for this command
--debug Debug output
--space string space ID to perform command on
SEE ALSO
- cub unit - Unit commands