Metadata-Version: 2.4
Name: releasebrief
Version: 0.1.0
Summary: Draft release notes and stable semantic version suggestions from supplied commit subjects.
Author: Ahmed Saeed
License-Expression: MIT
Project-URL: Repository, https://github.com/ahmedsaeed1-eng/releasebrief
Project-URL: Issues, https://github.com/ahmedsaeed1-eng/releasebrief/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: THIRD_PARTY.md
Dynamic: license-file

![ReleaseBrief timeline](assets/logo.svg)

# ReleaseBrief

**A review-ready release draft, before you publish.**

[![Tests](https://github.com/ahmedsaeed1-eng/releasebrief/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/ahmedsaeed1-eng/releasebrief/actions/workflows/ci.yml?query=branch%3Amain+event%3Apush) [![Repository stars](https://img.shields.io/github/stars/ahmedsaeed1-eng/releasebrief?style=flat-square&color=c084fc)](https://github.com/ahmedsaeed1-eng/releasebrief/stargazers) [![MIT license](https://img.shields.io/badge/license-MIT-6d28d9?style=flat-square)](LICENSE) [![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-3776AB?style=flat-square&logo=python&logoColor=white)](pyproject.toml) [![No runtime dependencies](https://img.shields.io/badge/runtime-stdlib%20only-7c3aed?style=flat-square)](pyproject.toml)

> Collect commit subjects → draft release notes → refine sections → review SemVer.
>
> Your repository, tags and releases remain untouched.

| Jump to | Workflow |
| :--- | :--- |
| [01 · Collect](#01--collect) | Prepare text or exported JSON |
| [02 · Draft](#02--draft) | Generate the first changelog |
| [03 · Refine](#03--refine) | Select output and filter sections |
| [04 · Review](#04--review-the-version) | Check the version recommendation |
| [05 · Test](#05--test) | Run unit and CLI verification |

## 01 · Collect

ReleaseBrief is a local Python CLI for drafting release notes from commit subjects you provide. It groups conventional commits, notices breaking changes, removes duplicate subjects, and recommends a stable SemVer increment without applying it. It does not run Git, call external services, mutate project files, create tags, or publish releases.

| Feature | Details |
|---|---|
| Input | UTF-8 text or JSON array via local file/stdin |
| Grouping | Features, fixes, performance, maintenance and more |
| Breaking changes | `!`, `BREAKING CHANGE:` and `BREAKING-CHANGE:` |
| Duplicate handling | Exact type/scope/description matches; preserves breaking qualifiers and distinct footer notes |
| Output | Markdown, machine-readable JSON, human-readable console |
| Filters | Include or exclude types without changing bump recommendation |
| Version | Suggest next `MAJOR.MINOR.PATCH` only; no tag or release mutation |

## Package installation

Once the maintainer publishes this release to PyPI, install its pinned
Python CLI with:

```sh
python -m pip install releasebrief==0.1.0
```

Run the installed entry point against text you provide:

```sh
printf 'feat: add preferences\nfix: correct exports\n' | releasebrief --current-version 1.2.3
```

This is a standalone local CLI, not an MCP server. The source checkout
workflow below remains available with no runtime dependencies.

## 02 · Draft

Requires Python 3.10 or later. No package installation is required. Clone or download the source repository, then run from its root:

```sh
python -m releasebrief examples/commits.txt --current-version 1.2.3
```

The bundled example includes a breaking change, so the result begins `# 2.0.0`. It is a draft, not a published release.

## 03 · Refine

```sh
python -m releasebrief examples/commits.json --input-format json --format json --current-version 1.2.3
python -m releasebrief examples/commits.txt --format console --exclude docs,chore
python -m releasebrief examples/commits.txt --date 2026-11-27 --strict > CHANGELOG-draft.md
```

The final command redirects standard output to a new file through your shell; ReleaseBrief itself never writes to a project. Without an input path it reads standard input. Use `python -m releasebrief --help` for all options.

### Input formats

Text expects one subject per line; an immediately following breaking-change footer belongs to the previous subject. Blank lines are ignored. For full commit bodies, use JSON rather than plaintext:

```json
[
  "feat(ui): add settings",
  {"subject": "fix: correct exports"},
  {"subject": "feat(api): rename option", "body": "BREAKING CHANGE: old option removed"}
]
```

The JSON input is an array of strings or objects with a string `subject` and optional string `body`. Unknown object fields are ignored. Non-conventional subjects are counted and omitted; `--strict` makes any such record an error. Invalid input exits with code 2 and writes diagnostics to standard error.

## 04 · Review the version

| Commit content | Recommended bump |
|---|---|
| Breaking change | major |
| `feat` | minor |
| `fix`, `perf`, `revert` | patch |
| Other types or no commits | none |

Recommendations use all parsed commits, including types omitted by display filters. Breaking changes are never hidden by filters. Only stable numeric input versions (`1.2.3` style) are accepted; pre-release/build metadata, special policies for pre-1.0 software, and historical commit ancestry are not interpreted. Review every draft and recommendation manually before release. A duplicate subject can represent distinct changes; use suitably descriptive commit subjects or separate inputs when that distinction matters.

Default sections include conventional common types. Custom types are supported through `--include custom-type`. Text and JSON remain local, and Markdown escaping neutralizes common markup in supplied descriptions.

## 05 · Test

```sh
python -m unittest discover -s tests -v
```

Tests include CLI execution, UTF-8 input, malformed records, strict mode, filtering, breaking changes, deduplication, and SemVer precedence. CI is configured for Python 3.10/3.12 on Linux, Windows and macOS; see the actual workflow status for the tested environments.

## License and credits

MIT. See [LICENSE](LICENSE) and [THIRD_PARTY.md](THIRD_PARTY.md).
