|
1 | | -# 🧠 Git Genius |
| 1 | +# Git Genius (gitcli) |
2 | 2 |
|
3 | | -**Git without the "Grit."** Git Genius is a beginner-friendly, interactive CLI tool that helps you manage your repositories **without memorizing commands.** |
| 3 | +Beginner-friendly interactive Git assistant for daily workflows, setup, and recovery. |
4 | 4 |
|
5 | 5 | [](https://opensource.org/licenses/MIT) |
6 | 6 | [](http://makeapullrequest.com) |
7 | 7 |
|
8 | | ---- |
| 8 | +## What It Solves |
9 | 9 |
|
10 | | -## 🚀 Why Git Genius? |
| 10 | +- Removes command memorization with guided terminal menus |
| 11 | +- Handles common Git mistakes with safer defaults and confirmations |
| 12 | +- Helps first-time setup for repo, branch, remote, and GitHub token |
| 13 | +- Includes health diagnostics via built-in Doctor checks |
11 | 14 |
|
12 | | -Git is powerful, but the command-line workflow can be a maze of cryptic flags and accidental "detached HEAD" nightmares. Git Genius acts as your **intelligent navigator**, providing a menu-driven interface that handles the heavy lifting while you focus on your code. |
| 15 | +## Features |
13 | 16 |
|
14 | | -* **Safe for Beginners:** Built-in guardrails and explicit confirmations. |
15 | | -* **Smart Workflows:** Automated stashing and recovery during pulls. |
16 | | -* **Built-in Doctor:** One-click health checks for your local environment. |
| 17 | +- **Daily Git Operations:** push, pull, smart pull, fetch, status |
| 18 | +- **Branch and Remote Management:** switch branch and remote safely |
| 19 | +- **Recovery Tools:** stash save/list/pop and undo last commit (keep changes) |
| 20 | +- **Guided Setup:** configure work dir, repo, branch, remote, identity, token |
| 21 | +- **GitHub Linking:** create or link remote repository |
| 22 | +- **Doctor:** validates git install, project state, token, remote, repo status |
17 | 23 |
|
18 | | ---- |
| 24 | +## Installation |
19 | 25 |
|
20 | | -## 🛠 Installation |
| 26 | +### Quick install (recommended) |
21 | 27 |
|
22 | | -Get up and running in seconds. This one-liner ensures a fresh installation by clearing previous versions. |
| 28 | +```bash |
| 29 | +curl -fsSL https://raw.githubusercontent.com/Smthbig/gitcli/main/install.sh | bash |
| 30 | +``` |
| 31 | + |
| 32 | +Then run: |
| 33 | + |
| 34 | +```bash |
| 35 | +git-genius |
| 36 | +``` |
| 37 | + |
| 38 | +### Fresh reinstall |
23 | 39 |
|
24 | 40 | ```bash |
25 | | -# Uninstall old version & Install fresh |
26 | 41 | curl -fsSL https://raw.githubusercontent.com/Smthbig/gitcli/main/uninstall.sh | bash |
27 | 42 | curl -fsSL https://raw.githubusercontent.com/Smthbig/gitcli/main/install.sh | bash |
| 43 | +``` |
28 | 44 |
|
29 | | -# Launch the tool |
30 | | -git-genius |
| 45 | +### Update to latest version |
| 46 | + |
| 47 | +The installer is update-aware and exits when already up to date. |
| 48 | + |
| 49 | +```bash |
| 50 | +curl -fsSL https://raw.githubusercontent.com/Smthbig/gitcli/main/install.sh | bash |
| 51 | +``` |
| 52 | + |
| 53 | +### Uninstall |
| 54 | + |
| 55 | +```bash |
| 56 | +curl -fsSL https://raw.githubusercontent.com/Smthbig/gitcli/main/uninstall.sh | bash |
31 | 57 | ``` |
32 | 58 |
|
33 | | ---- |
| 59 | +## Commands |
34 | 60 |
|
35 | | -## ✨ Core Features |
| 61 | +- Primary command: `git-genius` |
| 62 | +- Project/repo name: `gitcli` (this repository) |
36 | 63 |
|
37 | | -### 📂 Project & Repo Management |
38 | | -* **Smart Init:** Initialize Git if a repository doesn't exist. |
39 | | -* **Multi-Project Support:** Switch between project directories easily. |
40 | | -* **Safety First:** Destructive actions always require a confirmation. |
| 64 | +If you prefer `gitcli` as command, add an alias: |
41 | 65 |
|
42 | | -### 🔄 Daily Operations (Simplified) |
43 | | -* **Push/Pull:** Handle remotes with clear, guided prompts. |
44 | | -* **Smart Pull:** Automatically stash -> pull -> pop to prevent merge conflicts on uncommitted work. |
45 | | -* **Branch/Remote Switching:** No more typing long branch names; just select from a list. |
| 66 | +```bash |
| 67 | +echo "alias gitcli='git-genius'" >> ~/.zshrc |
| 68 | +source ~/.zshrc |
| 69 | +``` |
46 | 70 |
|
47 | | -### 🩺 Git Doctor (Health Check) |
48 | | -The Doctor diagnostic tool checks: |
49 | | -- [x] Git installation & Internet connectivity. |
50 | | -- [x] Valid user.name and user.email configuration. |
51 | | -- [x] GitHub Token validation & API status. |
52 | | -- [x] Repository integrity and error log detection. |
| 71 | +## In-App "Update" Actions |
53 | 72 |
|
54 | | -### ⏪ Recovery Features |
55 | | -* **Stash Manager:** Visually save, list, and restore stashes. |
56 | | -* **Undo Last Commit:** Safely revert your last commit while **keeping your changes** in the workspace. |
| 73 | +Git Genius has two update paths inside the app: |
57 | 74 |
|
58 | | ---- |
| 75 | +- **Tools -> Setup / Reconfigure** |
| 76 | + - Re-runs complete setup and updates branch/remote/token/workdir settings |
| 77 | +- **Tools -> Create / Link GitHub Repository** |
| 78 | + - Creates or relinks GitHub repository and updates remote URL |
59 | 79 |
|
60 | | -## 🖥 Interface Preview |
| 80 | +## Interface Map |
61 | 81 |
|
62 | | -Git Genius transforms your terminal into a guided command center: |
| 82 | +```text |
| 83 | +Main Menu |
| 84 | +1) Daily Git Operations |
| 85 | +2) Branch / Remote |
| 86 | +3) Stash & Undo |
| 87 | +4) Tools |
| 88 | +5) Help / About |
| 89 | +6) Exit |
| 90 | +``` |
| 91 | + |
| 92 | +```text |
| 93 | +Daily Git Operations |
| 94 | +1) Push changes (commit + push) |
| 95 | +2) Pull changes |
| 96 | +3) Smart Pull (auto-stash + pull) |
| 97 | +4) Fetch all remotes |
| 98 | +5) Git status |
| 99 | +6) Back |
| 100 | +``` |
63 | 101 |
|
64 | 102 | ```text |
65 | | -Main Menu: |
66 | | - [1] 📋 Status & Changes |
67 | | - [2] 🚀 Push to Remote |
68 | | - [3] 📥 Smart Pull (Auto-stash) |
69 | | - [4] 🌿 Branch Manager |
70 | | - [5] 🩺 Run Git Doctor (Health Check) |
71 | | - [6] ⚙️ Setup/Configuration |
72 | | - [Q] Exit |
| 103 | +Tools |
| 104 | +1) Setup / Reconfigure |
| 105 | +2) Create / Link GitHub Repository |
| 106 | +3) Change Project Directory |
| 107 | +4) Doctor (health check) |
| 108 | +5) Back |
73 | 109 | ``` |
74 | 110 |
|
75 | | ---- |
| 111 | +## Build From Source |
| 112 | + |
| 113 | +Requirements: |
| 114 | + |
| 115 | +- Go 1.21+ |
| 116 | +- Git installed |
| 117 | + |
| 118 | +Build: |
| 119 | + |
| 120 | +```bash |
| 121 | +go fmt ./... |
| 122 | +go build -o git-genius ./cmd/genius |
| 123 | +./git-genius |
| 124 | +``` |
| 125 | + |
| 126 | +## Project Design (Codebase Overview) |
| 127 | + |
| 128 | +Your project is modular and cleanly separated by responsibility: |
| 129 | + |
| 130 | +- `cmd/genius/main.go` |
| 131 | + - Entry point, runtime safety env setup, app bootstrap |
| 132 | +- `internal/menu` |
| 133 | + - Top-level interactive navigation and section routing |
| 134 | +- `internal/setup` |
| 135 | + - First-time setup, reconfiguration, directory changes, GitHub repo linking |
| 136 | +- `internal/gitops` |
| 137 | + - Daily operations: push/pull/fetch/smart pull/branch/remote/stash/undo |
| 138 | +- `internal/doctor` |
| 139 | + - System and repository diagnostics |
| 140 | +- `internal/system` |
| 141 | + - Git command execution, environment checks, runtime helpers |
| 142 | +- `internal/github` |
| 143 | + - Token persistence and GitHub API interactions |
| 144 | +- `internal/config` |
| 145 | + - `.git/.genius/config.json` load/save/default behavior |
| 146 | +- `internal/ui` |
| 147 | + - Terminal prompts, confirmations, rendering, help strings |
76 | 148 |
|
77 | | -## 🗺 Roadmap (Future-Ready) |
| 149 | +Design strengths: |
78 | 150 |
|
79 | | -Git Genius is built with a modular architecture, ready for these upcoming features: |
80 | | -- [ ] History Viewer: A scrollable log of your recent commits. |
81 | | -- [ ] Diff Visualizer: See exactly what changed line-by-line. |
82 | | -- [ ] GitHub API Integration: Create repositories directly from the CLI. |
83 | | -- [ ] CI/CD Helper: Quick-start templates for GitHub Actions. |
| 151 | +- Clear separation between UI flow and Git/system logic |
| 152 | +- Safe defaults for first-run and restricted environments |
| 153 | +- Config-driven operations across multiple working directories |
| 154 | +- Good extensibility for future sections/features |
84 | 155 |
|
85 | | ---- |
| 156 | +## Roadmap Ideas |
86 | 157 |
|
87 | | -## ⚖️ Disclaimer & License |
| 158 | +- Commit history viewer and better log UX |
| 159 | +- Rich diff summaries for staged/unstaged changes |
| 160 | +- Non-interactive flags for scripting/automation mode |
| 161 | +- Optional shell autocompletion for command shortcuts |
88 | 162 |
|
89 | | -**Use Responsibly.** Git Genius is a helper tool, not a replacement for Git knowledge. It wraps Git commands to make them approachable, but you are still the captain of your code. Always review actions before confirming. |
| 163 | +## License |
90 | 164 |
|
91 | | -Distributed under the **MIT License**. |
| 165 | +MIT License. |
92 | 166 |
|
93 | | ---- |
| 167 | +## Note |
94 | 168 |
|
95 | | -### 💡 Final Note |
96 | | -If you understand Git better after using this tool, **it has done its job.** |
| 169 | +Git Genius is a helper layer on top of Git. It improves flow and safety, but understanding core Git concepts is still important. |
0 commit comments