Skip to main content

An AI assistant for git operations using FastMCP.

Project description

Git Flash: Barry Allen of the CLI

Git Flash Logo

This tool uses FastMCP and the Google Gemini API to provide an AI-powered git assistant. It can function as an agent to execute a series of git commands based on natural language, or it can be used to simply generate a commit message for your staged changes.

Setup

Git Flash Setup and Demo

  1. Set Your API Key: This tool requires a Gemini API key. The first time you run it, it will prompt you to enter your key and offer to save it to ~/.config/git-flash/.env. Alternatively, you can set it as an environment variable:

    export GEMINI_API_KEY="your-gemini-api-key"
    
  2. Install the Package: Navigate to the git-flash directory and install it using pip. Using the -e flag (editable mode) is recommended for development.

    pip install git-flash
    

    This command installs the git-flash command into your system's PATH.

Usage

You can run the assistant from within any git repository directory.

Mode 1: Agentic Flow (Natural Language)

Provide an instruction in plain English, and the agent will determine the necessary git commands and execute them one by one.

Examples:

# Create a new branch and switch to it
git flash "create a new feature branch called 'login-flow' and check it out"

# Stash changes, switch branches, and pop the stash
git flash "stash my current work, switch to the 'main' branch, and then apply my stash"

# List all branches, local and remote
git flash "show me all the branches"

# File and directory creation/deletion
git flash "create a file named 'docs/plan.md' and write a to-do list for the new feature"

# File and directory manipulation
git flash git flash "reorganize files as production"

Mode 2: Manual Commit Message

If you know what you want to commit, use the -m or --message option. This will stage all current changes and commit with your message.

git flash -m "feat: add user authentication endpoint"

Dry Run

For any of the modes, you can add the --dry-run flag to see what commands the agent would run without actually executing them. This is great for safety and testing.

git flash "create a hotfix branch and merge it into main" --dry-run

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

git_flash-0.1.9.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

git_flash-0.1.9-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file git_flash-0.1.9.tar.gz.

File metadata

  • Download URL: git_flash-0.1.9.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for git_flash-0.1.9.tar.gz
Algorithm Hash digest
SHA256 48c966b5e1b35da41ae29aa59c0bfea77eda0713ba6e0bbf21accd88fdf446ac
MD5 e04c7dec0bc512f00cbd7597e2bc1699
BLAKE2b-256 e7efcc05f17d5363ee69a9041ad4bffaa9a75dbe7331577179cbca80962a15de

See more details on using hashes here.

File details

Details for the file git_flash-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: git_flash-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for git_flash-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 36cdb5b9d488841b4833350f0cb9067acffacbc42b9e2c832e60a54ebfe0a9ac
MD5 4f026c3270c2db9bc8f3466d0c2321b0
BLAKE2b-256 9784f2d4850c495fa5fec70c812a24a0b07eb102e27759077439474ffa281aee

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