badge
snug badge <COMMAND>Badge template registry, rendering, and verification.
Subcommands
| Command | What it does |
|---|---|
template-add | Create a badge template from a JSON definition file |
template-list | List badge templates |
template-get | Get a badge template by id |
template-version | Create a new version of an existing template |
template-activate | Activate a template version (sets it as the active version) |
template-deprecate | Deprecate a template version |
template-disable | Disable a template version (renders are rejected) |
template-visibility | Set template visibility (public or private) |
cache-purge | Purge all cached renders for a template |
public-key | Show the service Ed25519 verification public key |
template-metrics | Show render and cache metrics for a template |
source-add | Register a state source from a JSON definition file |
source-list | List registered state sources |
render | Render a badge by template id |
verify | Verify signed badge metadata from a JSON file |
Run snug badge <command> --help for that command's own options.
The global options apply everywhere.
Examples
snug badge template-add --file status-template.json --activate --public
snug badge template-list --filter 'status[eq]=active'
snug badge template-get bdg_tpl_service_status --include-versions
snug badge template-version bdg_tpl_service_status --file status-v2.json --activate
snug badge template-activate bdg_tpl_service_status --version 2
snug badge template-deprecate bdg_tpl_service_status --version 1
snug badge template-disable bdg_tpl_service_status
snug badge template-visibility bdg_tpl_service_status --visibility public
snug badge source-add --file leaderboard-rank-source.json
snug badge source-list --limit 20
snug badge render --id bdg_tpl_service_status --param service_id=snug-api --param label=api
snug badge render --id bdg_tpl_service_status --version 3 --output status.svg
snug badge render --id bdg_tpl_service_status --param state=passing --include-metadata
snug badge verify --metadata badge-metadata.json
snug badge public-key
snug badge template-metrics bdg_tpl_service_status
snug badge cache-purge bdg_tpl_service_statusNext
- badge guide - what the service does and when to reach for it.
- API reference - every endpoint these commands call.
- CLI reference - global options, output modes, and exit codes.
Workspace and permission options
The JSON files accepted by template-add and source-add may set workspace_id
and access_visibility (private or workspace). Omitting them creates a private
resource in the organization's default root workspace. Template visibility
(private or public) separately controls anonymous SVG rendering.
Share through the existing Access commands:
snug access grant --target badge-templates --id "$TEMPLATE_ID" \
--subject-kind user --subject-id "$USER_ID" --role reader
snug access revoke --target badge-templates --id "$TEMPLATE_ID" \
--subject-kind user --subject-id "$USER_ID" --role readerUse badge-sources to share a source definition. Raw state sources require a
current tenant administrator and a tenant-qualified Redis key. A source must
explicitly set public_render: true before an anonymous badge can use it.
