Badges
Generate shields.io-style SVG badges from your metrics data:
velocirepo badge stars -o stars.svg
velocirepo badge forks --project quarto -o forks.svg
velocirepo badge downloads --project ggplot2 -o downloads.svgPresets
| Badge | Value |
|---|---|
stars |
Latest total_stars of each GitHub repository |
forks |
Number of GitHub fork events |
downloads |
All-time sum of daily_downloads (PyPI and CRAN) |
pageviews |
All-time sum of daily_site_pageviews (Plausible) |
With --project, a preset only counts that project’s data. A preset with no data shows 0. OpenVSX downloads are a total_downloads series (only changes are stored), so use a custom badge for those. For a single extension: SELECT MAX(value) AS value FROM metrics WHERE metric = 'total_downloads'.
Custom badges
For custom metrics, provide a SQL query that returns a single value:
velocirepo badge custom \
--label "contributors" \
--query "SELECT COUNT(DISTINCT \"user\") AS value FROM events" \
--color "#ea7233" \
-o contributors.svgStyles
Three styles are available via --style:
| Style | Description |
|---|---|
flat (default) |
Subtle gradient, rounded corners |
flat-square |
No gradient, sharp corners |
plastic |
Heavy gradient, more rounded |
Options
| Flag | Default | Description |
|---|---|---|
--project |
all | Scope to a specific project |
--style |
flat |
Badge style |
--color |
preset-dependent | Message background color (hex) |
--label-color |
#555 |
Label background color |
--label |
preset-dependent | Override label text |
--height |
style-dependent | Badge height in pixels |
--radius |
style-dependent | Corner radius (0 = square) |
-o |
stdout | Output file path |
Numbers are automatically formatted for readability (e.g., 5274 becomes 5.3k, 1500000 becomes 1.5M).