Update Badges
Refresh the badges in your README.md from nova.config.json.
Summary
The update-badges recipe rewrites the badges of a README.md file so the npm, Docker, GitHub, and funding shields stay in sync with nova.config.json. It reuses the exact builder the generate must-haves read-me command uses, so the spliced badges are byte-identical to a freshly generated region.
The recipe only touches the marked region. Everything before the <!-- nova-region: badges --> marker and everything after the <!-- nova-region-end: badges --> marker is left byte-identical, so hand-written prose around the badges is never disturbed.
Why Use This Command?
- Refreshes the exact ordered badges selected in
readme.badgesfrom one configuration source. - Rewrites only Nova's badges region so surrounding README prose remains untouched.
- Makes badge changes repeatable when package or repository URLs move.
Requirements
- An existing
README.md— The recipe updates a file in the project root; it does not create one. Usegenerate must-haves read-meto create the initial file. - The
badgesregion markers — TheREADME.mdmust contain the<!-- nova-region: badges -->and<!-- nova-region-end: badges -->markers. Agenerate must-haves read-mefile has them by default. - Badge selection — Configure
readme.badgeswith the exact ordered identifiers to render, or use an empty array to clear the region. - Badge inputs — Selected npm, Docker, GitHub, and funding badges require their corresponding source fields in
nova.config.json.
Behavior
The recipe follows an in-place splice so it can only ever rewrite the region it owns.
- Region gate — The
badgesregion markers must both be present and correctly ordered. If the markers are absent, misordered, or theREADME.mdwas not generated by Nova, the recipe warns that the region markers were not found and returns without writing. - Region-only splice — Only the content between the markers is replaced. The markers and all content outside them are preserved exactly.
- Empty selection — When
readme.badgesis missing or empty, the recipe clears the content inside the badges region while preserving its markers. - Idempotent — When the regenerated badges already match the file on disk, the recipe reports that the badges are already up to date and makes no write.
Settings
Settings are configured in nova.config.json under the recipes.read-me key. The update-badges recipe is controlled by a single enabled toggle:
{
"recipes": {
"read-me": {
"update-badges": {
"enabled": true
}
}
}
}
When the recipe is not enabled, it warns and returns without touching any files.
Usage
Options
| Flag | Description |
|---|---|
-d, --dry-run | Run without writing any files. |
-r, --replace-file | Replace the original file without creating a backup. |