Skip to main content

Automatic Commit Pusher (acp)- CLI utility for automating pull request creation

Project description

acp - Automatic Commit Pusher

Release Python Tests Code Lint Code Format Python Version License

Turn your staged changes into a GitHub pull request with a single command.
No more branch naming, no browser tabs, no clicking through forms.

git add .
acp pr "fix: typo in readme"
PR created: https://github.com/vbvictor/acp/pull/12

That's it. PR created, you're back on your original branch.

What it does

When you run acp pr <commit message>, acp will:

  1. Validate you have staged changes
  2. Create a temporary branch acp/{your-github-username}/{random-16-digits}
  3. Commit your staged changes with your message
  4. Push the branch to origin repo
  5. Create a pull request to upstream if present of origin otherwise.
  6. Switch you back to your original branch
  7. Print the PR URL

The tool can also merge freshly created PR via --merge or --auto-merge options, see --help for more information.

Getting Started

Prerequisites: Python 3.9+, Git, and GitHub CLI (gh)

Authenticate GitHub CLI (if you haven't already):

gh auth login

Install from PyPI via pip or pipx:

pip install acp-gh

Or install the latest release directly from GitHub via pip or pipx:

pip install https://github.com/vbvictor/acp/releases/latest/download/acp_gh-0.7.3-py3-none-any.whl

Usage

Create basic PR:

git add .
acp pr "fix: correct calculation bug"

Create PR body message and run acp with verbose output:

acp pr "fix: resolve issue" -b "Closes #123" -v

Skip automatic PR creation and have a GitHub link to crate PR manually:

acp pr "feat: new feature" --interactive

Merge PR immediately after creation or use GitHub auto-merge feature:

# Squash and merge immediately (default merge method)
acp pr "fix: urgent hotfix" --merge

# Use different merge methods: merge, squash, or rebase
acp pr "fix: hotfix" --merge --merge-method merge
acp pr "feat: feature" --auto-merge --merge-method rebase

When merging branch immediately, temporary local branch and
remote tracking branch will also be deleted to keep workspace clean.

Contributing

Contributions welcome! Please open an issue if you have an idea or submit a pull request.

Developer environment

To create a virtual environment, install dev dependencies, and run tests:

make activate # Create venv and install dev dependencies
make test     # Run tests
make lint     # Run ruff/black

Submit your PR

Use acp itself to create your PR:

git add .
acp pr "feat: your awesome feature"

License

GPLv2

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

acp_gh-0.7.3.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

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

acp_gh-0.7.3-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file acp_gh-0.7.3.tar.gz.

File metadata

  • Download URL: acp_gh-0.7.3.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for acp_gh-0.7.3.tar.gz
Algorithm Hash digest
SHA256 ff63747bd67b10548c3b1ca8ed34d230cef2216bebca05a7eb08cb9b0bbb05c8
MD5 526d4b2650aa3ef64a7b66a7069af0d2
BLAKE2b-256 4e6ee67a3df98a3362bfb06e880cd0011e3c661e6763eb337c6d5befb5a494be

See more details on using hashes here.

File details

Details for the file acp_gh-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: acp_gh-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for acp_gh-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4865ff4934ad97b8fe101a8c7b158b12803d88d16fcf509b74b8dc8f40267c12
MD5 c844a0b925344732f0572da7b87a8005
BLAKE2b-256 cbdf450eab7039a6be710a02cead27493360e35433adcd9265dbaff10d1e59c8

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