https://github.com/andreasaugustin/go-gitmoji-cli
:octocat: A conventional gitmoji commit interactive command line tool for using emojis on conventional commits. :rocket:
https://github.com/andreasaugustin/go-gitmoji-cli
cli conventional-commit gitmoji gitmoji-cli golang
Last synced: 4 months ago
JSON representation
:octocat: A conventional gitmoji commit interactive command line tool for using emojis on conventional commits. :rocket:
- Host: GitHub
- URL: https://github.com/andreasaugustin/go-gitmoji-cli
- Owner: AndreasAugustin
- License: mit
- Created: 2023-07-22T19:11:41.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-13T00:27:50.000Z (9 months ago)
- Last Synced: 2025-04-12T22:47:34.290Z (6 months ago)
- Topics: cli, conventional-commit, gitmoji, gitmoji-cli, golang
- Language: Go
- Homepage: https://gitmoji.dev/
- Size: 374 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# go-gitmoji-cli
[](#contributors-)
[](https://github.com/AndreasAugustin/go-gitmoji-cli/actions/workflows/github-code-scanning/codeql)
[](https://github.com/AndreasAugustin/go-gitmoji-cli/actions/workflows/ci_go.yml)
[](https://github.com/AndreasAugustin/go-gitmoji-cli/actions/workflows/lint.yml)
[](https://github.com/AndreasAugustin/go-gitmoji-cli/actions/workflows/release_go.yml)
```bash
____ ____ ____ _ ___ _ _ ____ _ _ ____ _ _
| __ | | __ | __ | | |\/| | | | | __ | | |
|__] |__| |__] | | | | |__| _| | |___ |___ |
```
## Abstract
[Gitmoji][gitmoji] is an emoji guide for GitHub commit messages. Aims to be a standardization cheatsheet - guide for using emojis on GitHub's commit messages.
is a nice way to standardize commit messages with emojis.There is already a nice [gitmoji-cli][gitmoji-cli] command line interface available.
Nevertheless, I was searching a nice project to get a bit more into golang so this cli was born.
There are some feature differences between both projects.Per default the format is [conventional-commits][conventional-commits] with emoji
`[optional scope]: :smile: `## Installation
:warning: Currently the package is in state `alpha` please be aware that some functionality may change and some bugs may happen.
### brew
```bash
brew tap AndreasAugustin/go-gitmoji-cli https://github.com/AndreasAugustin/go-gitmoji-cli
brew install AndreasAugustin/go-gitmoji-cli/go-gitmoji-cli
```**Remark** :warning:
When you receive an error like *This repository is configured for Git LFS but 'git-lfs' was not found on your path*
you most likely have `git-lfs` installed globally. Do the following```bash
git lfs uninstall
#
git lfs install --local
```[github issue][brew-tap-issue-git-lfs]
### Aur
The package is located [here][go-gitmoji-cli-aur]
```bash
pamac update -a
pamac install go-gitmoji-cli-bin
```### Docker
The image is available within 2 docker registries available. Just pull the image to have a local test setup available.
To use it, mount the current dir into the working dir.- [dockerhub][go-gitmoji-cli-docker-hub]
- [ghcr][go-gitmoji-cli-docker-ghcr]```bash
# available are the git tags# docker hub
# pull the image
docker pull andyaugustin/go-gitmoji-cli:
# run the container -> will open a zsh session
# note: the local volume mount is missing in the sample command
docker run -it andyaugustin/go-gitmoji-cli:# if you prefer ghcr instead of docker hub
# docker pull ghcr.io/andreasaugustin/go-gitmoji-cli:
# docker run -it ghcr.io/andreasaugustin/go-gitmoji-cli:
```### Go
```bash
go install github.com/AndreasAugustin/go-gitmoji-cli@latest
```### Manual
Download the related release [here][go-gitmoji-cli-releases] and unpack the related binary into your path
## Configuration
It is possible to configure the cli either with a `.go-gitmoji-cli.json` file within the repo directory
or with command line flags.
Environment variables are supported (case insensitive). The key is the same like the parameter with a prefix **GO_GITMOJI_CLI_**.
All parameters are able to be modified with flags.| **parameter** | **description** | **default** |
|--------------------------|----------------------------------------------------------------------------------------------|------------------------------------|
| auto_add | perform automatically a `git add .` | `false` |
| auto_sign | automatically sign commits (can also be configured with git `git config -g commit.gpgsign=true` | `false` |
| auto_signature | automatically add signature to commits | `true` |
| emoji_format | format of emojis `code/emoji` | `code` |
| scope_prompt | Prompt for adding the commit scope | `false` |
| body_prompt | Prompt for adding the commit message body | `false` |
| capitalize_title | If set to true the commit title description will be capitalized | `false` |
| gitmojis_url | The URL of the gitmojis database | `https://gitmoji.dev/api/gitmojis` |
| use_default_git_messages | Use the default git messages (merge, squash, ammend,..) | `true` |
| debug | enable debug mode | `false` |The configuration values can be changed with
```bash
go-gitmoji-cli config [-g]
```
This will create a file within the local directory or within the OS related config directory (when `-g` flag is enabled).
Reading will follow the following order:- default values
- global config if exists
- local config if exists
- environment variables
- command flags## Usage
### Proxy
The cli is firing at first usage or with the `update gitmojis` command a http query to the
configured gitmoji api url to receive a list of available gitmojis.
The cli is using [net/http][net/http] package which is per default respecting the standard system proxy settings done
with environment variables.- HTTP_PROXY
- HTTPS_PROXY
- NO_PROXY### basic commands
```bash
# show available commands
go-gitmoji-cli --help
```
```bash
# show the version
go-gitmoji-cli --version
```
```bash
# list the available gitmojis
go-gitmoji-cli list gitmojis
```
```bash
# list the available commit types
go-gitmoji-cli list commit-types
```
### Commit
There are 2 ways making commits with the tool
- hooks `go-gitmoji-cli hooks --help`. With that command it is possible to install a commit hook. To use the hook, just do a `git commit `.
This will trigger the cli.
- commit `go-gitmoji-cli commit --help`. It is not possible to use this command when you have installed a hook.```bash
# doing a commit with dry-run
go-gitmoji-cli commit --dry-run
```
Some arguments and flags you know from git will be reused.
The first message will be parsed and the single parts will be reused.
E.g. `git commit -S -m "feat(api)!: :smile: also just parts of the message will be reused" -m "this is a message body"`
This is also true when the `go-gitmoji-cli commit -S -m "..." -m "..."` is used.## Debugging
There is a flag `--debug` enabling **verbose** logging
## DEV
The development environment targets are located in the [Makefile](Makefile)
```bash
make help
```## Deployments
A push/merge to `main` branch is triggering the deployment. The release action can be found [here][go-gitmoji-cli-actions-release]
## Used libraries and tools
Special thanks to [gitmoji][gitmoji] and [gitmoji-cli][gitmoji-cli]
- [cobra][cobra]
- [viper][viper]
- [logrus][logrus]
- [bubbletea][bubbletea]
- [bubbles][bubbles]
- [lipgloss][lipgloss]
- [go-figure][go-figure]
- [vhs][vhs]
- [goreleaser][goreleaser][gitmoji]: https://gitmoji.dev/
[gitmoji-cli]: https://github.com/carloscuesta/gitmoji-cli
[conventional-commits]: https://www.conventionalcommits.org/en/v1.0.0/
[cobra]: https://github.com/spf13/cobra
[viper]: https://github.com/spf13/viper
[logrus]: https://github.com/sirupsen/logrus
[bubbletea]: https://github.com/charmbracelet/bubbletea
[bubbles]: https://github.com/charmbracelet/bubbles
[lipgloss]: https://github.com/charmbracelet/lipgloss
[go-figure]: https://github.com/common-nighthawk/go-figure
[vhs]: https://github.com/charmbracelet/vhs
[goreleaser]: https://goreleaser.com/
[go-gitmoji-cli-releases]: https://github.com/AndreasAugustin/go-gitmoji-cli/releases
[go-gitmoji-cli-docker-hub]: https://hub.docker.com/repository/docker/andyaugustin/go-gitmoji-cli/general
[go-gitmoji-cli-docker-ghcr]: https://github.com/AndreasAugustin/go-gitmoji-cli/pkgs/container/go-gitmoji-cli
[go-gitmoji-cli-aur]: https://aur.archlinux.org/packages/go-gitmoji-cli-bin
[net/http]: https://pkg.go.dev/net/http
[go-gitmoji-cli-actions-release]: https://github.com/AndreasAugustin/go-gitmoji-cli/actions/workflows/release.yml
[brew-tap-issue-git-lfs]: https://github.com/Homebrew/brew/issues/4988## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
andy Augustin
📖 💻 👀 🛡️ 🤔 💡 🖋
Benedikt Volkmer
🐛
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!