Interactive command line helper for Git workflows
Project description
GitHub Operations Script
Christopher Hirschauer
Builder @ the bleeding edge of MEV, automation, and high-speed arbitrage.
August 21, 2025
An interactive script for managing Git operations, GitHub Pages deployment, and SSH key management. This script helps automate common Git tasks and integrates with GitHub Pages and GitHub Codespaces. It also provides utilities for generating and managing SSH keys.
gitHelper control centre (CLI)
Prefer a guided workflow without leaving the shell? Launch the new gitHelper control centre for a colourful, modern command-line experience focused on day-to-day automation tasks:
python -m git_helper
The CLI surfaces the most common actions behind friendly menus and emoji-powered feedback:
- Repository directory management – review the active workspace, switch to a different folder, or create it on the fly with automatic validation and recovery when paths are invalid.
- Repository overview – quickly list all Git repositories that live under the configured workspace.
- Git repository workflow – select or initialise projects, stage files, craft commits, and push/pull with upstream tracking prompts.
- SSH key concierge – generate fresh Ed25519 keys, import existing keys into
~/.ssh, and optionally register them with the localssh-agent, all with detailed success and error messaging.
The interface is implemented as a first-class Python package (git_helper) making it easy to install with pip, script against, or extend. Rich inline documentation and modular components keep future maintenance approachable.
Pro tip: type
?orhelpon any screen to open a contextual help panel summarising available shortcuts and actions.
Neon Git Cockpit (Terminal UI)
Prefer a neon-lit command center instead of memorising dozens of git commands? Launch the curses-powered neon git cockpit and cruise through commits, branches, GitHub issues, and dangerous operations without leaving the terminal.
┌─────────────────────────────── NEON GIT COCKPIT ───────────────────────────────┐
│ HEAD: main | Theme: github_dark | View: diff │
├─────────────────────────┬──────────────────────────────────────────────────────┤
│ Timeline │ Diff / GitHub / Danger Zone Panel │
│ ➤ 9f31b1 2025-08-20 ch │ commit 9f31b1 (Chris) │
│ 41a62a 2025-08-19 fea │ + Add neon cockpit + GitHub sync panel │
│ 3d9c72 2025-08-18 fix │ - Remove brittle shell prompts │
├─────────────────────────┴──────────────────────────────────────────────────────┤
│ Status: press ? for hotkeys Undo:1 Redo:0 GitHub: issues ▷ pulls │
└────────────────────────────────────────────────────────────────────────────────┘
Cockpit superpowers
- Repo browser – scroll commits with ↑/↓, press
Enterfor rich diffs,Spaceto pop into a temporary branch. - Branch playground – jump to the branch graph, fast-forward with
F, or merge after previewing diff stats. - GitHub sync – hit
Gfor live lists of issues, pull requests, and Actions runs (powered by theghCLI). Type#42in search to grab a specific PR instantly. - Danger zone – slam
Dto reveal rollback, skull-certified force push, and stashing prompts (with built-in safety nets). - Interactive rebase –
Rlaunches a GUI-like checklist. Usep/s/f/e/r/xto mark actions before executing. - Plug-ins – press
Pfor extensibility. A sample “ML-ish commit oracle” plugin analyses your diff and proposes cheeky messages. - Themes & vibes – configuration lives at
~/.config/neon_git/config.jsonwith presets for GitHub Dark, Matrix Green, and Neon Cyberpunk.
Quickstart
python3 neogit.py
python -m git_helper
Key hotkeys are always a ? away:
| Key | Action |
|---|---|
↑/↓ |
Navigate commits |
Space |
Checkout selected commit in a temporary branch |
Tab |
Create a new branch from the highlighted commit |
F |
Fast-forward to the tracked main branch |
G |
Open GitHub panel (requires gh) |
R |
Launch interactive rebase planner |
P |
Browse and run plug-ins |
D |
Toggle the danger zone overlay |
/ |
Search commits or jump to #<issue>/#<PR> |
U / Shift+U |
Undo / redo git state snapshots |
Q |
Quit the cockpit |
GitHub integration: the cockpit auto-detects your
originremote. Make suregh auth loginhas been run and the CLI is in PATH.
Plug-in architecture
Drop Python modules inside neogit_tui/plugins/ that expose a register() function returning a Plugin. Each plug-in receives the active GitInterface instance, so you can build bots for semantic PR labels, AI commit messages, or workflow dashboards.
from neogit_tui.git import GitInterface
from neogit_tui.plugins import Plugin
def register() -> Plugin:
def run(git: GitInterface, app) -> str:
summary = git.diff_stat()
return f"Diff summary\n{summary}"
return Plugin(
name="Diff Summariser",
description="Show a quick diffstat report",
run=run,
)
Restart the cockpit and your plug-in appears instantly in the P menu.
Features
Classic Bash Helper
If you prefer the original guided prompts, the ghHelper.sh script is still included.
General Git Operations:
- Clone a Repository: Clone any GitHub repository to your local machine.
- Create & Checkout Branches: Create a new branch or switch between existing branches.
- Add, Commit & Push Changes: Stage changes with
git add ., commit changes, and push them to the remote repository. - Force Push Changes: Force push changes to the remote repository (overwrites existing history).
- View Commit History: View the commit log in a simplified format.
- Revert to a Previous Commit: Revert the repository to a specific commit.
- Pull Latest Updates: Fetch and merge updates from the remote repository.
GitHub Pages and Codespaces:
- Deploy to GitHub Pages: Deploy changes to a
gh-pagesbranch or main branch, for GitHub Pages hosting. - Open a GitHub Codespace: Create and open a GitHub Codespace for your repository.
Repository Directory Management:
- Change workspace location: Point gitHelper at any directory, create it automatically, and persist the choice across sessions.
- Validate paths: Friendly error handling highlights invalid or inaccessible paths before they cause issues.
- Repository overview: List all detected Git repositories living inside the configured workspace.
SSH Key Management:
- Generate SSH Key: Generate a new Ed25519 SSH key pair with optional passphrase and overwrite protection.
- Import SSH Key: Copy existing keys into
~/.ssh, preserve the matching public key, and optionally register them withssh-agent. - Add SSH Key to Agent: Add any key to the SSH agent for seamless GitHub authentication with detailed success/error feedback.
Prerequisites
Before using this script, ensure that the following tools are installed on your system:
-
Pluma (for editing
README.md): Install with:sudo apt install pluma
-
GitHub CLI (
gh) (for GitHub Codespaces integration): Install with:sudo apt install gh
Installation
-
Download or clone this repository:
git clone https://github.com/username/repo.git
-
Make the script executable:
chmod +x github_operations.sh
-
Run the script:
./github_operations.sh
Usage
Main Menu Options:
- Create a new branch: Create a new Git branch for feature development or bug fixes.
- Checkout an existing branch: Switch between branches within the repository.
- Add changes: Stage changes (
git add .). - Commit changes: Commit your staged changes with a commit message.
- Push changes: Push your local commits to the remote repository.
- Force push: Force push your changes to overwrite the remote history.
- Show all commits: View the commit history.
- Revert to a previous commit: Roll back the repository to a specific commit.
- Pull updates: Fetch and merge the latest changes from the remote repository.
- Update
README.md: OpenREADME.mdfor editing with Pluma. Commit and push changes to GitHub.
GitHub Pages and Codespaces:
- Deploy to GitHub Pages: Deploy your site to GitHub Pages using the
gh-pagesbranch. - Open GitHub Codespace: Create and open a GitHub Codespace for cloud-based development.
SSH Key Operations:
- Generate a new SSH key: Generate a new SSH key pair for GitHub authentication.
- Add SSH key to the agent: Add your SSH private key to the SSH agent for use with GitHub.
- Add SSH key to GitHub: Display your public SSH key and guide you to add it to GitHub.
Example Workflow
-
Clone a repository:
Enter the GitHub repository URL (e.g., https://github.com/username/repo.git): https://github.com/username/repo.git
-
Create a new branch:
Enter the new branch name: feature-xyz
-
Add and commit changes:
Do you want to add all changes? (y/n): y Enter commit message: Added new feature XYZ
-
Push changes to GitHub:
Do you want to push changes to the repository? (y/n): y
-
Deploy to GitHub Pages:
Deploying to GitHub Pages...
-
Generate an SSH Key:
Enter your email address (for SSH key): youremail@example.com
-
Add SSH Key to GitHub:
Copy the SSH key and add it to GitHub under 'Settings' -> 'SSH and GPG keys'.
Script Overview
The script is divided into different operation categories to help manage GitHub repositories, GitHub Pages, and SSH key management. It provides a menu-driven interface where users can perform the following tasks:
- Manage Git branches, commits, and pushes.
- Deploy content to GitHub Pages for static site hosting.
- Create and manage SSH keys for secure GitHub authentication.
- Launch a GitHub Codespace for cloud development.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git_r_done-0.1.0.tar.gz.
File metadata
- Download URL: git_r_done-0.1.0.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23c0a327536345fa38587048fc7086378b55f28223df34bf906e225b5cb97b1c
|
|
| MD5 |
6c9bc0b900399d5b6c2e8341fe1733f4
|
|
| BLAKE2b-256 |
1b2bf67670b5ee09ac49a11e5e3e0242774af15e4dca16b172729309118f9fb0
|
File details
Details for the file git_r_done-0.1.0-py3-none-any.whl.
File metadata
- Download URL: git_r_done-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a1247cbc74d70cd2644a63a4f4fb591cf698fb78bf31b9e3e00660134ffb0f1
|
|
| MD5 |
f2f48ab6ac7b2f4be003717f2f42537e
|
|
| BLAKE2b-256 |
4df2f228cafb856cbea15326fdec1a6dfec9c1aec0d5987cbd2e5a498ed1f49c
|