Skip to main content

AI-powered Git CLI for commits, changelogs, and semantic versioning.

Project description

🚀 TGIT - Tool for Git Interaction Temptation

CodeTime Badge CI codecov PyPI version Python 3.11+ License: MIT

TGIT is an AI-powered Git CLI for commit messages, changelog generation, and semantic versioning.

  • Generate conventional commits from staged changes
  • Build changelogs from commit history
  • Bump versions across common project files
  • Manage settings from .tgit.yaml or an interactive CLI

🔗 Links

✨ Features

🤖 AI-Powered Commits

  • Generate conventional commit messages automatically using OpenAI
  • Smart diff analysis that focuses on meaningful changes
  • Support for custom commit types and emojis
  • Breaking change detection
  • Two-level secret scanning: prompts (default yes) for key names and blocking prompts for exposed values

📝 Automated Changelog

  • Generate beautiful, structured changelogs from conventional commits
  • Group commits by type with emoji categorization
  • Support for multiple output formats
  • Automatic git remote URL detection for commit links

🔢 Intelligent Version Management

  • Semantic versioning with pre-release support
  • Support for multiple project files (package.json, pyproject.toml, Cargo.toml, etc.)
  • Automatic version bumping based on commit history
  • Git tagging integration

⚙️ Flexible Configuration

  • Global and workspace-specific settings
  • YAML-based configuration files
  • Interactive settings management
  • Customizable commit types and emojis

🚀 Quick Start

Installation

uv tool install tgit
pipx install tgit
pip install tgit

Basic Usage

# Configure TGIT
tgit settings

# Generate an AI-powered commit message from staged changes
tgit commit

# Generate changelog for current version
tgit changelog

# Bump version and generate changelog
tgit version

Configuration

The recommended way to configure TGIT is through the interactive settings command:

# Interactive configuration - recommended!
tgit settings

This will guide you through setting up:

  • OpenAI API key for AI-powered commits
  • Preferred AI model (gpt-5-mini, gpt-4.1, etc.)
  • Optional reasoning effort override (none, minimal, low, medium, high, xhigh)
  • Commit emoji preferences
  • Custom commit types
  • Global and workspace settings paths during view and save flows
  • Workspace overrides using effective defaults, with empty values falling back to inherited settings

Alternatively, you can manually create a .tgit.yaml file in your project root or ~/.tgit.yaml for global settings:

apiKey: "your-openai-api-key"
model: "gpt-5-mini"
reasoning_effort: "medium"
commit:
  emoji: true
  types:
    - type: "feat"
      emoji: "✨"
    - type: "fix"
      emoji: "🐛"

📖 Commands

Commit

# AI-powered commit
tgit commit

# Breaking change commit
tgit commit --breaking "remove deprecated api"

Changelog

# Generate changelog for current version
tgit changelog

# Generate changelog from specific version
tgit changelog --from v1.0.0

# Generate changelog to specific version
tgit changelog --to v2.0.0

Version

# Interactive version bump
tgit version

# Limit to root only (disable recursive bump)
tgit version --no-recursive

# Bump specific version type
tgit version --patch
tgit version --minor
tgit version --major

# Pre-release version
tgit version --prerelease alpha

Settings

# Interactive settings configuration
tgit settings

# Show current settings
tgit settings --show

When configuring workspace settings interactively, TGIT shows the effective values that are currently in use. Leave a string field empty to inherit from the global/default value, or choose Follow global/default for boolean settings.

You can also override the default reasoning effort used for AI commit generation with reasoning_effort. Use auto in the non-interactive settings command, or leave the field empty in interactive settings, to omit the field and fall back to the model-specific default. Those defaults vary by model family, for example gpt-5 defaults to medium, while gpt-5.4-mini defaults to none.

🛠️ Development

Setup

# Clone the repository
git clone https://github.com/Jannchie/tgit.git
cd tgit

# Install dependencies
uv sync

Testing

# Run all tests
./scripts/test.sh

# Run with coverage
./scripts/test.sh --coverage 90

# Run specific test types
./scripts/test.sh --unit
./scripts/test.sh --integration

Code Quality

# Run linting
uv run ruff check .

# Run formatting
uv run ruff format .

# Build package
uv build

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📞 Support

If you encounter any problems or have suggestions, please open an issue on GitHub.

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

tgit-0.31.0.tar.gz (136.6 kB view details)

Uploaded Source

Built Distribution

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

tgit-0.31.0-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file tgit-0.31.0.tar.gz.

File metadata

  • Download URL: tgit-0.31.0.tar.gz
  • Upload date:
  • Size: 136.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tgit-0.31.0.tar.gz
Algorithm Hash digest
SHA256 1ee28ed3fde9a6f664b2b036ca224842e48ab3d509985eada68d567d0250c15e
MD5 b84275db8e31d19e7bfc3dad1f1c1bc4
BLAKE2b-256 09bf7f5e782635287164d76b41c9d0a1e2bcf2d6d16ff9a525aa793b12b63a77

See more details on using hashes here.

File details

Details for the file tgit-0.31.0-py3-none-any.whl.

File metadata

  • Download URL: tgit-0.31.0-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tgit-0.31.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76082dfb5990354aee8e5442de1fbe6054fe41cc55c92ae9268b7cbb9fc1cf72
MD5 972aa6adcb5e5c8a17bba39d564c4ae7
BLAKE2b-256 f181ae19b6ad7ea8247d352fd4fb80ba543bc96498b4e6520cda6e9b0e11d12b

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