Skip to content
/ acp Public

Automatic Commit Pusher (acp) is a CLI utility automating creation of pull requests based on commit

License

Notifications You must be signed in to change notification settings

vbvictor/acp

Repository files navigation

acp - Automatic Commit Pusher

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)

Install from source:

git clone https://github.com/vbvictor/acp.git
cd acp
pip install .
# or install into venv
pipx install .

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

gh auth login

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.
When merging branch immediately, temporary local branch and
remote tracking branch will also be deleted to keep workspace clean.

# 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

Contributing

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

Developer environment

Create a virtual environment, install dev dependencies, and run tests:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e ".[dev]"
pytest test_acp.py -v

Submit your PR

Use acp itself to create your PR:

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

License

GPLv2

About

Automatic Commit Pusher (acp) is a CLI utility automating creation of pull requests based on commit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages