-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestpriority-criticalCritical priority - implement firstCritical priority - implement first
Description
Summary
Add a /commit command that analyzes staged changes and generates meaningful commit messages.
Why It's Needed
- Git Workflow: Streamline the commit process
- Better Messages: AI generates descriptive commit messages
- Consistency: Follow commit conventions automatically
- Competitor Parity: Claude Code has this feature
Usage
# In TUI
/commit # Auto-generate message from staged changes
/commit "hint about change" # Use hint to guide message generation
# CLI
codetyper commit # Same as /commit
codetyper commit --amend # Amend last commitWorkflow
1. Check for staged changes (git diff --cached)
└─ If none, offer to stage modified files
2. Analyze diff content
└─ Identify type of change (feat, fix, refactor, docs, etc.)
3. Generate commit message
└─ Follow conventional commits or repo's convention
└─ Include scope if identifiable
└─ Keep under 72 chars for subject
4. Show preview
└─ Display generated message
└─ Show files being committed
5. Confirm and execute
└─ User can edit message
└─ Execute: git commit -m "message"
6. Show result
└─ Display commit hash
└─ Show success message
Commit Message Format
<type>(<scope>): <subject>
<body>
<footer>
Types: feat, fix, docs, style, refactor, test, chore
Example Output
📝 Analyzing staged changes...
Files to commit:
M src/services/auth.ts
M src/utils/validation.ts
A src/tests/auth.test.ts
Generated commit message:
──────────────────────────────
feat(auth): add JWT token refresh mechanism
- Add automatic token refresh before expiry
- Add validation for refresh tokens
- Add unit tests for auth service
──────────────────────────────
[c]ommit [e]dit [a]bort
Acceptance Criteria
-
/commitcommand in TUI -
codetyper commitCLI command - Auto-detect conventional commits style
- Generate meaningful commit messages
- Preview before committing
- Allow message editing
- Support
--amendflag - Handle no staged changes gracefully
Effort Estimate
2 days
Future Enhancements
/prcommand for pull request creation- Auto-generate PR descriptions
- Link to issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority-criticalCritical priority - implement firstCritical priority - implement first