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 versionDownloadsLicense: MITGitHub 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

PatternType
*.test.ts, *.spec.tstest
*.md, *.txtdocs
*.css, *.scssstyle
package.jsonchore
.github/*ci
Dockerfilebuild
Diff contains "fix", "bug"fix
Diff contains "add", "new"feat
Defaultrefactor

πŸ”§ CI Integration

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

πŸ”— See Also

ProjectDescription
agent-traceVisualize and debug AI agent execution traces
ai-commitnpx @liangzhengtao/commit-ai β€” AI writes your commit messages
vibe-checknpx @liangzhengtao/vibe-check β€” Is your project AI-ready?
awesome-ai-rules20 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