AI Features

Understand how GitGuru uses artificial intelligence to enhance your Git workflow.

Overview

GitGuru leverages Google's Gemini AI to provide intelligent Git assistance. The AI understands natural language, analyzes your repository context, and provides safe, actionable suggestions.

Natural Language Processing

GitGuru's AI can understand Git questions in plain English. You don't need to know exact command syntax - just describe what you want to do:

bash
gg ask "how do I undo my last commit?"
gg ask "create a new branch for login feature"
gg ask "see what changed in the last 5 commits"

How It Works

  1. Intent Recognition: The AI analyzes your question to understand what you're trying to achieve
  2. Context Analysis: GitGuru examines your current repository state
  3. Command Generation: The AI suggests the most appropriate Git command
  4. Safety Evaluation: Each suggestion is rated for safety (Safe, Caution, Dangerous)
  5. Explanation: You receive a clear explanation of what the command does

AI-Generated Commit Messages

One of GitGuru's most powerful features is automatic commit message generation. The AI analyzes your staged changes to create meaningful, conventional commit messages:

bash
gg commit --ai

What the AI Analyzes

  • File Changes: Which files were modified, added, or deleted
  • Diff Content: The actual code changes in each file
  • Change Patterns: Whether changes are features, fixes, refactors, etc.
  • Project Context: File types, directory structure, and naming patterns
Conventional Commits
GitGuru automatically formats commit messages following the conventional commits specification, making your commit history clean and useful for changelog generation.

Safety Analysis

Every AI suggestion includes a safety rating to help you understand the risk level:

Safe Operations

Read-only commands that don't modify your repository. No risk of data loss.

git status
git log
git diff
git show

Caution Required

Commands that modify your working directory but can be reversed or recovered from.

git reset --soft
git stash
git checkout
git restore

Dangerous Operations

Commands that can permanently delete data or rewrite history. Requires extra caution.

git reset --hard
git push --force
git clean -fd
git rebase -i

Interactive Learning

Use gg explain to learn Git concepts interactively:

bash
gg explain "What is rebasing?"
gg explain "difference between merge and rebase"
gg explain "git reset --hard HEAD~1"

The AI provides contextual explanations with examples, helping you learn Git while you work.

AI Model Information

GitGuru uses Google's Gemini AI models:

ModelUse CaseFeatures
gemini-proCommand suggestions, Q&AFast, efficient, free tier
gemini-proCommit messagesContext-aware, conventional format

Privacy & Security

Your Data is Safe
GitGuru only sends the necessary context to generate suggestions. Your code stays on your machine, and API calls are made directly from your computer to Google's servers.
  • API keys are stored locally in your home directory
  • No code is uploaded to GitGuru servers (we don't have any!)
  • Only relevant diff snippets are sent to Gemini for commit messages
  • All communication uses HTTPS encryption

Limitations

While powerful, AI has some limitations:

  • Not Perfect: Always review AI suggestions before executing
  • Context Dependent: Better suggestions require clear questions
  • No Repository Access: AI doesn't read your entire codebase
  • Rate Limits: Free tier has usage limits (generous for most users)
Always review AI-generated commands before executing, especially for operations marked as Dangerous.

Best Practices

  • Be specific in your questions for better suggestions
  • Use natural language - the AI understands context
  • Always read explanations before confirming commands
  • Review generated commit messages and edit if needed
  • Use AI for learning - ask "why" and "how" questions