@opablodev/git
v1.0.8
Published
Interactive Git CLI extension for branch management, repository setup, and Pull Requests.
Downloads
28
Readme
Git Workflow
Interactive Git CLI extension for branch management, repository setup, and Pull Requests.
Features
- list – List all branches and select one to checkout.
- new – Create a new branch and switch to it.
- up – Initialize a Git repository, optionally create or connect to a remote, add all files, commit, and push.
- pr – Create a Pull Request from the current branch to a selected base branch on GitHub (requires
ghCLI).
Installation
Global (recommended)
Install the CLI globally so you can use it anywhere:
npm install -g @opablodev/gitTemporary via npx
You can also run it without installing globally:
npx @gitUsage
Once installed globally or via npx, use the CLI commands like this:
@git list– List all branches and select one to checkout@git new– Create a new branch and switch to it@git up– Initialize repository, add files, commit, and push@git pr– Create a Pull Request from current branch to a selected base branch@git– Opens interactive menu if no subcommand is provided
up Command Details
The up command will:
- Initialize a Git repository if none exists (
git init). - Create a
.gitignorefile if it doesn’t exist (Node.js default). - Check if a remote repository exists:
- If yes, user provides the remote URL.
- If no, optionally create a GitHub repository (requires GitHub CLI
gh) and link as remote.
- Add all files (
git add .). - Prompt for a commit type (
feat,fix,docs, etc.) and a commit message, unless it's the initial commit. - Commit and push to
main(or fallback tomaster).
pr Command Details
The pr command will:
- Detect the current branch as the source (
head) branch. - List all other branches to select as the target (
base) branch. - Prompt for a Pull Request title and description.
- Ensure the branch is pushed to the remote (if not, push automatically).
- Create a Pull Request on GitHub using the GitHub CLI (
gh pr create).
Requirements
- Node.js 14+
- Git
- GitHub CLI
gh(required for creating remote repositories and Pull Requests)
License
MIT License
