INNER CODE UNIT · Python
gac_commit
thomwebb/gac · src/gac/mcp/server.py:209
def gac_commit(request: CommitRequest) -> CommitResult:
"""Generate and optionally execute a git commit using AI.
This is your "action" tool - use it to create commit messages and execute
commits. GAC analyzes staged changes and generates conventional commit
messages using the configured AI model.
WHEN TO USE:
- You need to commit changes to a git repository
- You want AI-generated commit messages following best practices
- You need to stage, commit, and optionally push in one operation
IMPORTANT WORKFLOW:
1. Call gac_status() FIRST to understand repository state
2. If no staged files, either stage them first or use stage_all=True
3. Use dry_run=True to preview before executing
4. Use message_only=True to get just the message without committing
5. Use auto_confirm=True for non-interactive agent workflows