Clover: Manage version strings across arbitrary files

gechr1 pts0 comments

Home - clover

Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Auto

Light

Dark

clover

clover

Clover keeps version references synchronized with their upstream sources of truth. You annotate a line with a clover: comment describing where its version comes from, and Clover resolves the latest matching version and rewrites the line in place. It works across Dockerfiles, YAML, HCL, shell, Markdown, and any other text format.

How it works

Place a clover: annotation in an ordinary comment next to the line you want kept up to date:

# clover: provider=github repository=redis/redis constraint=minor<br>FROM redis:7.2.0

Clover scans your files, finds every annotation, resolves each one against its provider, and updates the adjacent line, deterministically and atomically. Lines without a clover: comment are never touched.

Installation

macOS / Linux

brew install gechr/tap/clover

Windows

scoop bucket add gechr https://github.com/gechr/scoop-bucket<br>scoop install gechr/clover

Go

go install github.com/gechr/clover@latest

Quick start

# create a starter .clover.yaml interactively<br>clover init

# dry-run: resolve and preview, write nothing<br>clover run --dry-run

# resolve references and update them in place<br>clover run

# check every directive resolves, offline, no writes<br>clover lint

# canonicalize directive comments<br>clover format

clover gechr version press line comment

Related Articles