Cocogitto – The conventional commits tool box

GitHub Actions workflow status Code coverage status
Conventional commits Repository license Discord logo

Website · Installation · Configuration

The Conventional Commits toolbox

Explore Cocogitto's docs  ▶

Foreword

What is it ?

Cocogitto is a CLI and GitOps toolbox for the Conventional Commits and Semver specifications.

Why ?

There are plenty of tools listed on the conventional commits web site to help you generate changelog, git hooks, commit template etc. Some of them are specifically designed for the Conventional Commits specification, and some of them are general purpose.

Cocogitto was designed to help you respect the conventional and semver standard and is not intended to be used in any other context.

It strives to be a set of simple, modern and fast command line interfaces.

Goals

Non goals

Quick start

This readme is a quick tour of what you can do with Cocogitto, for an in-depth guide please refer to the documentation.

Installation

Packaging status

Archlinux

shell pacman -S cocogitto

Cargo

shell cargo install --locked cocogitto

NixOs

shell nix-env -iA cocogitto

Conventional commits

Note: coco has been deprecated in favor of the cog commit command.

To create conventional commits you can use the cog commit command. It has subcommands for the default fix and feat Conventional Commits types plus the angular commit conventional commit types.

Example:

```shell

With cog

cog commit feat "add awesome feature"

With git

git commit -m "feat: add awesome feature" ```

See User guide -> Conventional commits.

Auto-bumps

Creating a version with cog bump will perform the following actions :

  1. Determine a version number according to your commit history.
  2. Perform configuration defined pre-bump commands.
  3. Append the version's changelog to your repository changelog file.
  4. Create a version commit and tag it.
  5. Perform post-bump commands

Example:

```shell

File: cog.toml

prebumphooks = [ "echo {{version}}", ]

postbumphooks = [ "git push", "git push origin {{version}}", ]

[changelog] path = "CHANGELOG.md" template = "remote" remote = "github.com" repository = "cocogittobotplayground" owner = "cocogitto" authors = [ { username = "oknozor", signature = "Paul Delafosse"} ] ```

cog bump example

Changelogs

cog changelog uses tera templates to generate markdown changelogs. It has several built-in templates, and you can define your own.

Example:

shell cog changelog

Output :

```markdown

1.2.0 - 2021-11-26

Bug Fixes

Features

Miscellaneous Chores

Refactoring

Tests

See User guide -> Changelogs.

GitHub integration

GitHub action:

You can run cog check and perform automatic releases via GitHub action using cocogitto-action.

Example: yaml - name: Semver release uses: cocogitto/cocogitto-action@main with: release: true git-user: 'Cog Bot' git-user-email: 'mycoolproject@org.org'

See Github integration -> GitHub action

GitHub bot:

cocogitto-bot is a standalone, zero-config bot checking your pull requests against the Conventional Commits specification.

cog bot example

See Github integration -> GitHub-bot

Similar projects

Contributing

Found a bug, have a suggestion for a new feature ? Please read the contribution guideline and submit an issue.

Licence

All the code in this repository is released under the MIT License, for more information take a look at the LICENSE file.