@varlabs/anchor
Anchor is a lightweight CLI tool to enforce and validate release checklists in development workflows. Inspired by changesets, Anchor ensures all non-code changesβespecially environment-specific configurationsβare explicitly reviewed before release.
npm i @varlabs/anchoryarn add @varlabs/anchorpnpm add @varlabs/anchorbun add @varlabs/anchorπ¦ Features
β Checklist generation for pull requests/releases
π§Ύ Markdown-based checklists with frontmatter metadata
π All config and state stored in
.anchor/π Enforces checklist presence and completion before release
π§ Human-readable checklist names
π§ͺ Built-in validation of checklist structure
π οΈ Fully interactive CLI prompts
ποΈ Works seamlessly with Git Hooks and CI pipelines
βοΈ Setup
Run this command once in your project to initialize Anchor:
anchor setupYou will be prompted to enter a comma-separated list of environments (e.g., dev, staging, prod) and (optionally) a comma-separated list of project - for monorepos. This creates:
.anchor/
βββ config.json # Contains
βββ checklists/ # Stores markdownπ§Ύ Checklist Format
Each checklist is a Markdown file with frontmatter like:
π οΈ Commands
anchor setup
anchor setupInteractive setup to create .anchor/config.json.
anchor set [--environment <env>] [--projects <projects>]
anchor set [--environment <env>] [--projects <projects>]Creates a new checklist. Prompts you to:
Name the checklist
Select environments (from config)
Select projects (from config)
Enter comma-separated checklist items
Optional Flags:
--environment <env>: Filter environments to preselect during prompt--projects <projects>: Filter projects (comma seperated list) to preselect during prompt
anchor lift [--environment <env>] [--projects <projects>]
anchor lift [--environment <env>] [--projects <projects>]Marks checklist(s) as lifted (completed). Automatically:
Validates format
Checks if all
[ ]boxes are checkedDeletes checklist if all complete
Errors if not
Optional Flags:
--environment <env>: Only lift checklists relevant to the environment--projects <projects>: Filter projects (comma seperated list) to preselect during prompt
anchor status [--environment <env>]
anchor status [--environment <env>]Shows the current checklist status for all or specific environments.
Output example:
π§ͺ Validation
Anchor uses strict validation rules for every checklist:
Valid frontmatter (
environments: [...])All checklist lines follow
- [ ] ...or- [x] ...
π€ CI / Git Hooks Integration
Use Anchor in your CI pipeline or Git hooks to enforce:
Checklist existence on PRs
No incomplete checklists before release
Fail builds if required environments have unlifted checklists
Example shell check:
OR
π§ Config File Example
.anchor/config.json
π§βπ» License
MIT β Made with β€οΈ by devs who hate broken production environments.
Last updated