Skip to content

Instantly share code, notes, and snippets.

@da1z
Created January 6, 2026 22:29
Show Gist options
  • Select an option

  • Save da1z/f4638dda8ba4b1db1843fa65d46e0cca to your computer and use it in GitHub Desktop.

Select an option

Save da1z/f4638dda8ba4b1db1843fa65d46e0cca to your computer and use it in GitHub Desktop.
Generate commit messages with claude code
gp() {
git add .
git commit -m "$(git diff --cached | claude -p --model haiku --output-format json --json-schema '{"type":"object","properties":{"commit_message":{"type":"string"}},"required":["commit_message"]}' "Generate a commit message" | jq -r '.structured_output.commit_message')"
git push
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment