A conventional changelog for the rest of us.
cclog is a fork of clog-lib and
clog-cli, merged into a single
Cargo workspace and modernized for Rust 2024 edition.
| Crate | Description |
|---|---|
cclog |
Library for generating changelogs from git metadata |
cclog-cli |
Command-line tool wrapping the library |
Every time you make a commit, ensure your subject line follows the conventional commit format:
type(component): message
Then run cclog to generate a changelog from your git history.
Supported commit types include feat, fix, perf, and
custom sections. Empty components are also supported:
feat: message or feat(): message.
cargo install cclog-cliOr build from source:
cargo build --release -p cclog-cliUsage: cclog [OPTIONS]
Options:
-r, --repository <URL> Repository URL for commit/issue links
-f, --from <COMMIT> Starting commit (e.g. 12a8546)
-t, --to <COMMIT> Ending commit [default: HEAD]
-T, --format <STR> Output format: markdown or json [default: markdown]
-M, --major Increment major version (sets minor and patch to 0)
-m, --minor Increment minor version (sets patch to 0)
-p, --patch Increment patch version
--setversion <VER> Set version explicitly (e.g. 1.0.1)
-F, --from-latest-tag Use latest tag as start (instead of --from)
-o, --outfile <PATH> Write changelog to file (defaults to stdout)
-i, --infile <PATH> Append old changelog data after new entries
-C, --changelog <PATH> Read and prepend to existing changelog
-c, --config <FILE> Config file [default: .clog.toml]
-s, --subtitle <STR> Release subtitle
-g, --git-dir <PATH> Path to .git directory
-w, --work-tree <PATH> Path to git working tree
-l, --link-style <STR> Link style: github, gitlab, stash, cgit [default: github]
-h, --help Print help
-V, --version Print version
Generate a changelog from the latest tag:
cclog -r https://github.com/user/repo --from-latest-tag --changelog CHANGELOG.mdBump patch version and write to stdout:
cclog -r https://github.com/user/repo --patch --from-latest-tagCreate a .clog.toml in your repository root:
[clog]
repository = "https://github.com/user/repo"
changelog = "CHANGELOG.md"
link-style = "github"
from-latest-tag = trueSee lib/examples/clog.toml for all available options.
By default, three sections are shown: Features, Performance, and
Bug Fixes. Add more via .clog.toml:
[sections]
"Breaking Changes" = ["break", "breaking"]
Refactoring = ["refactor", "ref"]Then commits like break(parser): remove deprecated API will appear under
"Breaking Changes".
Add cclog to your Cargo.toml:
[dependencies]
cclog = "0.12"use cclog::Clog;
fn main() {
let clog = Clog::with_git_work_tree(".")
.unwrap()
.repository("https://github.com/user/repo")
.subtitle("My Release")
.changelog("CHANGELOG.md")
.from("v0.1.0")
.version("0.2.0");
clog.write_changelog().unwrap();
}See the API docs for full details.
MIT — see LICENSE for details.