|
| 1 | +/** |
| 2 | + * 📜 commandsList.ts |
| 3 | + * ------------------------------------------------------------- |
| 4 | + * Central list of all plain-English Git actions, |
| 5 | + * their Git commands, and mapped handlers. |
| 6 | + * ------------------------------------------------------------- |
| 7 | + */ |
| 8 | + |
| 9 | +export type PlainGitCommand = { |
| 10 | + category: string; |
| 11 | + name: string; |
| 12 | + command: string; |
| 13 | + description: string; |
| 14 | + handler: string; // maps to specific Manager method |
| 15 | +}; |
| 16 | + |
| 17 | +export const COMMANDS_LIST: PlainGitCommand[] = [ |
| 18 | + // 🏁 Repository Operations |
| 19 | + { |
| 20 | + category: "Repository", |
| 21 | + name: "📦 Initialize a new repository", |
| 22 | + command: "git init", |
| 23 | + description: "Create a new local Git repository in the current folder.", |
| 24 | + handler: "RepositoryManager.initRepo", |
| 25 | + }, |
| 26 | + { |
| 27 | + category: "Repository", |
| 28 | + name: "🌐 Clone a repository from URL", |
| 29 | + command: "git clone <url>", |
| 30 | + description: "Clone an existing repository from a remote Git URL.", |
| 31 | + handler: "RepositoryManager.cloneRepo", |
| 32 | + }, |
| 33 | + { |
| 34 | + category: "Repository", |
| 35 | + name: "📂 Check repository status", |
| 36 | + command: "git status", |
| 37 | + description: "Display the working tree status.", |
| 38 | + handler: "RepositoryManager.status", |
| 39 | + }, |
| 40 | + { |
| 41 | + category: "Repository", |
| 42 | + name: "⚙️ Show Git configuration", |
| 43 | + command: "git config --list", |
| 44 | + description: "Show global and local Git config values.", |
| 45 | + handler: "RepositoryManager.showConfig", |
| 46 | + }, |
| 47 | + |
| 48 | + // 🌿 Branch Operations |
| 49 | + { |
| 50 | + category: "Branch", |
| 51 | + name: "🌱 Create a new branch", |
| 52 | + command: "git branch <branch-name>", |
| 53 | + description: "Create a new branch locally.", |
| 54 | + handler: "BranchManager.createBranch", |
| 55 | + }, |
| 56 | + { |
| 57 | + category: "Branch", |
| 58 | + name: "🔄 Switch to another branch", |
| 59 | + command: "git checkout <branch-name>", |
| 60 | + description: "Switch to an existing branch.", |
| 61 | + handler: "BranchManager.switchBranch", |
| 62 | + }, |
| 63 | + { |
| 64 | + category: "Branch", |
| 65 | + name: "🗑️ Delete a branch", |
| 66 | + command: "git branch -d <branch-name>", |
| 67 | + description: "Delete a local branch safely.", |
| 68 | + handler: "BranchManager.deleteBranch", |
| 69 | + }, |
| 70 | + |
| 71 | + // 📝 Commit Operations |
| 72 | + { |
| 73 | + category: "Commit", |
| 74 | + name: "🧩 Stage all changes", |
| 75 | + command: "git add .", |
| 76 | + description: "Add all modified files to staging.", |
| 77 | + handler: "CommitManager.stageAll", |
| 78 | + }, |
| 79 | + { |
| 80 | + category: "Commit", |
| 81 | + name: "📝 Commit all staged changes", |
| 82 | + command: "git commit -m '<message>'", |
| 83 | + description: "Commit staged changes with a message.", |
| 84 | + handler: "CommitManager.commitChanges", |
| 85 | + }, |
| 86 | + { |
| 87 | + category: "Commit", |
| 88 | + name: "📜 Show commit history", |
| 89 | + command: "git log --oneline", |
| 90 | + description: "Show a compact list of previous commits.", |
| 91 | + handler: "CommitManager.showLog", |
| 92 | + }, |
| 93 | + |
| 94 | + // 🚀 Remote Operations |
| 95 | + { |
| 96 | + category: "Remote", |
| 97 | + name: "🚀 Push changes to remote", |
| 98 | + command: "git push", |
| 99 | + description: "Push local commits to the default remote branch.", |
| 100 | + handler: "RemoteManager.pushChanges", |
| 101 | + }, |
| 102 | + { |
| 103 | + category: "Remote", |
| 104 | + name: "⬇️ Pull latest changes", |
| 105 | + command: "git pull", |
| 106 | + description: "Pull changes from the remote branch into your local branch.", |
| 107 | + handler: "RemoteManager.pullChanges", |
| 108 | + }, |
| 109 | + { |
| 110 | + category: "Remote", |
| 111 | + name: "🔍 Fetch updates from remote", |
| 112 | + command: "git fetch", |
| 113 | + description: "Fetch remote changes without merging them.", |
| 114 | + handler: "RemoteManager.fetchUpdates", |
| 115 | + }, |
| 116 | + |
| 117 | + // 🕓 History & Diff |
| 118 | + { |
| 119 | + category: "History", |
| 120 | + name: "🕓 View commit history (graph)", |
| 121 | + command: "git log --oneline --graph --decorate", |
| 122 | + description: "Show commits with visual branch structure.", |
| 123 | + handler: "HistoryManager.showHistoryGraph", |
| 124 | + }, |
| 125 | + { |
| 126 | + category: "History", |
| 127 | + name: "🔍 Compare changes (diff)", |
| 128 | + command: "git diff", |
| 129 | + description: "Compare working directory with last commit.", |
| 130 | + handler: "HistoryManager.showDiff", |
| 131 | + }, |
| 132 | + |
| 133 | + // 🧹 Reset & Cleanup |
| 134 | + { |
| 135 | + category: "Reset", |
| 136 | + name: "↩️ Undo last commit (soft)", |
| 137 | + command: "git reset --soft HEAD~1", |
| 138 | + description: "Undo last commit but keep changes staged.", |
| 139 | + handler: "ResetManager.undoLastCommit", |
| 140 | + }, |
| 141 | + { |
| 142 | + category: "Reset", |
| 143 | + name: "🧹 Clean untracked files", |
| 144 | + command: "git clean -fd", |
| 145 | + description: "Remove all untracked files and folders.", |
| 146 | + handler: "ResetManager.cleanUntracked", |
| 147 | + }, |
| 148 | +]; |
0 commit comments