chegi commit¶
Record changes to the repository with built-in security checks and smart defaults.
Synopsis¶
chegi commit [OPTIONS]
Description¶
chegi commit is a secure replacement for git commit. It automatically:
- Scans staged files for sensitive data (secrets, credentials, keys)
- Shows a styled diff summary of staged changes
- Guides you step-by-step with commit style selection, field filling, and preview
- Suggests commit messages based on what was changed
- Executes the commit after validation
Options¶
| Option | Short | Description | Default |
|---|---|---|---|
--message |
-m |
The commit message (skips interactive prompt) | null |
--force |
Commit even if sensitive files are detected | false |
|
--chegi-header |
--ch |
Add the cheGi brand signature 🐆 to the subject line |
false |
Interactive Flow¶
When called without -m, chegi commit walks you through a guided flow:
- Security scan — auto-runs guard on staged files
- Styled diff — file names shown in brand color
- Style selection — choose from 5 built-in styles:
- Free — just a description, no prefix
- Conventional —
type: description - Conventional with scope —
type(scope): description - Conventional with body —
type(scope): description + body bullets - Gitmoji —
emoji type: description - Field filling — prompts based on your style choice (type, scope, description, body)
- Preview — shows the final message in a styled panel
- Confirmation — asks before executing
- Brand hint — on your first single-line commit, shows a tip about
--ch
Examples¶
Interactive commit (recommended)¶
chegi commit
With inline message¶
chegi commit -m "feat: add user authentication"
Skips the interactive prompt but still runs security checks.
With brand signature¶
chegi commit -m "feat: add login" --ch
Appends 🐆 to the subject line: feat: add login 🐆
Force commit with sensitive files¶
chegi commit --force
Brand signature in guided mode¶
chegi commit --ch
Commit Styles¶
Free¶
init project
Conventional¶
feat: init project
Conventional with scope¶
feat(init): Init project
Conventional with body¶
feat(init): Init project
- Set up project structure
- Add configuration files
Gitmoji¶
✨ feat: init project
Custom Styles¶
Create .chegi/commit-styles.json in your repository:
{
"styles": [
{
"name": "custom-prefix",
"label": "Custom Prefix",
"description": "prefix: description",
"fields": ["prefix", "description"]
}
]
}
Security Flow¶
When sensitive files are detected in staging, cheGi presents three options:
- Unstage sensitive files and continue — removes the files from staging and proceeds
- Force commit anyway — commits with sensitive files (not recommended)
- Abort commit — exits without committing
Brand Signature¶
Use --ch or --chegi-header to add 🐆 at the end of the subject line:
feat(auth): add login functionality 🐆
This is a single-line addition — the body is never modified.
Exit Codes¶
| Code | Meaning |
|---|---|
0 |
Commit successful |
1 |
Not a Git repository, no staged files, sensitive files detected, commit failed, or user aborted |