Skip to content

Repository files navigation

English | ไธญๆ–‡ | ๆ—ฅๆœฌ่ชž | Franรงais | Espaรฑol | ุงู„ุนุฑุจูŠุฉ | ํ•œ๊ตญ์–ด | Portuguรชs | ะ ัƒััะบะธะน | Deutsch

๐Ÿ”– git-format | Git ๆ ผๅผๅŒ– | Gitใƒ•ใ‚ฉใƒผใƒžใƒƒใƒˆ | Format Git | Formato Git | ุชู†ุณูŠู‚ Git

npx @liangzhengtao/git-format โ€” Conventional commits, zero effort.

Format git commit messages according to conventional commits. No API key needed.

npm version Downloads License: MIT GitHub Stars


๐Ÿ“‘ Table of Contents


๐Ÿš€ Quick Start

# Stage your changes
git add .

# Auto-format and commit
npx @liangzhengtao/git-format

# Or just preview (dry run)
npx @liangzhengtao/git-format --dry-run

๐Ÿ” What It Does

  1. Reads your staged files
  2. Detects the commit type (feat/fix/docs/test/etc.)
  3. Detects the scope from file paths
  4. Generates a conventional commit message
  5. Commits with the formatted message

๐Ÿ’ก Examples

# Stage a new feature
git add src/auth/login.ts
npx @liangzhengtao/git-format
# โ†’ feat(auth): add new feature in src/auth/login.ts

# Stage a bug fix
git add src/api/users.ts
git commit -m "fix bug"
npx @liangzhengtao/git-format
# โ†’ fix(api): fix issue in src/api/users.ts

# Stage documentation
git add README.md
npx @liangzhengtao/git-format
# โ†’ docs: update documentation

โš™๏ธ Options

npx @liangzhengtao/git-format [options]

Options:
  -d, --dry-run   Show message without committing
  -j, --json      Output as JSON
  -q, --quiet     Suppress output
  -h, --help      Display help
  -V, --version   Display version

๐Ÿ“Š Type Detection

Pattern Type
*.test.ts, *.spec.ts test
*.md, *.txt docs
*.css, *.scss style
package.json chore
.github/* ci
Dockerfile build
Diff contains "fix", "bug" fix
Diff contains "add", "new" feat
Default refactor

๐Ÿ”ง CI Integration

# GitHub Actions
- name: Auto-format commits
  run: |
    git add .
    npx @liangzhengtao/git-format
    git push

๐Ÿ”— See Also

Project Description
agent-trace Visualize and debug AI agent execution traces
ai-commit npx @liangzhengtao/commit-ai โ€” AI writes your commit messages
vibe-check npx @liangzhengtao/vibe-check โ€” Is your project AI-ready?
awesome-ai-rules 20 production AI coding rules

๐Ÿ“„ License

MIT


Found this useful? Give it a โญ

About

๐Ÿ”ง Format git commits to Conventional Commits. Auto-detect type, scope. npx @liangzhengtao/git-format

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages