# @4s1/conventional-commit-creator

> Conventional Commit Creator

Latest version **3.20.0** (published 2026-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @4s1/conventional-commit-creator
pnpm add @4s1/conventional-commit-creator
yarn add @4s1/conventional-commit-creator
bun add @4s1/conventional-commit-creator
```

Provides the commands `ccc`, `conventional-commit-creator`.

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.20.0 |
| Published | 2026-11-27 |
| First published | 2021-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Steffen <steffen@4s1.de> |
| Maintainers | steffen-4s1, bot-4s1 |
| Keywords | conventional commit, 4s1 |

## Links

- npm: https://www.npmjs.com/package/@4s1/conventional-commit-creator
- Repository: https://codeberg.org/4s1/conventional-commit-creator
- Issues: https://codeberg.org/4s1/conventional-commit-creator/issues
- npm.io page: https://npm.io/package/@4s1/conventional-commit-creator

## Dependencies (3)

- [@inquirer/input](https://npm.io/package/@inquirer/input.md) 5.2.0
- [@inquirer/select](https://npm.io/package/@inquirer/select.md) 5.3.0
- [@inquirer/confirm](https://npm.io/package/@inquirer/confirm.md) 6.4.0

## Recent versions

- 3.20.0 (latest) — 2026-11-27
- 3.19.0 — 2026-03-12
- 3.18.0 — 2026-02-05
- 3.16.0 — 2025-03-26
- 3.15.0 — 2025-03-03
- 3.14.0 — 2024-10-20
- 3.13.0 — 2024-10-04
- 3.12.0 — 2024-07-31
- 3.11.0 — 2024-06-26
- 3.10.0 — 2024-03-18
- 3.9.1 — 2024-03-13
- 3.9.0 — 2024-03-04
- 3.9.0-rc.1 — 2024-02-29
- 3.9.0-rc.0 — 2024-02-29
- 3.8.0 — 2023-10-29
- … 33 more at https://npm.io/package/@4s1/conventional-commit-creator/versions

## README

# Conventional Commit Creator

[![Please don't upload to GitHub](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page)

This CLI application assists you in creating commit messages that are conform to the conventional commit style.
It will ask for _type_, _scope_, _description_, _body_ and _issue id_.

Features:

⭐ format of the commit message can be fully customized \
⭐ different templates for your repositories based on Git remote url \
⭐ issue id can be inserted in up to three places of a commit message

## Install & usage

Install this package globally.

```bash
npm install -g @4s1/conventional-commit-creator
```

Inside your repository run Conventional Commit Creator.

```bash
conventional-commit-creator
# or just
ccc
```

## Configure commit message templates

The configuration is stored in `~/.config/conventional-commit-creator/config.json`.

The default template look like the following json:

```json
{
  "$schema": "https://www.4s1.de/conventional-commit-creator/schema.json",
  "version": 1,
  "templates": [
    {
      "name": "Default",
      "regex": ".*",
      "pattern": "{type}{scope}: {description}{issue}{body}",

      "pre_type": "",
      "post_type": "",
      "pre_scope": "(",
      "post_scope": ")",
      "pre_description": "",
      "post_description": "",
      "pre_body": "\n\n",
      "post_body": "",

      "pre_issue": " (#",
      "post_issue": ")",
      "pre_issue2": "",
      "post_issue2": "",
      "pre_issue3": "",
      "post_issue3": ""
    }
  ]
}
```

and will create the following commit message:

```text
--- your input --------------------------

type: chore
scope: foo
description: some description
body: Lorem ipsum dolor sit amet.
issue: 42

--- commit message result ---------------

chore(foo): some description (#42)

Lorem ipsum dolor sit amet.
```

The `pre` and `post` texts are only inserted if a matching middle part has also been entered.

Now let's look at another more complex variant.

We take the configuration from above, remove all empty strings (missing settings are replaced by empty strings) and add another template that should apply to all GitHub projects (see _regex_).

```json
{
  "$schema": "https://www.4s1.de/conventional-commit-creator/schema.json",
  "version": 1,
  "templates": [
    {
      "name": "Default",
      "regex": ".*",
      "pattern": "{type}{scope}: {description}{issue}{body}",
      "pre_scope": "(",
      "post_scope": ")",
      "pre_body": "\n\n",
      "pre_issue": " (#",
      "post_issue": ")"
    },
    {
      "name": "GitHub Project",
      "regex": "^.*github.*$",
      "pattern": "{type}{scope}: {description}{body}{issue}{issue2}{issue3}",
      "pre_scope": "(",
      "post_scope": ")",
      "pre_body": "\n\n",
      "pre_issue": "\n\nRefs: #",
      "pre_issue2": " | [refs #",
      "post_issue2": "]",
      "pre_issue3": " | REDMINE-",
      "post_issue3": ""
    }
  ]
}
```

This will result in the following commit example:

```text
--- your input --------------------------

type: refactor
scope: -
description: foobar
body: Hallo \n world
issue: 42

--- commit message result ---------------

refactor: foobar

Hallo
world

Refs: #42 | [refs #42] | REDMINE-42
```

or without _issue id_

```text
--- your input --------------------------

type: refactor
scope: -
description: foobar
body: Hallo \n world
issue: -

--- commit message result ---------------

refactor: foobar

Hallo
world
```

Checking the Git remote url via regular expression is done in the order the templates were specified from top to bottom. The last hit wins.

---
_Source: https://npm.io/package/@4s1/conventional-commit-creator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
