An opinionated Bash CLI for streamlined Git and GitHub workflows.
github-cli is a lightweight developer utility built for fast, repeatable repository operations. It wraps a focused set of Git and GitHub CLI tasks behind a small command surface: inspect a repository, create a GitHub repo from the current directory, clone a repo into a push-ready state, stage and push all changes, or intentionally reset a branch history when needed.
The project is intentionally simple in form and practical in use: one readable shell script, minimal setup, and behavior designed around everyday developer workflows.
- Single-file Bash implementation with no framework overhead
- Clean command interface for common Git and GitHub operations
- Native
ghintegration for repository creation and cloning - Automatic
.gitignoresynchronization for previously tracked ignored files - Interactive confirmation before destructive or remote-changing actions
- Push-ready clone flow that attempts to align local and remote branch state
- Small enough to audit quickly, useful enough to keep in a daily toolbelt
Many Git actions are individually simple but repetitive in practice. github-cli reduces that friction by providing a compact, opinionated wrapper around the commands developers run most often when starting, cloning, updating, and occasionally resetting repositories.
The goal is not to replace Git. The goal is to make a small set of high-frequency workflows faster, clearer, and safer.
bashgitghforcreateandclone- A valid
gh auth loginsession for repository creation
Clone the repository and make the script executable:
chmod +x github.sh
./github.sh helpFor a cleaner command name, symlink it into your PATH:
ln -sf "$(pwd)/github.sh" ~/.local/bin/github
github helpIf you do not create a symlink, use ./github.sh in the examples below.
| Command | Purpose | Notes |
|---|---|---|
list |
Show repository metadata and working tree status | Requires a Git repository |
create |
Create a GitHub repository from the current directory | Ensures a main branch and an initial commit |
clone |
Clone a GitHub repository using gh |
Attempts to set the clone up for immediate push usage |
push |
Stage, commit, and push all changes | Prompts for confirmation before pushing |
wipe |
Replace a branch history with a new root commit | Force-pushes after confirmation |
help |
Show CLI usage | Available globally and per command path |
Inspect the current repository:
github listCreate a new private repository from the current directory:
github create "A lightweight shell utility for GitHub workflows"Clone a repository and prepare it for follow-up pushes:
github clone owner/repoStage everything, create a commit, and push:
github push -m "feat: improve repository bootstrap flow"Reset a branch to a fresh single-commit history:
github wipe -m "reset repository history"Displays the current repository context and working tree state.
github listWhat it shows:
- Repository name
- Repository path
- Current branch
originremote URLgit status --shortoutput
Creates a GitHub repository from the current directory.
github create "My shell utility"
github create --public "My public project"
github create --private --description "Internal tooling repository"Behavior:
- Initializes Git if the current directory is not already a repository
- Ensures the active branch is
main - Creates an initial commit if the repository has no commits yet
- Uses the directory name as the repository name
- Configures
originautomatically when creating the remote repository - Skips remote creation if
originalready exists - Does not push automatically after repository creation
Clones a repository through GitHub CLI and attempts to leave it in a push-ready state.
github clone owner/repo
github clone owner/repo local-directory
github clone owner/repo -u upstream
github clone owner/repo -- --depth=1Behavior:
- Uses
gh repo clone - Supports passing clone flags through to
git clone - Detects the default branch under
origin - Checks out a usable local branch when necessary
- Configures upstream tracking when possible
Stages all changes, creates a commit if needed, and pushes to the target branch after confirmation.
github push
github push "docs: refresh README"
github push -m "feat: add repository create flow"
github push --branch release
github push --force -m "chore: rewrite release branch"Behavior:
- Requires a Git repository and an
originremote - Refuses to run from a detached
HEAD - Applies
.gitignorerules to already tracked ignored files - Stages all changes with
git add -A - Uses
Committed By bucksh0tas the default commit message - Shows repository status and a staged diff summary before pushing
- Prompts for explicit confirmation before the remote update
- Supports pushing to the current branch or an alternate target branch
Replaces the history of a target branch with a new orphan-based root commit and force-pushes it.
github wipe
github wipe "fresh start"
github wipe --branch develop
github wipe -m "reset repository"Behavior:
- Targets
mainby default - Creates a new orphan branch as a clean history root
- Commits the current staged project state as a single commit
- Force-pushes the result to the selected remote branch
- Uses
Wiped By bucksh0tas the default commit message - Prompts before performing the destructive remote update
- Keep the tool small and readable
- Prefer explicit behavior over hidden automation
- Make destructive actions obvious
- Optimize for local developer productivity
pushandwipeare interactive by design and expect terminal confirmationcreateandclonerequire the GitHub CLI to be installed- The tool is intentionally opinionated around a
main-based workflow - The current implementation is purposefully compact and focused on shell-based developer tooling