dotnet-gitmoji 0.2.2

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global dotnet-gitmoji --version 0.2.2
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local dotnet-gitmoji --version 0.2.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-gitmoji&version=0.2.2
                    
nuke :add-package dotnet-gitmoji --version 0.2.2
                    

dotnet-gitmoji

NuGet Downloads License

Write expressive, emoji-prefixed commit messages in .NET projects β€” and share the setup with your team via a single dotnet tool restore.

dotnet-gitmoji brings the gitmoji commit convention to your .NET workflow. It installs a prepare-commit-msg hook through Husky.Net so the hook lives alongside your source β€” when a teammate clones the repo and runs dotnet tool restore, the hook is ready on their first commit. A client mode (dotnet-gitmoji commit) is available for one-off use on machines where you don't want a hook.


Features

  • 🀝 Team-friendly β€” installs into Husky.Net so the hook ships with the repo; teammates inherit it on dotnet tool restore
  • πŸͺ Two Husky.Net modes β€” shell hook (simplest) or task-runner integration for repos already using it
  • πŸ’» Client mode β€” dotnet-gitmoji commit for one-off use without a hook
  • πŸ” Fuzzy search β€” find the right emoji by name, code, or description
  • βš™οΈ Flexible config β€” per-repo .gitmojirc.json or a personal global fallback

Requirements


Installation

dotnet new tool-manifest   # skip if .config/dotnet-tools.json already exists
dotnet tool install dotnet-gitmoji

Commit .config/dotnet-tools.json to your repo. Teammates get the tool with a single dotnet tool restore after cloning β€” no per-machine install required.

When installed locally, prefix every command with dotnet tool run:

dotnet tool run dotnet-gitmoji init --mode shell
dotnet tool run dotnet-gitmoji commit

The tool detects local installation automatically and generates the correct hook command.

Global

dotnet tool install --global dotnet-gitmoji

Use dotnet-gitmoji <command> directly anywhere in your terminal. Global install is convenient for personal use across repos, but it does not share the tool with teammates β€” prefer the local install for any shared project.


Quick Start

The recommended setup uses a local tool manifest and Husky.Net's shell-mode hook. After these four steps, both you and any teammate cloning the repo will get the gitmoji prompt on git commit.

# 1. Add Husky.Net and dotnet-gitmoji to your tool manifest
dotnet new tool-manifest
dotnet tool install Husky
dotnet tool install dotnet-gitmoji

# 2. Initialize Husky.Net (creates .husky/, sets core.hooksPath)
dotnet tool run husky install

# 3. Install the gitmoji prepare-commit-msg hook
dotnet tool run dotnet-gitmoji init --mode shell

# 4. Commit as usual β€” pick an emoji at the prompt
git commit

To remove the hook later:

dotnet tool run dotnet-gitmoji remove

For Husky.Net hooks, remove prints manual cleanup instructions instead of editing .husky/ files itself β€” follow the printed steps to fully detach the hook.

For the full team-onboarding setup (so teammates need only dotnet tool restore), see Sharing with your team.


Usage

dotnet-gitmoji init --mode shell appends a dotnet-gitmoji invocation to .husky/prepare-commit-msg via dotnet husky add. The file lives in .husky/ β€” committed to the repo β€” so the hook follows the project rather than the developer's machine.

After init, just commit normally:

git commit
git commit -m "fix login redirect"   # message pre-filled as title

When you pass -m, the message is pre-filled as the title suggestion at the prompt. The hook skips itself on merge, squash, amend, and during interactive rebase, so automated commit flows aren't interrupted.

Task-runner mode

If your repo already uses Husky.Net's task runner, use --mode task-runner instead. This adds a dotnet-gitmoji task to .husky/task-runner.json and registers the hook to invoke it:

dotnet tool run dotnet-gitmoji init --mode task-runner

Both modes produce the same prompt experience β€” pick whichever matches your existing Husky.Net setup.

Client Mode

dotnet-gitmoji commit works as a drop-in replacement for git commit when you prefer not to install a hook.

