### Install Gitmoji Node Module
Source: https://github.com/carloscuesta/gitmoji/blob/master/packages/gitmojis/README.md
Install the gitmojis package using npm.
```bash
npm i gitmojis
```
--------------------------------
### Install gitmoji-cli
Source: https://github.com/carloscuesta/gitmoji/blob/master/README.md
Install the gitmoji command-line interface globally using npm. This tool helps in using gitmojis interactively in commit messages.
```bash
npm i -g gitmoji-cli
```
--------------------------------
### Example: Feature Commit
Source: https://github.com/carloscuesta/gitmoji/blob/master/AGENTS.md
Demonstrates a feature commit using the 'feat' gitmoji (โจ), including a brief description and issue tracking.
```gitcommit
โจ feat: Add user authentication system
Implement JWT-based authentication with login and registration endpoints.
Closes #123
```
--------------------------------
### Example: Documentation Commit
Source: https://github.com/carloscuesta/gitmoji/blob/master/AGENTS.md
Illustrates a commit for documentation updates using the 'docs' gitmoji (๐), specifying the changes made.
```gitcommit
๐ docs: Update installation instructions
Added step-by-step guide for setting up the development environment.
```
--------------------------------
### Install and use gitmoji-cli
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Install the gitmoji-cli globally to use its interactive features for creating gitmoji-formatted commit messages. It provides an emoji picker and prompts for scope and message.
```bash
# Install globally
npm i -g gitmoji-cli
```
```bash
# Interactive commit โ opens an emoji picker then prompts for scope and message
gitmoji -c
```
```bash
# List all available gitmojis in the terminal
gitmoji -l
```
```bash
# Search gitmojis by keyword
gitmoji -s "fix"
# ๐ - :bug: - Fix a bug.
# ๐๏ธ - :ambulance: - Critical hotfix.
# ๐๏ธ - :lock: - Fix security or privacy issues.
```
```bash
# Update the local gitmoji cache
gitmoji -u
```
```bash
# Install gitmoji as a git commit-msg hook in the current repo
gitmoji -i
# After this, running `git commit` launches the interactive gitmoji prompt automatically
```
--------------------------------
### Import and Use Gitmoji Dataset in Node.js/Browser
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Install the 'gitmojis' package to programmatically use or search the dataset. Inspect the full dataset, find gitmojis by shortcode, filter by semver impact, or group them.
```javascript
import { gitmojis } from 'gitmojis'
// Inspect the full dataset
console.log(gitmojis.length) // e.g. 73
// Find a gitmoji by its shortcode
const bugFix = gitmojis.find((g) => g.code === ':bug:')
console.log(bugFix)
/*
{
emoji: '๐',
entity: '🐛',
code: ':bug:',
description: 'Fix a bug.',
name: 'bug',
semver: 'patch'
}
*/
// Filter all gitmojis that affect semantic versioning
const semverGitmojis = gitmojis.filter((g) => g.semver !== null)
semverGitmojis.forEach(({ emoji, code, semver }) => {
console.log(`${emoji} ${code} โ semver: ${semver}`)
})
/*
โก๏ธ :zap: โ semver: patch
๐ :bug: โ semver: patch
โจ :sparkles: โ semver: minor
๐ฅ :boom: โ semver: major
...
*/
// Group gitmojis by semver impact
const grouped = gitmojis.reduce((acc, g) => {
const key = g.semver ?? 'none'
acc[key] = acc[key] ?? []
acc[key].push(g.emoji)
return acc
}, {})
console.log(grouped)
/*
{
none: ['๐จ', '๐ฅ', '๐', '๐', ...],
patch: ['โก๏ธ', '๐', '๐๏ธ', '๐๏ธ', ...],
minor: ['โจ'],
major: ['๐ฅ']
}
*/
```
--------------------------------
### Example: Performance Improvement Commit
Source: https://github.com/carloscuesta/gitmoji/blob/master/AGENTS.md
Demonstrates a commit for performance optimization using the 'perf' gitmoji (โก๏ธ), highlighting the impact on query time.
```gitcommit
โก๏ธ Optimize user query with indexing
Reduced query time from 500ms to 50ms by adding composite index.
```
--------------------------------
### Example: Fix Commit
Source: https://github.com/carloscuesta/gitmoji/blob/master/AGENTS.md
Shows a commit for fixing a bug using the 'fix' gitmoji (๐), detailing the issue and the solution.
```gitcommit
๐ Resolve null pointer exception in user service
Added null check before accessing user properties to prevent crashes.
```
--------------------------------
### Example: Breaking Change Commit
Source: https://github.com/carloscuesta/gitmoji/blob/master/AGENTS.md
Shows a commit for a breaking change using the 'breaking' gitmoji (๐ฅ), explaining the necessary client-side adjustments.
```gitcommit
๐ฅ Update API response format to REST specification
All API endpoints now return data in a standardized envelope format.
Clients must update their response parsing logic.
```
--------------------------------
### Fetch Gitmojis via API
Source: https://github.com/carloscuesta/gitmoji/blob/master/packages/gitmojis/README.md
Retrieve the list of gitmojis by making an HTTP GET request to the gitmoji API endpoint.
```bash
curl https://gitmoji.dev/api/gitmojis
```
--------------------------------
### Import the full emoji dataset from the `gitmojis` npm package
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Install the `gitmojis` package to programmatically use or search the dataset in your Node.js or browser projects. This snippet shows how to import the dataset and perform common operations like finding a gitmoji by its shortcode or filtering by semver impact.
```APIDOC
## Import gitmojis
### Description
Import the full dataset of gitmojis from the `gitmojis` npm package.
### Usage
```javascript
import { gitmojis } from 'gitmojis'
// Inspect the full dataset
console.log(gitmojis.length) // e.g. 73
// Find a gitmoji by its shortcode
const bugFix = gitmojis.find((g) => g.code === ':bug:')
console.log(bugFix)
/*
{
emoji: '๐',
entity: '🐛',
code: ':bug:',
description: 'Fix a bug.',
name: 'bug',
semver: 'patch'
}
*/
// Filter all gitmojis that affect semantic versioning
const semverGitmojis = gitmojis.filter((g) => g.semver !== null)
semverGitmojis.forEach(({ emoji, code, semver }) => {
console.log(`${emoji} ${code} โ semver: ${semver}`)
})
/*
โก๏ธ :zap: โ semver: patch
๐ :bug: โ semver: patch
โจ :sparkles: โ semver: minor
๐ฅ :boom: โ semver: major
...
*/
// Group gitmojis by semver impact
const grouped = gitmojis.reduce((acc, g) => {
const key = g.semver ?? 'none'
acc[key] = acc[key] ?? []
acc[key].push(g.emoji)
return acc
}, {})
console.log(grouped)
/*
{
none: ['๐จ', '๐ฅ', '๐', '๐', ...],
patch: ['โก๏ธ', '๐', '๐๏ธ', '๐๏ธ', ...],
minor: ['โจ'],
major: ['๐ฅ']
}
*/
```
```
--------------------------------
### Fetch Gitmojis via HTTP API
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Access the full list of gitmojis from the public REST endpoint. Examples show fetching all gitmojis, pretty-printing with jq, filtering semver-affecting gitmojis, and looking up a single gitmoji by name.
```bash
# Fetch all gitmojis
curl https://gitmoji.dev/api/gitmojis
# Pretty-print with jq
curl -s https://gitmoji.dev/api/gitmojis | jq '.gitmojis[0:3]'
# [
# {
# "emoji": "๐จ",
# "entity": "🎨",
# "code": ":art:",
# "description": "Improve structure / format of the code.",
# "name": "art",
# "semver": null
# },
# {
# "emoji": "โก๏ธ",
# "entity": "⚡",
# "code": ":zap:",
# "description": "Improve performance.",
# "name": "zap",
# "semver": "patch"
# },
# ...
# ]
# Filter to only semver-affecting gitmojis via jq
curl -s https://gitmoji.dev/api/gitmojis \
| jq '[.gitmojis[] | select(.semver != null) | {emoji, code, semver}]'
# Look up a single gitmoji by name
curl -s https://gitmoji.dev/api/gitmojis \
| jq '.gitmojis[] | select(.name == "sparkles")'
# {
# "emoji": "โจ",
# "entity": "✨",
# "code": ":sparkles:",
# "description": "Introduce new features.",
# "name": "sparkles",
# "semver": "minor"
# }
```
--------------------------------
### Import and Use Gitmoji JSON Schema
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Import the JSON Schema (Draft 2020-12) from the 'gitmojis' package to validate custom datasets or integrate with schema-aware editors. Example shows validation using ajv.
```javascript
import { schema } from 'gitmojis'
// Inspect the schema
console.log(schema.$schema) // 'https://json-schema.org/draft/2020-12/schema'
console.log(schema.properties.gitmojis.items.required)
// ['emoji', 'entity', 'code', 'description', 'name', 'semver']
// Validate a custom gitmoji object using ajv
import Ajv from 'ajv/dist/2020.js'
const ajv = new Ajv()
const validate = ajv.compile(schema)
const customDataset = {
gitmojis: [
{
emoji: '๐งช',
entity: '🧪',
code: ':test_tube:',
description: 'Add a failing test.',
name: 'test-tube',
semver: null
}
]
}
const valid = validate(customDataset)
console.log(valid) // true
console.log(validate.errors) // null
```
--------------------------------
### HTTP API - GET /api/gitmojis
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
This publicly accessible, no-auth REST endpoint returns the full list of gitmojis. It's suitable for integrations, bots, IDE plugins, and CI tools that prefer HTTP over an npm dependency.
```APIDOC
## GET /api/gitmojis
### Description
Fetches the full list of gitmojis from the static JSON REST endpoint.
### Method
GET
### Endpoint
`https://gitmoji.dev/api/gitmojis`
### Parameters
None
### Request Example
```bash
curl https://gitmoji.dev/api/gitmojis
```
### Response
#### Success Response (200)
Returns a JSON object containing an array of gitmoji objects. Each gitmoji object includes:
- **emoji** (string): The emoji character.
- **entity** (string): The HTML entity for the emoji.
- **code** (string): The shortcode for the emoji (e.g., `:bug:`).
- **description** (string): A human-readable description of the gitmoji's purpose.
- **name** (string): The slugified name of the gitmoji.
- **semver** (string | null): The semantic versioning impact ('patch', 'minor', 'major') or null if it doesn't affect semver.
#### Response Example
```json
{
"gitmojis": [
{
"emoji": "๐จ",
"entity": "🎨",
"code": ":art:",
"description": "Improve structure / format of the code.",
"name": "art",
"semver": null
},
{
"emoji": "โก๏ธ",
"entity": "⚡",
"code": ":zap:",
"description": "Improve performance.",
"name": "zap",
"semver": "patch"
},
...
]
}
```
### Usage Examples
Fetch all gitmojis:
```bash
curl https://gitmoji.dev/api/gitmojis
```
Pretty-print with jq:
```bash
curl -s https://gitmoji.dev/api/gitmojis | jq '.gitmojis[0:3]'
```
Filter to only semver-affecting gitmojis via jq:
```bash
curl -s https://gitmoji.dev/api/gitmojis \
| jq '[.gitmojis[] | select(.semver != null) | {emoji, code, semver}]'
```
Look up a single gitmoji by name:
```bash
curl -s https://gitmoji.dev/api/gitmojis \
| jq '.gitmojis[] | select(.name == "sparkles")'
```
```
--------------------------------
### Import and Log Gitmojis
Source: https://github.com/carloscuesta/gitmoji/blob/master/packages/gitmojis/README.md
Import the gitmojis array from the package and log it to the console to view all available gitmojis.
```javascript
import { gitmojis } from 'gitmojis'
console.log(gitmojis)
```
--------------------------------
### Add Gitmoji Badge to README
Source: https://github.com/carloscuesta/gitmoji/blob/master/packages/gitmojis/README.md
Include this HTML snippet in your project's README file to display the Gitmoji badge.
```html
```
--------------------------------
### Gitmoji badge for README.md (Markdown)
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Use Markdown syntax to include a gitmoji badge in your README.md. This provides a visual indicator for contributors that the project adheres to the gitmoji standard.
```markdown
[](https://gitmoji.dev)
```
--------------------------------
### Gitmoji Commit Message Format
Source: https://github.com/carloscuesta/gitmoji/blob/master/AGENTS.md
Illustrates the structure of a gitmoji commit message, including intention, optional scope, and the main message.
```markdown
[scope?][:?]
[optional body]
```
--------------------------------
### Export `schema` from the `gitmojis` npm package
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
The `gitmojis` package also exports the JSON Schema (Draft 2020-12) used to validate the dataset. Use it to validate custom gitmoji datasets, build tooling, or integrate with schema-aware editors.
```APIDOC
## Export schema
### Description
Exports the JSON Schema used to validate the gitmoji dataset.
### Usage
```javascript
import { schema } from 'gitmojis'
// Inspect the schema
console.log(schema.$schema) // 'https://json-schema.org/draft/2020-12/schema'
console.log(schema.properties.gitmojis.items.required)
// ['emoji', 'entity', 'code', 'description', 'name', 'semver']
// Validate a custom gitmoji object using ajv
import Ajv from 'ajv/dist/2020.js'
const ajv = new Ajv()
const validate = ajv.compile(schema)
const customDataset = {
gitmojis: [
{
emoji: '๐งช',
entity: '🧪',
code: ':test_tube:',
description: 'Add a failing test.',
name: 'test-tube',
semver: null
}
]
}
const valid = validate(customDataset)
console.log(valid) // true
console.log(validate.errors) // null
```
```
--------------------------------
### Commit messages with emoji shortcodes
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Use emoji shortcodes (e.g., :sparkles:) in commit messages for compatibility with platforms like GitHub and GitLab. These are rendered as emojis by the platform.
```bash
git commit -m ":sparkles: Add user authentication"
```
```bash
git commit -m ":bug: Fix null pointer in login handler"
```
```bash
git commit -m ":recycle: (auth): Refactor token validation logic"
```
--------------------------------
### Gitmoji JSON data structure
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Define gitmojis in a JSON file, conforming to a specific schema. Each entry includes emoji, entity, code, description, name, and optional semver impact.
```json
{
"$schema": "https://gitmoji.dev/api/gitmojis/schema",
"gitmojis": [
{
"emoji": "๐งช",
"entity": "🧪",
"code": ":test_tube:",
"description": "Add a failing test.",
"name": "test-tube",
"semver": null
},
{
"emoji": "๐ฅ",
"entity": "💥",
"code": ":boom:",
"description": "Introduce breaking changes.",
"name": "boom",
"semver": "major"
},
{
"emoji": "โจ",
"entity": "✨",
"code": ":sparkles:",
"description": "Introduce new features.",
"name": "sparkles",
"semver": "minor"
},
{
"emoji": "๐",
"entity": "🐛",
"code": ":bug:",
"description": "Fix a bug.",
"name": "bug",
"semver": "patch"
}
]
}
```
--------------------------------
### Commit messages with scope using colon separator
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Include a scope in your commit messages, enclosed in parentheses and followed by a colon, to provide more context about the change. This is often used with Unicode emojis.
```bash
git commit -m "๐ (i18n): Support Japanese language"
```
```bash
git commit -m "โฟ๏ธ (account): Improve modal accessibility"
```
```bash
git commit -m "๐ Bump version 1.2.0"
```
--------------------------------
### Commit messages with Unicode emojis
Source: https://context7.com/carloscuesta/gitmoji/llms.txt
Use Unicode emojis directly in commit messages for a visually rich git log. Ensure your terminal supports emoji rendering.
```bash
git commit -m "โจ Add user authentication"
```
```bash
git commit -m "๐ Fix null pointer in login handler"
```
```bash
git commit -m "โป๏ธ (auth): Refactor token validation logic"
```
```bash
git commit -m "๐ Update API reference docs"
```
```bash
git commit -m "๐ Deploy to production"
```
```bash
git commit -m "๐ฅ Drop support for Node 14"
```
```bash
git commit -m "โฌ๏ธ Upgrade dependencies to latest versions"
```
```bash
git commit -m "โ
Add unit tests for payment module"
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.