Skip to content

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 LiveRevisionNum     Tag the live revision
  --revision LastAppliedRevisionNum  Tag the last applied revision
  --revision PreviousLiveRevisionNum Tag the previous live revision
  --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 live revision of all units with specific label
  cub unit tag release-v1 --revision LiveRevisionNum --where "Labels.version = 'v1'"

  # 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: HeadRevisionNum, LiveRevisionNum, LastAppliedRevisionNum, PreviousLiveRevisionNum, Remove, or - (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, ILIKE, ~~, !~~, ~, ~*, !~, !~*. Pattern matching with LIKE/ILIKE uses % and _ wildcards. Regex operators (~, ~*, !~, !~*) support POSIX regular expressions. 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