New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

github.com/AndreasAugustin/go-gitmoji-cli

Package Overview
Dependencies
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/AndreasAugustin/go-gitmoji-cli

Source
Go Modules
Version
v0.6.1-alpha.0.20241021081437-81c01865718f
Version published
Created
Source

go-gitmoji-cli

All Contributors

CodeQL

ci_go

Lint

goreleaser

  ____ ____    ____ _ ___ _  _ ____  _ _    ____ _    _
  | __ |  | __ | __ |  |  |\/| |  |  | | __ |    |    |
  |__] |__|    |__] |  |  |  | |__| _| |    |___ |___ |

commit

Abstract

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 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 with emoji <type>[optional scope]: :smile: <description>

Installation

:warning: Currently the package is in state alpha please be aware that some functionality may change and some bugs may happen.

brew

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

git lfs uninstall
# <cd to the repo, which uses lfs>
git lfs install --local

github issue

Aur

The package is located here

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
  • ghcr
# available <tag> are the git tags

# docker hub
# pull the image
docker pull andyaugustin/go-gitmoji-cli:<tag>
# 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:<tag>

# if you prefer ghcr instead of docker hub
# docker pull ghcr.io/andreasaugustin/go-gitmoji-cli:<tag>
# docker run -it ghcr.io/andreasaugustin/go-gitmoji-cli:<tag>

Go

 go install github.com/AndreasAugustin/go-gitmoji-cli@latest

Manual

Download the related release here 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.

parameterdescriptiondefault
auto_addperform automatically a git add .false
auto_signautomatically sign commits (can also be configured with git git config -g commit.gpgsign=truefalse
auto_signatureautomatically add signature to commitstrue
emoji_formatformat of emojis code/emojicode
scope_promptPrompt for adding the commit scopefalse
body_promptPrompt for adding the commit message bodyfalse
capitalize_titleIf set to true the commit title description will be capitalizedfalse
gitmojis_urlThe URL of the gitmojis databasehttps://gitmoji.dev/api/gitmojis
use_default_git_messagesUse the default git messages (merge, squash, ammend,..)true
debugenable debug modefalse

The configuration values can be changed with

go-gitmoji-cli config [-g]

config

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 package which is per default respecting the standard system proxy settings done with environment variables.

  • HTTP_PROXY
  • HTTPS_PROXY
  • NO_PROXY

basic commands

# show available commands
go-gitmoji-cli --help

help

# show the version
go-gitmoji-cli --version

version

# list the available gitmojis
go-gitmoji-cli list gitmojis

list

# list the available commit types
go-gitmoji-cli list commit-types

list

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 <options>. 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.
# doing a commit with dry-run
go-gitmoji-cli commit --dry-run

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

make help

Deployments

A push/merge to main branch is triggering the deployment. The release action can be found here

Used libraries and tools

Special thanks to gitmoji and gitmoji-cli

Contributors ✨

Thanks goes to these wonderful people (emoji key):

andy Augustin
andy Augustin

📖 💻 👀 🛡️ 🤔 💡 🖋
Benedikt Volkmer
Benedikt Volkmer

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

FAQs

Package last updated on 21 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts