npm package: @lazy-release/cli
Description: A CLI tool that automates versioning, publishing, and changelog generation with full support for multi-package repositories.
Author: Chad Adams
Latest version: 0.2.2

# 🚀 lazy-release

[![Contributors Welcome](https://img.shields.io/badge/contributors-welcome-brightgreen.svg?style=flat-square)](./docs/contributing.md)
[![NPM Version](https://img.shields.io/npm/v/%40lazy-release%2Fcli)](https://www.npmjs.com/package/@lazy-release/cli)
[![GitHub License](https://img.shields.io/github/license/lazy-release/lazy-release)](./LICENSE)

Automates versioning, publishing, and creating changelogs for Node.js projects using conventional commits and supports multi-package repos.

## ✨ Features

- 📝 **Automated Changelogs** - Generate nice looking changelogs from conventional commits
- 🔖 **Version Management** - Automatic semantic versioning based on commit messages
- 🏷️ **Git Tag Management** - Automatically creates and publishes git version tags
- 📦 **Package Manager Agnostic** - Works with npm, pnpm, yarn, and bun
- 🤖 **GitHub Integration** - Automatic PR creation and GitHub releases
- 🧪 **Snapshot Releases** - Create preview versions for testing
- 🎯 **Monorepo Support** - Manage multiple packages in a single repository

## 📚 Documentation

- [How it works](docs/how-it-works.md)
- [Commands](docs/commands.md)
- [Configuration](docs/configuration.md)
- [Comparison of Similar Tools](docs/comparison-of-similar-tools.md)
- [Examples](docs/examples.md)

## ⚙️ Prerequisites

1. Use squash merge for pull requests.

In your repo settings:

- Go to Settings > General > Pull Requests
  - Uncheck "Allow merge commits"
  - Check "Allow squash merges"
    - Choose "Pull request title" for default commit message

2. Update workflow permissions

- Go to Settings > Actions > General
  - Set "Workflow permissions" to "Read and write permissions"
  - Check "Allow GitHub Actions to create and approve pull requests"

## 📖 Quick Start

> [!NOTE]  
> It's recommended to run `lazy-release` in a CI/CD environment (like GitHub Actions) for automated and consistent release workflows.

1. Install the CLI:

```bash
pnpm i @lazy-release/cli -D
```

2. Add a script to your `package.json`:

```json
{
  "scripts": {
    "lazy-release": "lazy-release"
  }
}
```

3. Run the CLI:

```bash
pnpm lazy-release --npm-token $NPM_TOKEN --github-token $GITHUB_TOKEN --access public
```

## 🔄 Workflow
1. A dev merges a Pull Request into the `main` branch using squash merge.
> [!NOTE]  
> The PR should be prefixed with conventional commit prefix e.g "fix", "chore", "feat", etc...

2. A Release PR gets created.
![release-pr](./media/release-pr.png)

A Release PR....
- Bumps the version in the package.json files
- Updates the lock files
- Creates or updates changelogs
![changelogs](./media/changelogs.png)

3. A release is created once the Release PR is merged. A release is...
- Publishing packages to npm (If you provide a NPM_TOKEN and the package.json does not have "private": true)
- Creates a GitHub release (If you provide a GITHUB_TOKEN)
![github-release](./media/github-release.png)

## 🌟 Projects Using lazy-release
> [!NOTE]  
> If you are using `lazy-release` in your project, please consider adding it to this list by submitting a pull request!
- [NoteX](https://github.com/usenotex/notex)
- [vscode-jetbrains-icon-theme](https://github.com/cadamsdev/vscode-jetbrains-icon-theme)

## 💡 This tool was inspired by
- Vue.js (Their nice changelogs)
- Nuxt.js (Release PRs, use of emojis etc)