Skip to main content

One command to stage, commit, merge, push, and open a PR — powered by AI.

Project description

Gitfold

One command to stage, commit, merge, push, and open a PR — powered by AI.

Gitfold automates your entire Git workflow with a single terminal command. It stages your files, uses AI to write a meaningful commit message based on your actual code changes, syncs with your development branch, pushes to GitHub, and creates a pull request — all in one go.


Features

  • One command — just type done and Gitfold handles the rest
  • AI-powered commit messages — understands your diff and writes proper conventional commits
  • AI-powered PR descriptions — generates a clear summary and bullet-point changelog
  • Intelligent branch detection — auto-detects your main, dev, and current branches
  • Real-time terminal output — watch every step happen live
  • Manual mode — use done --manual to confirm each step yourself
  • GitHub PR creation — opens the PR in your browser automatically
  • Cross-platform — works on macOS, Linux, and Windows

Installation

1. Clone the repo

git clone https://github.com/yourusername/gitfold.git
cd gitfold

2. Install dependencies

pip install -r requirements.txt

3. Install Gitfold as a global command

pip install -e .

After this, you can type done from any Git repository on your machine.


Setup

Create a .env file in your project root with your API keys:

OPENAI_API_KEY=your_openai_key_here
GITHUB_TOKEN=your_github_token_here

Getting your OpenAI API key: platform.openai.com/api-keys

Getting your GitHub token:

  1. Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Generate a new token with repo and read:user scopes
  3. Copy and paste it into your .env file

Never commit your .env file. Add it to .gitignore.


Usage

Automatic mode (recommended)

done

Gitfold will:

  1. Detect your repo and branches
  2. Stage all changed files
  3. Generate an AI commit message — you can accept, edit, or regenerate it
  4. Commit your changes
  5. Pull and merge from your dev/main branch
  6. Push to remote
  7. Generate an AI PR description and create the PR on GitHub
  8. Open the PR in your browser
  9. Print a summary of everything that happened

Manual mode

done --manual

Gitfold will ask for your confirmation before each step.


Additional flags

done --no-push       # Commit only, skip push and PR
done --no-pr         # Push but skip PR creation
done --branch main   # Override the target base branch

First run

On your first run, Gitfold will ask you a few setup questions:

⚙️  Welcome to Gitfold! Let's set up your config.

What is your default branch? (detected: 'main', press Enter to confirm):
Development branch detected as 'dev'. Use this? [y/n]:
Auto-push to remote after commit? [y/n] (default: y):
Auto-open PR in browser after push? [y/n] (default: y):
Your GitHub username (optional, press Enter to skip):

Your answers are saved to .gitfold.json in your project root. You can edit this file anytime.


Project structure

gitfold/
├── src/
│   ├── main.py            # Entry point and command flow
│   ├── git_handler.py     # All Git operations
│   ├── ai_integration.py  # LLM commit and PR generation
│   ├── config_manager.py  # Config loading and setup
│   ├── github_api.py      # GitHub API and PR creation
│   └── logger.py          # Terminal output and display
├── tests/
│   ├── test_git_handler.py
│   ├── test_ai_integration.py
│   └── test_github_api.py
├── .env                   # Your API keys (never commit this)
├── .gitignore
├── requirements.txt
├── setup.py
└── README.md

Contributing

Gitfold is open source and contributions are welcome! Feel free to open issues, suggest features, or submit pull requests.


License

MIT License. See LICENSE for details.

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

gitfold-0.1.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

gitfold-0.1.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file gitfold-0.1.0.tar.gz.

File metadata

  • Download URL: gitfold-0.1.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for gitfold-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a86c2bb803bcc64685e452276699ed3f38059cfc13fb07af5986a320f199be2
MD5 8cb6638ed30f919633db069eb9e00751
BLAKE2b-256 2251c29312242eba36a0aebf6f472161d3ec6265a0ea51122a70bb6167450ed5

See more details on using hashes here.

File details

Details for the file gitfold-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gitfold-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for gitfold-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbd866b0bb11bd9dd5621e6cfddd48851e8b56ce21adea4e9ea23cb53cc92488
MD5 8829dac11cca4ef5193d880e1925efac
BLAKE2b-256 fad5b5ba77144a689c442e916e5a2337bc0332a483c069c6b24348e71f378fe1

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