Client mode is disabled when a hook is already installed, to prevent the emoji from being applied twice. Client mode also runs only on the local machine β€” it doesn't share anything with teammates.

dotnet-gitmoji commit
dotnet-gitmoji commit --title "fix login redirect"
dotnet-gitmoji commit --title "fix login redirect" --scope auth --message "Resolves #42"
Option Short Description
--title -t Commit title (skips the title prompt)
--scope -s Commit scope (e.g. feat(auth): …)
--message -m Commit message body

Sharing with your team

To make the gitmoji hook fire automatically for every teammate after they clone the repo:

  1. Use a local tool manifest. Run dotnet new tool-manifest and install both tools locally so they're listed in .config/dotnet-tools.json:
    dotnet tool install Husky
    dotnet tool install dotnet-gitmoji
    
  2. Add a post-restore MSBuild target. Wire dotnet tool restore to also run dotnet husky install automatically. Husky.Net documents the exact target snippet to use β€” see Husky.Net: Automatic Husky Install. For multi-project solutions, place the target in a Directory.Build.targets file at the repo root.
  3. Run dotnet-gitmoji init --mode shell once and commit the resulting .config/dotnet-tools.json, .husky/ directory, and the .csproj / Directory.Build.targets changes from step 2.
  4. Teammates clone and run dotnet tool restore. That single command installs both tools, runs husky install, and activates the hook. Their next git commit opens the gitmoji prompt β€” no manual setup, no global install.

Direct hooks under .git/hooks/ cannot do this: .git/ is never committed, so every teammate would need to re-run init themselves. The Husky.Net path is the only setup that actually transfers across machines.


Configuration

Interactive wizard

The quickest way to configure preferences β€” walks through every option and saves to the global config:

dotnet-gitmoji config

Manual configuration

Create a .gitmojirc.json in your repo root, or generate one with defaults by passing --config to init:

dotnet-gitmoji init --mode shell --config

Example file:

{
  "emojiFormat": "Emoji",
  "scopePrompt": false,
  "messagePrompt": false,
  "capitalizeTitle": true,
  "gitmojisUrl": "https://gitmoji.dev/api/gitmojis",
  "autoAdd": false,
  "signedCommit": false,
  "scopes": null
}

Configuration reference

Key Type Default Description
emojiFormat "Emoji" | "Code" "Emoji" Prefix with the emoji character (πŸ›) or its shortcode (:bug:)
scopePrompt bool false Prompt for a commit scope (e.g. feat(auth): …)
messagePrompt bool false Prompt for an optional commit message body
capitalizeTitle bool true Automatically capitalize the first letter of the commit title
gitmojisUrl string https://gitmoji.dev/api/gitmojis URL to fetch the gitmoji list from
autoAdd bool false Stage all changes before committing (client mode only)
signedCommit bool false Sign commits with GPG (git commit -S) (client mode only)
scopes string[] | null null Predefined scope suggestions shown when scopePrompt is true

Config resolution order

The tool looks for configuration in this order, using the first match:

Location Purpose
.gitmojirc.json in repo root (or any parent directory) Shared team settings β€” commit this to your repo
~/.dotnet-gitmoji/config.json Personal global fallback
Built-in defaults Applied when no config file exists

Commands

Command Description
dotnet-gitmoji init --mode shell Install the prepare-commit-msg hook via Husky.Net (shell mode)
dotnet-gitmoji init --mode task-runner Install the hook via Husky.Net's task runner
dotnet-gitmoji remove Uninstall the hook (prints manual cleanup steps for Husky.Net-managed hooks)
dotnet-gitmoji commit Interactive commit (client mode)
dotnet-gitmoji config Run the configuration wizard
dotnet-gitmoji list List all available gitmojis
dotnet-gitmoji search <keyword> Fuzzy-search gitmojis by name, code, or description
dotnet-gitmoji update Refresh the cached gitmoji list from the remote API

License

MIT β€” Jonathan BΓΊcaro

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.2.4 86 5/17/2026
0.2.3 94 5/16/2026
0.2.2 94 5/16/2026
0.2.0 102 4/24/2026
0.1.0 103 4/23/2026