RADR CLI
Command Line Interface (CLI) application to manage Architecture Decision Records (ADRs)
Overview
- Purpose: Manage Architecture Decision Records (ADRs) from the command line.
- Commands: create, supersede, list, accept, reject, reformat, and maintain an
index.mdfile. - Supported config formats: JSON, YAML, or TOML file to choose ADR location and template.
Installation
Install via cargo
- Requires: Rust toolchain (
cargo+rustc). - Install:
cargo install radr-cli - Run:
radr --help
Install via source
- Clone and navigate to the project
- Build from source:
cargo build --release - Install locally:
cargo install --path . - Run built binary:
target/release/radr --help
Install via prebuilt binaries
- Download from GitHub Releases: navigate to the latest tag and grab the asset matching your OS/arch, e.g.:
- Linux:
radr-cli-vX.Y.Z-x86_64-unknown-linux-gnu.tar.gz(alsoaarch64,armv7,i686). Static builds are available as*-unknown-linux-muslfor maximum portability. - macOS:
radr-cli-vX.Y.Z-{x86_64|aarch64}-apple-darwin.tar.gz - Windows:
radr-cli-vX.Y.Z-{x86_64|i686|aarch64}-pc-windows-msvc.zip
- Linux:
- Example (Linux x86_64):
tar -xzf radr-cli-vX.Y.Z-x86_64-unknown-linux-gnu.tar.gz./radr --help
- Example (Windows PowerShell):
Expand-Archive radr-cli-vX.Y.Z-x86_64-pc-windows-msvc.zip -DestinationPath ../radr.exe --help
Usage
- New ADR:
radr new "Adopt PostgreSQL"(default status: Proposed) - Supersede ADR:
radr supersede 3 "Move to Managed PostgreSQL" - Supersede with force:
radr supersede 3 "Redo Supersede" --force(allows superseding an ADR even if it is already superseded) - Reject ADR:
radr reject 3orradr reject "Adopt PostgreSQL" - List + regenerate index:
radr listorradr index - Reformat one ADR to current config:
radr reformat 3 - Reformat all ADRs to current config:
radr reformat --all - Use config:
radr --config radr.toml listorRADR_CONFIG=radr.yaml radr list
Index
- Written to
<adr_dir>/index.md. - Lists all ADRs (active and superseded) with number, title, status, and date.
Config
- Search order:
--configpath →RADR_CONFIGenv → local filesradr.toml|yaml|yml|jsonor.radrrc.*. - Fields:
adr_dir(string): Directory where ADRs live. Default:docs/adr.index_name(string): Name of the index file. Default:index.md.template(string): Optional path to a custom template.format(string):mdormdxfor new ADRs. Default:md.front_matter(bool): If true, uses a YAML front matter block with only thetitle;Date,Status, and superseding info are written in the body. Default:false.
Examples
- TOML (
radr.toml)
adr_dir = "docs/adr"
index_name = "index.md"
template = "adr_template.md"
format = "mdx" # or "md"
front_matter = true # include YAML front matter
- YAML (
radr.yaml)
adr_dir: docs/adr
index_name: index.md
template: adr_template.md
format: mdx
front_matter: true
- JSON (
radr.json)
{
"adr_dir": "docs/adr",
"index_name": "index.md",
"template": "adr_template.md",
"format": "mdx",
"front_matter": true
}
Template
- If
templateis set, these placeholders are interpolated:{{NUMBER}},{{TITLE}},{{DATE}},{{STATUS}},{{SUPERSEDES}}(empty if none)
ADR Format
- Default file format created:
# ADR 0001: Example Title
Date: 2025-01-01
Status: Accepted
Supersedes: 0003
## Context
## Decision
## Consequences
- On supersede, the older ADR is updated with:
Status: Superseded by 000XSuperseded-by: 000X
With front matter (mdx example)
---
title: Example Title
---
Date: 2025-01-01
Status: Accepted
Supersedes: [0003](0003-previous-decision.mdx)
## Context
## Decision
## Consequences
Reformat command
radr reformat 3converts ADR 0003 to match the currentformat(mdormdx) andfront_mattersettings.radr reformat --allconverts all ADRs.- When file extensions change, the index and any
Supersedes: [NNNN](...)links in other ADRs are updated to point to the new filenames.
Notes
- Filenames are
NNNN-title-slug.mdwith zero-padded numbering. radr listregenerates the index and prints a terse table to stdout.- Works on Windows, macOS, and Linux paths.