MCPcopy Index your code
hub / github.com/carloscuesta/gitmoji-cli

github.com/carloscuesta/gitmoji-cli @v9.7.0 sqlite

repository ↗ · DeepWiki ↗ · release v9.7.0 ↗
50 symbols 202 edges 55 files 0 documented · 0%
README

gitmoji-cli

Build Status Code Climate Codecov npm version npm downloads gitmoji badge

gitmoji-cli

A gitmoji interactive client for using gitmojis on commit messages.

About

This project provides an easy solution for using gitmoji from your command line. Gitmoji-cli solves the hassle of searching through the gitmoji list. Includes a bunch of options you can play with! :tada:

Install

npm

npm i -g gitmoji-cli

brew

brew install gitmoji

Usage

gitmoji --help
A gitmoji interactive client for using gitmojis on commit messages.

  Usage
    $ gitmoji
  Options
    --init, -i      Initialize gitmoji as a commit hook
    --remove, -r    Remove a previously initialized commit hook
    --config, -g    Setup gitmoji-cli preferences.
    --commit, -c    Interactively commit using the prompts
    --list, -l      List all the available gitmojis
    --search, -s    Search gitmojis
    --version, -v   Print gitmoji-cli installed version
    --update, -u    Sync emoji list with the repo

Commit

You can use the commit functionality in two ways, directly or via a commit-hook.

If you want to integrate gitmoji-cli in your project I would recommend going for the hook mode as it support more use cases, it's more flexible and has a better integration with other tools, whereas the client mode is more quick and easy to use.

Client

Start the interactive commit client, to auto generate your commit based on your prompts.

gitmoji -c
Options

You can pass default values to the prompts using the following flags:

  • title: For setting the commit title.
  • message: For setting the commit message.
  • scope: For setting the commit scope.

Those flags should be used like this:

gitmoji -c --title="Commit" --message="Message" --scope="Scope"

Hook

Run the init option, add your changes and commit them, after that the prompts will begin and your commit message will be built.

gitmoji -i
git add .
git commit

⚠️ The hook should not be used with the gitmoji -c command.

gitmoji commit

Search

Search using specific keywords to find the right gitmoji.

gitmoji -s "criteria"

gitmoji search

List

Pretty print all the available gitmojis.

gitmoji -l

gitmoji list

Update

Update the gitmojis list, by default the first time you run gitmoji, the cli creates a cache to allow using this tool without internet connection.

gitmoji -u

Config

The cli has some built-in configuration options that you can tweak at your own preference:

  • Automatic git add: Enable or disable the automatic git add . every time you use the commit command.
  • Emoji format: Switch between the emoji format.
  • Message prompt: Enable or disable the message prompt.
  • Scope prompt: Enable or disable the conventional commits scope prompt, or specify your own predefined scopes in a array.
  • Gitmojis api URL: Set a custom URL to use it as the library of gitmojis.

You can configure these options via (in order of precedence):

  • A gitmoji key in your package.json file
  • A .gitmojirc.json file.
  • A gitmoji key in a package.json file in a parent directory (recursively)
  • A .gitmojirc.json file in a parent directory (recursively)
  • Using the global cli configuration.

If no user configuration is found, a set of default values will be used.

package.json

{
  "gitmoji": {
    "autoAdd": false,
    "emojiFormat": "code | emoji",
    "scopePrompt": false,
    "messagePrompt": false,
    "capitalizeTitle": true,
    "gitmojisUrl": "https://gitmoji.dev/api/gitmojis"
  }
}

.gitmojirc.json

{
  "autoAdd": false,
  "emojiFormat": "code | emoji" ,
  "scopePrompt": false,
  "messagePrompt": false,
  "capitalizeTitle": true,
  "gitmojisUrl": "https://gitmoji.dev/api/gitmojis"
}

Local configuration

Run gitmoji -g to setup some gitmoji-cli preferences.

gitmoji config

Core symbols most depended-on inside this repo

getConfiguration
called by 26
src/utils/configurationVault/getConfiguration.js
commit
called by 12
src/commands/commit/index.js
getEmojis
called by 8
src/utils/getEmojis.js
filterGitmojis
called by 7
src/utils/filterGitmojis.js
getAbsoluteHooksPath
called by 5
src/utils/getAbsoluteHooksPath.js
buildFetchOptions
called by 5
src/utils/buildFetchOptions.js
findGitmojiCommand
called by 5
src/utils/findGitmojiCommand.js
printEmojis
called by 5
src/utils/printEmojis.js

Shape

Function 50

Languages

TypeScript100%

Modules by API surface

src/utils/configurationVault/index.js12 symbols
src/commands/commit/withHook/index.js6 symbols
src/utils/findGitmojiCommand.js4 symbols
src/utils/emojisCache.js3 symbols
src/utils/configurationVault/getConfiguration.js3 symbols
src/commands/commit/index.js3 symbols
src/commands/commit/prompts.js2 symbols
test/utils/stubs.js1 symbols
src/utils/printEmojis.js1 symbols
src/utils/isHookCreated.js1 symbols
src/utils/getEmojis.js1 symbols
src/utils/getDefaultCommitContent.js1 symbols

Dependencies from manifests, versioned

@babel/cli7.27.2 · 1×
@babel/core7.27.1 · 1×
@babel/plugin-syntax-import-assertions7.26.0 · 1×
@babel/preset-env7.27.1 · 1×
@babel/preset-flow7.27.1 · 1×
@babel/preset-typescript7.27.1 · 1×
@types/jest29.5.14 · 1×
@typescript-eslint/eslint-plugin5.62.0 · 1×
babel-plugin-module-extension-resolver1.0.0-rc.2 · 1×

For agents

$ claude mcp add gitmoji-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact