grokkit/docs/user-guide/commit.md
Greg Gauthier cd47686679
All checks were successful
CI / Test (pull_request) Successful in 42s
CI / Lint (pull_request) Successful in 27s
CI / Build (pull_request) Successful in 23s
docs: refactor README and docs structure for better organization
- Simplified README.md by moving detailed command docs, workflows, and development info to dedicated user-guide/ and developer-guide/ directories.
- Created index.md files for both guides to improve navigation.
- Extracted individual command guides (e.g., chat.md, edit.md) into user-guide/ for focused, maintainable documentation.
- Moved architecture, configuration, and troubleshooting to developer-guide/.
- Updated README links to point to the new docs structure.
2026-03-07 22:42:43 +00:00

59 lines
2.0 KiB
Markdown

# ✅ Commit Guide
Grokkit provides two commands to help you generate high-quality, conventional commit messages from your staged changes: `commit-msg` and `commit`.
### Commit-msg
The `commit-msg` command generates a conventional commit message based on your currently staged changes (`git add`). It's perfect for when you want to review the message before using it in your commit.
#### Usage
```bash
git add .
grokkit commit-msg
```
**Output Example:**
```text
feat(git): add support for custom commit message templates
Implemented a new system for defining custom templates for commit messages, allowing for project-specific conventions.
```
### Commit
The `commit` command generates a commit message and commits in one step.
#### Usage
```bash
git add .
grokkit commit # Generate + confirm + commit
```
**Interactive Workflow:**
1. Grokkit analyzes your staged changes.
2. It generates a conventional commit message.
3. It shows you the proposed message.
4. It asks for confirmation: `Commit with this message? (y/n): `.
5. If you confirm, it runs `git commit -m "<message>"`.
### Why use AI for Commits?
- **Conventional Format**: Automatically follows the `type(scope): subject` format.
- **Accurate Descriptions**: Grok analyzes the actual diff to provide a meaningful summary of your changes.
- **Consistency**: Ensures that all commit messages in your project follow the same high standard.
- **Save Time**: No more staring at a blank screen trying to remember everything you changed.
### Options
| Flag | Description |
|------|-------------|
| `--model`, `-m` | Override the default model (e.g., `grok-4`) |
### Best Practices
- **Stage only relevant changes**: For the best commit message, only stage the changes that belong in a single commit.
- **Review before committing**: Always read the generated message to ensure it accurately reflects your intent.
- **Model selection**: For complex changes, use a more powerful model like `grok-4` to get a better summary.