Skip to main content

Git actions simplified

Project description

Generate git actions without interrupting your coding flow.

git add . && git commit -am "ugh... I vide all the way, what did I do? what do I even say here?" && git push -u origin dev

⬇️

gitme -u <your-remote-branch>

gitme-cli-generate

gitme show

gitme-cli-show

Features

  • Analyzes git diffs to generate contextually relevant commit messages
  • Detects untracked files and prompts to add them
  • Supports staged changes only or all modified files
  • Streamline your git workflow: add files, commit and push to upstream branch with user confirmation on every step, extremely lightweight and fast.
  • User input: Option to edit and then confirm the messages before committing
  • Multiple AI Providers: Choose between Anthropic or OpenAI, default is Anthropic
  • Model options for both providers
  • File changes and commit message history for logging, search and review at local
  • Repository-specific message storage

Installation

Install from PyPI:

pip install gitme-cli

Or install directly from GitHub:

pip install git+https://github.com/wangjing0/gitme.git

Or develop locally:

git clone https://github.com/wangjing0/gitme.git
cd gitme
pip install -e .

AI Provider Setup

Choose one or both providers:

For Anthropic Claude (default):

export ANTHROPIC_API_KEY="your-anthropic-api-key-here"

For OpenAI GPT (Optional):

export OPENAI_API_KEY="your-openai-api-key-here"

Note: All gitme commands must be run from within a git repository directory. If you're not in a git repository, you'll see an error message prompting you to run git init.

Basic Usage

# Generate message for staged changes (default - uses Anthropic Claude)
gitme

# Generate message for all changes
gitme -a

# Generate message and commit
gitme -c

# Generate message and commit and push to remote branch
gitme -u <remote-branch>
# Use OpenAI instead of Anthropic (default)
gitme -p openai

# Use OpenAI with specific model
gitme -p openai -m gpt-4o

# Use Anthropic with specific model
gitme -m claude-3-5-haiku-latest

# Combine with other options
gitme -p openai -c  # Use OpenAI and commit

Untracked Files Handling

When you run gitme, it will automatically detect any untracked files in your repository and prompt you to add them to the staging area:

📁 Untracked files found:
    new_feature.py
    test_file.js
 Do you want to add these untracked files to the staging area? [y/N]:
  • Choose y to add all untracked files to staging and include them in the commit message generation
  • Choose N to proceed without the untracked files (they won't be included in the analysis)

Message History

# Show previous messages (includes provider/model info)
gitme show

# Show last 5 messages
gitme show -n 5

# Show from all repositories
gitme show -r

# Clear history
gitme show --clear

Enhanced Message History Display:

[1] 2025-07-20 10:30:45
    💬 Message:
    Add user authentication feature
    
    - Modified auth.py
    - Updated config.json
    - Added login.html
    🤖 AI Provider: Anthropic (claude-3-5-haiku-latest)
    📝 Files changed: 3

[2] 2025-07-20 09:15:22
    💬 Message:
    Fix authentication bug
    
    - Fixed login validation
    🤖 AI Provider: Openai (gpt-4o-mini)
    📝 Files changed: 1

Options

Generate Options

  • -s, --staged: Analyze only staged changes
  • -a, --all: Analyze all changes (staged and unstaged)
  • -p, --provider: Choose AI provider (anthropic or openai, default: anthropic)
  • -m, --model: Model to use (provider-specific)
  • -c, --commit: Create commit with generated message (uses git commit -a -m "auto-generated message")
  • -u, --upstream:Analyze all changes and create commit and push to upstream branch (specify branch name)

Show Options

  • -n, --limit: Number of messages to show
  • -r, --all-repos: Show messages from all repositories
  • --clear: Clear message history

Available Models

Anthropic Claude:

  • claude-3-5-haiku-latest (default)
  • claude-3-haiku-20240307
  • claude-3-sonnet-20240229

OpenAI GPT:

  • gpt-4o-mini (default when using OpenAI)
  • gpt-4o
  • gpt-4

Privacy & Security Notice

⚠️ Important: When using gitme or gitme generate, your code changes will be sent to the selected AI provider (Anthropic Claude or OpenAI GPT) for processing. The tool does NOT send your entire codebase - only the diff contents of changed files.

Please exercise caution when using this tool:

  • Avoid using it with repositories containing sensitive information, credentials, or proprietary code
  • Review your changes before running the command to ensure no sensitive data is included
  • Consider using .gitignore to exclude sensitive files from git tracking
  • Be aware that different providers have different data handling policies
  • Both Anthropic and OpenAI have their own privacy policies and data retention practices

Requirements

  • Python 3.8+
  • Git
  • At least one AI provider API key:
    • Anthropic API key for Claude models
    • OpenAI API key for GPT models, openai Python package for OpenAI support

New Release

chmod +x release.sh && ./release.sh <version>

then upload to PyPI

twine upload dist/*

Roadmap

  • User feedback on the generated message and modify accordingly
  • Add a way to add custom prompt to the AI provider
  • Local models with Ollama support

Contributing

Contributions are welcome! Please feel free to submit a pull request. ❤️ @wangjing0

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitme_cli-0.7.2.tar.gz (195.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitme_cli-0.7.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file gitme_cli-0.7.2.tar.gz.

File metadata

  • Download URL: gitme_cli-0.7.2.tar.gz
  • Upload date:
  • Size: 195.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for gitme_cli-0.7.2.tar.gz
Algorithm Hash digest
SHA256 f234d12f72568a38399e99940f127fa806fc87c6195295946b71d02019826ee9
MD5 dfc158acbf6a7df1ffb535b5cde561ea
BLAKE2b-256 5c89ce3ed906260dfdf4b4b7f827f2759b4c476d583eec8210c97866b56c8ed3

See more details on using hashes here.

File details

Details for the file gitme_cli-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: gitme_cli-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for gitme_cli-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eef81f68f34c34583ecd29276d6d92fee0130d4d523473e7d1e6f60ef9d22a7a
MD5 5ab2b1f7c348b6ed6cf1c8c4513c8022
BLAKE2b-256 a57ebded1daa5f40dcc0d5c90d480cd482efafdaaf53f99ad1cea1d768d9a17b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page