百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

devmoji

> 开发工具
开源

:robot: :rocket: :sparkles: 使用 Devmoji 为您的传统提交添加表情符号

392 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

:robot: :rocket: :sparkles: 使用 Devmoji 为您的传统提交添加表情符号

:sparkles: Devmoji

Using Conventional Commits :star: as a standard for your commit messages, makes Semantic Versioning :bookmark: as easy as can be, with tools like Conventional Changelog :page_facing_up:, Standard Version :bookmark: and Semantic Release :package::rocket:

Devmoji is a command line tool that adds color :rainbow: to conventional commits, using emojis inspired by Gitmoji :stuck_out_tongue_winking_eye:

Some of the things Devmoji can do:

  • emojify: convert input between diferent emoji formats unicode, shortcode and devmoji. devmoji are easy to remember aliases like: :test:, :refactor:, :docs:, :security instead of hard to remember emoji codes
  • git commit: install a prepare-commit-msg commit hook to :sparkles: automagically emojify and lints your commit message
  • git log: emojify and colorify the output of git log even for projects not using emojis

What does it look like?

  • see the commit messages of the Devmoji github repository
  • generated Devmoji CHANGELOG.md

:package: Installation

Install with npm or yarn

globally

bash
npm install -g devmoji
yarn global add devmoji

locally inside your project. use with npx devmoji

bash
npm install --dev devmoji
yarn add --dev devmoji

See --edit for information on how to setup a git commit hook.

:boom: Usage

devmoji --help

…

devmoji emojify

Emojify text using --text or piping it to stdin. Input can be a combination using any valid format. Output formats:

Format Description
shortcode outputs Github Markdown short codes like :sparkles: :rocket:
unicode outputs the emoji unicode symbols like :sparkles: :rocket:
devmoji outputs the devmoji shortcodes like :feat: :chore-release:
strip removes all emoji from the input

The default format is unicode, since this can be used pretty much everywhere and has the shortest text length (relevant for commit messages)

bash
$ echo "This is a :test: of the first :release: :boom: ✨" | devmoji --format shortcode
This is a :rotating_light: of the first :rocket: :boom: :sparkles:

$ echo "This is a :test: of the first :release: :boom: :sparkles:" | devmoji --format unicode
This is a  of the first   ✨

$ echo " :boom: :sparkles:" | devmoji --format devmoji
:chore-release: :breaking: :feat:

$ echo "test  :boom: :sparkles: :security:" | devmoji --format strip
test

devmoji --commit

Automagically :sparkles: emojifies a conventional commit message of the format type(scope): something useful, using the following pseudo code:

javascript
if (exists(":type-scope:")) return emoji(":type-scope:")

if (exists(":type:") && exists(":scope:"))
  return emoji(":type:") + emoji(":scope:")

if (exists(":type:")) return emoji(":type:")

example ouput:

bash
$ echo "feat: added a new feature :smile:" | devmoji --commit
feat: ✨ added a new feature 

$ echo "chore(release): 1.1.1" | devmoji --commit
chore(release):  1.1.1

$ echo "fix(security): upgraded lodash" | devmoji --commit
fix(security):   upgraded lodash

devmoji --lint

Lints your commit message to see if they are valid conventional commits

devmoji --edit

Formats and saves your current commit message .git/COMMIT_EDITMSG. This is only really useful as a prepare-commit-msg or commit-msg hook.

When to use what hook?

  • prepare-commit-msg: use this if you do not use Devmnojis --lint option and want to use it with something like commitlint instead.
  • commit-msg: use this hook if you also want to use Devmoji for linting

Configuration using Husky

bash
# make sure husky hooks are installed
$ npx husky install

# add a hook for devmoji
$ npx husky add .husky/prepare-commit-msg "npx devmoji -e --lint"

Configuration using Yorkie

javascript
// package.json
{
  "gitHooks": {
    "prepare-commit-msg": "devmoji -e --lint"
  }
}

If you installed Devmoji locally in your project as a dev dependency, then use something like npx --no-install devmoji -e instead of the commands above.

Alternatively, if you don't want to use Husky or Yorkie, you can manually create the git hooks.

devmoji --log

Works similar to --commit, but formats type(scope): something useful anywhere in the input instead of the beginning of the first line.

This is useful to format the output of git log. Any git log option works, but my favorite alias is:

bash
$ git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset' --abbrev-commit --decorate --date=short

I'll use my alias git l, instead of the above, for clarity. The devmoji --format strip is only for demonstration purposes, since all devmoji commits already have emoji

using devmoji --log >

devmoji --list

To get a list of all available Devmoji, run with --list. (see also Default Devmoji)

:gear: Configuration

devmoji uses the config file as specified with the --config option, or looks for devmoji.config.js in the following paths:

  • current directory
  • parent directory that contains a package.json file
  • parent directory that is a git repository
  • home directory

Example Config File

…

Default Devmoji Reference

Emoji Devmoji Code Description
:sparkles: :feat: feat: a new feature
:bug: :fix: fix: a bug fix
:books: :docs: docs: documentation only changes
:art: :style: style: changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
:recycle: :refactor: refactor: a code change that neither fixes a bug nor adds a feature
:zap: :perf: perf: a code change that improves performance
:rotating_light: :test: test: adding missing or correcting existing tests
:wrench: :chore: chore: changes to the build process or auxiliary tools and libraries such as documentation generation
:rocket: :chore-release: chore(release): code deployment or publishing to external repositories
:link: :chore-deps: chore(deps): add or delete dependencies
:package: :build: build: changes related to build processes
:construction_worker: :ci: ci: updates to the continuous integration system
:rocket: :release: code deployment or publishing to external repositories
:lock: :security: Fixing security issues.
:globe_with_meridians: :i18n: Internationalization and localization.
:boom: :breaking: Introducing breaking changes.
:gear: :config: Changing configuration files.
:heavy_plus_sign: :add: add something
:heavy_minus_sign: :remove: remove something

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptclicommitcommit-messageconventional-changelog

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具