Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

madr-tools

nioe929ISC1.2.5

Node.js CLI to to create and manage Markdown Architectural Decision Records (MADR)

adr, madr, cli, architecture, decision, documentation, docs, markdown

readme

madr-tools

Node.js CLI tools to help you create and manage Markdown Architectural Decision Records (MADR).
The famous ADR Tools have been taken as a role model for this Node.js port.

Installation

Within specific project (recommended):

npm i -D madr-tools

Globally:

npm i -g madr-tools

Usage

Run npx madr --help to get an overview and description for all available commands. Each command provides another, more detailed help. E.g. npx madr init --help.

Initialization

Run the following command within the root directory of your repository to initialize the MADR directory and config file.

npx madr init [optional path] [-i readme.md]

By default, the MADR directory will be created under docs/decisions. You can specify a custom directory by providing the relative path as the first positional argument.
Furthermore, the overview over all MADRs is written to a file called index.md by default as the official MADR Documentation suggests. However, when watching the directory within a web-based Git repo (e.g. GitHub or GitLab), it will automatically render the readme.md file within the directory. Therefore, it's possible to use readme.md instead of index.md as the file name by setting the -i readme.md option.

Creating a new MADR

Run the following command to create a new MADR-File.

npx madr new <title>

e.g.

npx madr new "A very important decision"

It will create a new MADR file within the configured directory based on the template.md file. Furthermore, it updates the MADR log.

Updating the MADR Log

When you change the filename or title of a MADR, it is possible to trigger an update of the log manually by running

npx madr index

Contribution

Every contribution to this project is more than welcome. Just follow these rules:

  • The repo uses Conventional Commits to create semantic versions
  • The codebase should automatically be reformatted using Prettier in a pre-commit hook. Therefore, it should be pretty hard to commit something which is not well formatted... 😅
  • Create a PR once you have finished your feature

Local development

  • Clone the repo
  • Install the dependencies npm i
  • Run the build npm run build
  • Locally link the bin script npm link
  • Afterwards, you should be able to run madr --help in your favorite console

changelog

Changelog

1.2.5 (2025-03-20)

🐛 Bug Fixes

  • Fix __dirname issue with ESModule (fixes #140) (607452f)

📦 Build System & Dependencies

  • deps-dev: Bump @typescript-eslint/parser from 8.18.0 to 8.26.1 (1fada8f)
  • deps-dev: Bump esbuild from 0.24.0 to 0.25.1 (c4cd1d3)
  • deps-dev: Bump eslint from 9.16.0 to 9.22.0 (#134) (6721637)
  • deps-dev: Bump typescript-eslint from 8.18.0 to 8.26.1 (6103b2a)
  • deps: Update dependencies (87948bd)

1.2.4 (2024-12-16)

📦 Build System & Dependencies

  • deps-dev: Bump @eslint/js from 9.16.0 to 9.17.0 (263c208)
  • deps-dev: Bump @types/node from 22.10.1 to 22.10.2 (754c9ed)
  • deps-dev: Bump @typescript-eslint/eslint-plugin from 8.17.0 to 8.18.0 (8d64160)
  • deps-dev: Bump @typescript-eslint/parser from 8.17.0 to 8.18.0 (4b08cf3)
  • deps-dev: Bump typescript-eslint from 8.17.0 to 8.18.0 (6a4ec8f)

1.2.3 (2024-12-09)

📦 Build System & Dependencies

  • deps: Update dependencies (5edc3c4)

1.2.2 (2024-11-07)

📦 Build System & Dependencies

  • deps-dev: Bump @types/node from 20.16.5 to 22.8.7 (a959dbe)
  • deps-dev: Bump @typescript-eslint/eslint-plugin from 8.8.0 to 8.13.0 (d9af752)
  • deps-dev: Bump @typescript-eslint/parser from 8.5.0 to 8.13.0 (9756fdb)
  • deps-dev: Bump typescript from 5.6.2 to 5.6.3 (49fc3c9)
  • deps-dev: Bump typescript-eslint from 8.8.0 to 8.12.2 (3808a58)

1.2.1 (2024-10-07)

📖 Documentation

  • Fix several typos in readme (84c158d)

📦 Build System & Dependencies

  • Add eslint dev deps (dc0288d)
  • deps-dev: Bump @eslint/js from 9.10.0 to 9.12.0 (7ac0b4c)
  • deps-dev: Bump @typescript-eslint/eslint-plugin from 8.5.0 to 8.8.0 (f2e5e96)
  • deps-dev: Bump esbuild from 0.23.1 to 0.24.0 (c278064)
  • deps-dev: Bump eslint from 9.10.0 to 9.12.0 (2c55e5c)
  • deps-dev: Bump typescript-eslint from 8.5.0 to 8.8.0 (763d79c)

1.2.0 (2024-09-16)

🚀 Features

  • Change built package from CJS to ESM (fbc5cfe)

1.1.3 (2024-07-26)

🐛 Bug Fixes

  • Update GitHub URL in package.json to madr-tools (b4174b1)

1.1.2 (2024-07-22)

📦 Build System & Dependencies

  • deps-dev: Bump husky from 9.0.11 to 9.1.1 (e51420f)
  • deps-dev: Bump prettier from 3.3.2 to 3.3.3 (028545a)

1.1.1 (2024-07-18)

📦 Build System & Dependencies

  • Add dependabot (b395524)
  • deps-dev: Bump @types/node from 20.14.10 to 20.14.11 (ed3c1ff)
  • deps-dev: Bump @typescript-eslint/eslint-plugin from 7.15.0 to 7.16.1 (81e2565)
  • deps-dev: Bump @typescript-eslint/parser from 7.15.0 to 7.16.1 (e92968a)
  • deps-dev: Bump eslint-plugin-prettier from 5.1.3 to 5.2.1 (1482e0a)
  • deps-dev: Bump rimraf from 5.0.8 to 6.0.1 (7496af3)
  • Enable tree shaking (9464623)

1.1.0 (2024-07-08)

🚀 Features

  • Bundle dependencies to make CLI work without installing additional packages (0cb0326)

1.0.1 (2024-07-08)

🐛 Bug Fixes

  • Make finding correct title work on Windows with CRLF (01e356c)

📦 Build System & Dependencies

1.0.0 (2022-02-15)

📖 Documentation

0.0.2 (2022-02-14)

🔄 CI/CD

  • Only run build script on branches (not tags) (50c877e)

📖 Documentation

0.0.1 (2022-02-14)

🚀 Features

  • Add 'new' command to create new MADR files based on tempalte (1c7dfca)
  • Add first version of init command (5530432)
  • Add tools and cli skeleton (4745d98)
  • Introduce command to create and update index file (726827b)

🔄 CI/CD

  • Add GitHub workflow to build and publish npm package (1bb4bc3)
  • Remove dry-run flag from publish step (9cfb3fa)

📖 Documentation