Dark mode
cz-git (Commitizen Git)
เครื่องมือช่วยเขียน commit message แบบ standardized
Installation
bash
npm install -g czg
bash
yarn global add czg
bash
pnpm add -g czg
Benefits
Feature | Description | Example |
---|---|---|
มาตรฐาน Commit Message | ช่วยให้ทีมเขียน commit message ที่สม่ำเสมอตาม Conventional Commits specification | feat: add login feature |
Interactive Prompt | มีระบบถามคำถามแบบขั้นตอนเพื่อช่วยกรอกข้อมูล commit message ที่ครบถ้วน | ![]() |
Type Validation | ตรวจสอบประเภทของ commit (feat, fix, docs, etc.) ให้ถูกต้องตามมาตรฐาน | fix: , feat: , docs: |
Scope Suggestions | แนะนำ scope จากไฟล์ที่แก้ไขอัตโนมัติ | feat(login): add button |
Breaking Changes Detection | ช่วยระบุและจัดรูปแบบ breaking changes ให้ถูกต้อง | feat!: remove deprecated API |
Issue Reference | เชื่อมโยงกับ issue tracker อัตโนมัติ | Closes #123 |
Customizable | สามารถปรับแต่งประเภท commit, scope และข้อความ prompt ได้ | types: ['feat', 'fix', 'custom'] |
Git Hook Support | ใช้งานร่วมกับ git hooks เช่น commit-msg ได้ง่าย | husky + commit-msg hook |
Multi-language | รองรับหลายภาษา รวมทั้งภาษาไทย | ข้อความ prompt ภาษาไทย |
Integration | ทำงานร่วมกับ tools อื่นๆ เช่น commitlint, husky ได้สะดวก | commitlint.config.js |
Configuration
ตัวอย่างการตั้งค่าในไฟล์ cz.config.ts
:
ts
import type { UserConfig } from 'cz-git'
export default {
path: 'cz-git',
useEmoji: true,
scopes: ['component', 'page', 'api'],
types: [
{ value: 'feat', name: 'feat: A new feature' },
{ value: 'fix', name: 'fix: A bug fix' },
{ value: 'docs', name: 'docs: Documentation only changes' }
],
messages: {
type: "Select the type of change that you're committing:",
subject: "Write a short, imperative tense description of the change:"
}
} satisfies UserConfig
Usage
พิมพ์ czg ai
เพื่อใช้งาน