@andrebuzeli/git-mcp 10.0.9 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +34 -428
  2. package/bin/git-mcp.js +21 -0
  3. package/docs/TOOLS.md +110 -0
  4. package/mcp.json.template +12 -0
  5. package/package.json +9 -76
  6. package/src/local/git.js +14 -0
  7. package/src/providers/gitea.js +13 -0
  8. package/src/providers/github.js +13 -0
  9. package/src/server.js +63 -0
  10. package/src/tools/git-actions.js +19 -0
  11. package/src/tools/git-activity.js +28 -0
  12. package/src/tools/git-admin.js +20 -0
  13. package/src/tools/git-checks.js +14 -0
  14. package/src/tools/git-commits.js +34 -0
  15. package/src/tools/git-contents.js +30 -0
  16. package/src/tools/git-deployments.js +21 -0
  17. package/src/tools/git-gists.js +15 -0
  18. package/src/tools/git-gitdata.js +19 -0
  19. package/src/tools/git-issues-prs.js +44 -0
  20. package/src/tools/git-issues.js +12 -0
  21. package/src/tools/git-local.js +66 -0
  22. package/src/tools/git-meta.js +19 -0
  23. package/src/tools/git-misc.js +21 -0
  24. package/src/tools/git-orgs.js +26 -0
  25. package/src/tools/git-packages.js +12 -0
  26. package/src/tools/git-raw.js +14 -0
  27. package/src/tools/git-releases.js +17 -0
  28. package/src/tools/git-remote.js +29 -0
  29. package/src/tools/git-repos.js +60 -0
  30. package/src/tools/git-search.js +18 -0
  31. package/src/tools/git-sync.js +40 -0
  32. package/src/tools/git-user.js +26 -0
  33. package/src/tools/schema.js +3 -0
  34. package/src/utils/fs.js +29 -0
  35. package/src/utils/project.js +7 -0
  36. package/tests/errors.js +26 -0
  37. package/tests/full_suite.js +98 -0
  38. package/tests/run.js +50 -0
  39. package/LICENSE +0 -21
  40. package/dist/index.d.ts +0 -2
  41. package/dist/index.js +0 -224
  42. package/dist/prompts/gitPrompts.d.ts +0 -93
  43. package/dist/prompts/gitPrompts.js +0 -177
  44. package/dist/providers/giteaProvider.d.ts +0 -3
  45. package/dist/providers/giteaProvider.js +0 -6
  46. package/dist/providers/githubProvider.d.ts +0 -2
  47. package/dist/providers/githubProvider.js +0 -4
  48. package/dist/providers/providerManager.d.ts +0 -11
  49. package/dist/providers/providerManager.js +0 -49
  50. package/dist/resources/toolsGuide.d.ts +0 -12
  51. package/dist/resources/toolsGuide.js +0 -1713
  52. package/dist/scripts/test_e2e.d.ts +0 -1
  53. package/dist/scripts/test_e2e.js +0 -199
  54. package/dist/scripts/test_exhaustive.d.ts +0 -1
  55. package/dist/scripts/test_exhaustive.js +0 -275
  56. package/dist/scripts/test_gitea_creation.d.ts +0 -1
  57. package/dist/scripts/test_gitea_creation.js +0 -116
  58. package/dist/scripts/verify_setup.d.ts +0 -1
  59. package/dist/scripts/verify_setup.js +0 -61
  60. package/dist/server.d.ts +0 -9
  61. package/dist/server.js +0 -73
  62. package/dist/tools/gitAnalytics.d.ts +0 -35
  63. package/dist/tools/gitAnalytics.js +0 -220
  64. package/dist/tools/gitArchive.d.ts +0 -119
  65. package/dist/tools/gitArchive.js +0 -150
  66. package/dist/tools/gitBackup.d.ts +0 -116
  67. package/dist/tools/gitBackup.js +0 -156
  68. package/dist/tools/gitBranches.d.ts +0 -54
  69. package/dist/tools/gitBranches.js +0 -282
  70. package/dist/tools/gitChangelog.d.ts +0 -37
  71. package/dist/tools/gitChangelog.js +0 -67
  72. package/dist/tools/gitConfig.d.ts +0 -97
  73. package/dist/tools/gitConfig.js +0 -125
  74. package/dist/tools/gitFiles.d.ts +0 -129
  75. package/dist/tools/gitFiles.js +0 -213
  76. package/dist/tools/gitFix.d.ts +0 -4
  77. package/dist/tools/gitFix.js +0 -159
  78. package/dist/tools/gitFix.tool.d.ts +0 -31
  79. package/dist/tools/gitFix.tool.js +0 -92
  80. package/dist/tools/gitHistory.d.ts +0 -41
  81. package/dist/tools/gitHistory.js +0 -349
  82. package/dist/tools/gitIgnore.d.ts +0 -214
  83. package/dist/tools/gitIgnore.js +0 -338
  84. package/dist/tools/gitIssues.d.ts +0 -80
  85. package/dist/tools/gitIssues.js +0 -363
  86. package/dist/tools/gitLog.d.ts +0 -30
  87. package/dist/tools/gitLog.js +0 -46
  88. package/dist/tools/gitMonitor.d.ts +0 -30
  89. package/dist/tools/gitMonitor.js +0 -284
  90. package/dist/tools/gitPackages.d.ts +0 -180
  91. package/dist/tools/gitPackages.js +0 -214
  92. package/dist/tools/gitPulls.d.ts +0 -66
  93. package/dist/tools/gitPulls.js +0 -347
  94. package/dist/tools/gitPush.d.ts +0 -40
  95. package/dist/tools/gitPush.js +0 -59
  96. package/dist/tools/gitRelease.d.ts +0 -49
  97. package/dist/tools/gitRelease.js +0 -359
  98. package/dist/tools/gitRemote.d.ts +0 -47
  99. package/dist/tools/gitRemote.js +0 -111
  100. package/dist/tools/gitReset.d.ts +0 -57
  101. package/dist/tools/gitReset.js +0 -79
  102. package/dist/tools/gitStash.d.ts +0 -61
  103. package/dist/tools/gitStash.js +0 -80
  104. package/dist/tools/gitSync.d.ts +0 -34
  105. package/dist/tools/gitSync.js +0 -182
  106. package/dist/tools/gitTags.d.ts +0 -45
  107. package/dist/tools/gitTags.js +0 -251
  108. package/dist/tools/gitUpdate.d.ts +0 -60
  109. package/dist/tools/gitUpdate.js +0 -474
  110. package/dist/tools/gitUpload.d.ts +0 -35
  111. package/dist/tools/gitUpload.js +0 -385
  112. package/dist/tools/gitWorkflow.d.ts +0 -117
  113. package/dist/tools/gitWorkflow.js +0 -472
  114. package/dist/types.d.ts +0 -20
  115. package/dist/types.js +0 -1
  116. package/dist/utils/agentHelpers.d.ts +0 -11
  117. package/dist/utils/agentHelpers.js +0 -41
  118. package/dist/utils/apiHelpers.d.ts +0 -29
  119. package/dist/utils/apiHelpers.js +0 -125
  120. package/dist/utils/cache.d.ts +0 -96
  121. package/dist/utils/cache.js +0 -208
  122. package/dist/utils/contextDetector.d.ts +0 -0
  123. package/dist/utils/contextDetector.js +0 -1
  124. package/dist/utils/errors.d.ts +0 -13
  125. package/dist/utils/errors.js +0 -17
  126. package/dist/utils/gitAdapter.d.ts +0 -224
  127. package/dist/utils/gitAdapter.js +0 -1162
  128. package/dist/utils/logger.d.ts +0 -45
  129. package/dist/utils/logger.js +0 -140
  130. package/dist/utils/rateLimiter.d.ts +0 -113
  131. package/dist/utils/rateLimiter.js +0 -257
  132. package/dist/utils/repoHelpers.d.ts +0 -44
  133. package/dist/utils/repoHelpers.js +0 -122
  134. package/dist/utils/safetyController.d.ts +0 -1
  135. package/dist/utils/safetyController.js +0 -12
  136. package/dist/utils/validation.d.ts +0 -115
  137. package/dist/utils/validation.js +0 -270
@@ -1,1713 +0,0 @@
1
- /**
2
- * Git-MCP Tools Guide Resource
3
- * Comprehensive documentation for all 20 Git tools available in the MCP server
4
- */
5
- export const TOOLS_GUIDE = {
6
- uri: "git-mcp://tools/guide",
7
- name: "Git-MCP Tools Complete Guide",
8
- description: "Detailed documentation and usage instructions for all 20 Git tools with 102 actions",
9
- mimeType: "text/markdown",
10
- content: `# 🛠️ Git-MCP v7.0.2 - Complete Tools Guide
11
-
12
- > **Comprehensive documentation for all 21 Git tools with 110+ actions**
13
- > **Supports:** Automatic DUAL execution on GitHub + Gitea APIs
14
- > **v7.0.2:** Central projectPath validation - ALL tools require projectPath (no exceptions)
15
-
16
- ---
17
-
18
- ## 🚨 CRITICAL: projectPath is MANDATORY for ALL TOOLS
19
-
20
- **EVERY SINGLE TOOL CALL REQUIRES projectPath AS THE FIRST PARAMETER**
21
-
22
- ### Why projectPath is Required:
23
- - ✅ It's where the .git folder is located
24
- - ✅ ALL Git commands run in this directory
25
- - ✅ Local AND remote operations use this context
26
- - ✅ It MUST be the absolute path to project ROOT
27
- - ✅ The server validates this BEFORE calling any tool
28
-
29
- ### Validation:
30
- If you call ANY tool without projectPath, you will get:
31
- \\\`\\\`\\\`json
32
- {
33
- "errorCode": "VALIDATION_ERROR",
34
- "message": "projectPath is required for all tool calls"
35
- }
36
- \\\`\\\`\\\`
37
-
38
- ---
39
-
40
- ## 🚀 v7.0.0 MAJOR UPDATE: AUTOMATIC DUAL EXECUTION
41
-
42
- **ALL TOOLS NOW:**
43
- - ✅ Execute on BOTH GitHub and Gitea APIs automatically
44
- - ✅ Use GITHUB_USERNAME and GITEA_USERNAME from environment variables
45
- - ✅ Return separated responses: { github: {...}, gitea: {...} }
46
- - ✅ NO manual owner/user/author parameters needed
47
- - ✅ Each provider uses its own credentials automatically
48
-
49
- ### Environment Variables Required:
50
- \\\`\\\`\\\`bash
51
- GITHUB_TOKEN=your_github_token
52
- GITHUB_USERNAME=YourGitHubUsername
53
- GITEA_TOKEN=your_gitea_token
54
- GITEA_USERNAME=yourGiteaUsername
55
- GITEA_URL=http://your-gitea-server:port
56
- \\\`\\\`\\\`
57
-
58
- ---
59
-
60
- ## ⚠️ projectPath Requirements (MANDATORY - NO EXCEPTIONS)
61
-
62
- **RULE: projectPath MUST be provided in EVERY tool call**
63
-
64
- ### ✅ Correct Usage:
65
- \\\`\\\`\\\`javascript
66
- {
67
- "projectPath": "Z:/absolute/path/to/project-root", // ← MANDATORY FIRST PARAMETER
68
- "action": "stats"
69
- // projectPath must be absolute path to project ROOT folder
70
- // NOT a subfolder, NOT a file, NOT a parent folder
71
- }
72
- \\\`\\\`\\\`
73
-
74
- ### ❌ WRONG Usage:
75
- \\\`\\\`\\\`javascript
76
- // ❌ Missing projectPath (will be rejected by server)
77
- {
78
- "action": "stats"
79
- }
80
-
81
- // ❌ Relative path
82
- "projectPath": "./my-project"
83
-
84
- // ❌ Subfolder instead of root
85
- "projectPath": "/project-root/src"
86
-
87
- // ❌ Parent folder
88
- "projectPath": "/path/to/workspace"
89
-
90
- // ❌ File path
91
- "projectPath": "/project/package.json"
92
- \\\`\\\`\\\`
93
-
94
- ### 📋 Rules:
95
- **projectPath MUST be:**
96
- - ✅ **MANDATORY** - Cannot be omitted (server will reject)
97
- - ✅ Absolute path (starts with / or drive letter)
98
- - ✅ Points to the ROOT folder of the opened project
99
- - ✅ Where the .git folder is located
100
- - ✅ The working directory for ALL Git operations
101
- - ✅ The same folder you opened in your IDE
102
- - ✅ Contains .git folder (for Git operations)
103
-
104
- ---
105
-
106
- ## 📚 Table of Contents
107
-
108
- 1. [Quick Start](#quick-start)
109
- 2. [Provider Types](#provider-types)
110
- 3. [Core Workflow Tools](#core-workflow-tools)
111
- 4. [Migration Tools (NEW)](#migration-tools)
112
- 5. [Remote Management Tools](#remote-management-tools)
113
- 6. [Issue & Pull Request Tools](#issue--pull-request-tools)
114
- 7. [Release & Package Tools](#release--package-tools)
115
- 8. [Branch & Tag Tools](#branch--tag-tools)
116
- 9. [Configuration & Monitoring Tools](#configuration--monitoring-tools)
117
- 10. [Advanced Tools](#advanced-tools)
118
- 11. [Best Practices](#best-practices)
119
-
120
- ---
121
-
122
- ## 🚀 Quick Start
123
-
124
- ### Installation
125
- \`\`\`bash
126
- npm install @andrebuzeli/git-mcp
127
- \`\`\`
128
-
129
- ### Configuration (mcp.json or .env)
130
- \`\`\`json
131
- {
132
- "GITHUB_TOKEN": "ghp_your_token_here",
133
- "GITHUB_USERNAME": "Your-GitHub-Username",
134
- "GITEA_URL": "https://your-gitea.com",
135
- "GITEA_TOKEN": "your_gitea_token",
136
- "GITEA_USERNAME": "your-gitea-username"
137
- }
138
- \`\`\`
139
-
140
- ### Basic Usage
141
- \`\`\`javascript
142
- // Call any tool via MCP protocol
143
- {
144
- "tool": "git-workflow",
145
- "params": {
146
- "action": "status",
147
- "projectPath": "/path/to/project"
148
- }
149
- }
150
- \`\`\`
151
-
152
- ---
153
-
154
- ## 🔧 Provider Types
155
-
156
- ### LOCAL (10 tools)
157
- - **Scope:** Local Git operations only
158
- - **Requirements:** None (works offline)
159
- - **Examples:** git-config, git-stash, git-reset
160
-
161
- ### DUAL (7 tools)
162
- - **Scope:** Automatic execution on BOTH GitHub AND Gitea
163
- - **Requirements:** Both providers configured
164
- - **Examples:** git-upload, git-issues, git-pulls
165
- - **Behavior:** Executes operation on both providers simultaneously
166
-
167
- ### HYBRID (3 tools)
168
- - **Scope:** Local + optional remote operations
169
- - **Requirements:** Depends on action
170
- - **Examples:** git-workflow, git-sync, git-branches
171
-
172
- ---
173
-
174
- ## 🔄 Core Workflow Tools
175
-
176
- ### 1. **git-workflow** (HYBRID)
177
- **Description:** Core Git operations including init, status, commit, sync, backup, and remote repository management
178
-
179
- **Type:** HYBRID - Local operations + Remote operations (GitHub/Gitea)
180
-
181
- **projectPath:** ⚠️ REQUIRED - Absolute path to project ROOT folder (where you opened the project in IDE)
182
-
183
- **Actions:**
184
- - \`init\` - Initialize new repository
185
- - \`status\` - Check repository status
186
- - \`commit\` - Commit changes
187
- - \`sync\` - Sync with remote
188
- - \`backup\` - Create backup
189
- - \`create\` - Create remote repository
190
- - \`list\` - List repositories
191
- - \`get\` - Get repository details
192
- - \`update\` - Update repository
193
- - \`delete\` - Delete repository
194
- - \`fork\` - Fork repository
195
- - \`search\` - Search repositories
196
-
197
- **Examples:**
198
-
199
- \`\`\`javascript
200
- // 1. Check repository status
201
- {
202
- "tool": "git-workflow",
203
- "params": {
204
- "action": "status",
205
- "projectPath": "/path/to/project"
206
- }
207
- }
208
-
209
- // 2. Create repository on GitHub
210
- {
211
- "tool": "git-workflow",
212
- "params": {
213
- "action": "create",
214
- "projectPath": "/path/to/project",
215
- "name": "my-new-repo",
216
- "description": "My awesome project",
217
- "private": true,
218
- "provider": "github"
219
- }
220
- }
221
-
222
- // 3. Get repository details from Gitea
223
- {
224
- "tool": "git-workflow",
225
- "params": {
226
- "action": "get",
227
- "projectPath": "/path/to/project",
228
- "repo": "my-repo",
229
- "owner": "username",
230
- "provider": "gitea"
231
- }
232
- }
233
-
234
- // 4. Sync with remote
235
- {
236
- "tool": "git-workflow",
237
- "params": {
238
- "action": "sync",
239
- "projectPath": "/path/to/project",
240
- "remote": "origin",
241
- "branch": "main"
242
- }
243
- }
244
- \`\`\`
245
-
246
- ---
247
-
248
- ### 2. **git-upload** (DUAL)
249
- **Description:** Upload complete project to BOTH GitHub AND Gitea automatically with full traceability
250
-
251
- **Type:** DUAL - Executes on BOTH providers simultaneously
252
-
253
- **Features:**
254
- - Automatic repository creation on both providers
255
- - Full commit history tracking
256
- - Automatic remote configuration
257
- - Traceability logs
258
-
259
- **Parameters:**
260
- - \`projectPath\` (required) - Path to project
261
- - \`name\` (optional) - Repository name (defaults to folder name)
262
- - \`description\` (optional) - Repository description
263
- - \`private\` (optional) - Make repository private (default: true)
264
- - \`branch\` (optional) - Branch name (default: master)
265
- - \`commitMessage\` (optional) - Custom commit message
266
- - \`force\` (optional) - Force overwrite if exists
267
-
268
- **Example:**
269
-
270
- \`\`\`javascript
271
- {
272
- "tool": "git-upload",
273
- "params": {
274
- "projectPath": "/path/to/project",
275
- "name": "my-project",
276
- "description": "My awesome project",
277
- "private": true,
278
- "force": false
279
- }
280
- }
281
-
282
- // Result: Creates repositories on:
283
- // - GitHub: github.com/Your-Username/my-project
284
- // - Gitea: your-gitea.com/your-username/my-project
285
- \`\`\`
286
-
287
- ---
288
-
289
- ### 3. **git-update** (DUAL)
290
- **Description:** Complete update workflow (add, commit, push) to BOTH GitHub AND Gitea with full traceability
291
-
292
- **Type:** DUAL - Executes on BOTH providers simultaneously
293
-
294
- **Features:**
295
- - Automatic staging of changes
296
- - Smart commit with traceability
297
- - Push to both providers
298
- - Detailed change logs
299
-
300
- **Parameters:**
301
- - \`projectPath\` (required) - Path to project
302
- - \`message\` (required) - Commit message
303
- - \`files\` (optional) - Specific files to update (default: all changes)
304
- - \`push\` (optional) - Push to remote (default: true)
305
- - \`remote\` (optional) - Remote name (default: origin)
306
- - \`branch\` (optional) - Branch name (default: current)
307
-
308
- **Example:**
309
-
310
- \`\`\`javascript
311
- {
312
- "tool": "git-update",
313
- "params": {
314
- "projectPath": "/path/to/project",
315
- "message": "feat: add new feature X",
316
- "push": true
317
- }
318
- }
319
-
320
- // Result:
321
- // 1. Stages all changes
322
- // 2. Creates commit with message
323
- // 3. Pushes to GitHub and Gitea simultaneously
324
- \`\`\`
325
-
326
- ---
327
-
328
- ### 4. **git-history** (DUAL)
329
- **Description:** Maintain detailed history of all project changes with remote tracking via issues
330
-
331
- **Type:** DUAL - Creates tracking issues on BOTH providers
332
-
333
- **Actions:**
334
- - \`track\` - Track changes and create issue
335
- - \`sync\` - Sync history to remote trackers
336
- - \`list\` - List tracked changes
337
- - \`get\` - Get specific change details
338
-
339
- **Features:**
340
- - Automatic issue creation for changes
341
- - Cross-reference between commits and issues
342
- - Timeline of all changes
343
- - Remote backup via issue system
344
-
345
- **Examples:**
346
-
347
- \`\`\`javascript
348
- // 1. Track changes and create issues
349
- {
350
- "tool": "git-history",
351
- "params": {
352
- "action": "track",
353
- "projectPath": "/path/to/project",
354
- "message": "Implemented authentication system",
355
- "labels": ["feature", "backend"]
356
- }
357
- }
358
-
359
- // 2. Sync history to remote
360
- {
361
- "tool": "git-history",
362
- "params": {
363
- "action": "sync",
364
- "projectPath": "/path/to/project"
365
- }
366
- }
367
-
368
- // 3. List all tracked changes
369
- {
370
- "tool": "git-history",
371
- "params": {
372
- "action": "list",
373
- "projectPath": "/path/to/project",
374
- "limit": 50
375
- }
376
- }
377
- \`\`\`
378
-
379
- ---
380
-
381
- ## 🔧 Migration Tools (NEW in v6.3.1)
382
-
383
- ### 21. **git-fix** (LOCAL)
384
- **Description:** Fix local Git repositories to work with dual-provider system (GitHub + Gitea)
385
-
386
- **Type:** LOCAL - Converts existing repos to dual-provider configuration
387
-
388
- **projectPath:** ⚠️ REQUIRED - Absolute path to project ROOT folder that needs fixing
389
-
390
- **Features:**
391
- - 🔍 **Auto-detection:** Automatically detects repository name from existing remotes
392
- - ✅ **Username correction:** Uses correct usernames from GITHUB_USERNAME and GITEA_USERNAME env vars
393
- - 🗑️ **Clean setup:** Removes old remotes and creates standardized configuration
394
- - 🔄 **Dual-push:** Configures origin to push to both GitHub and Gitea simultaneously
395
- - 📝 **Preserves history:** Keeps all commits and Git history intact
396
- - ⚙️ **.gitignore creation:** Creates standard .gitignore if missing
397
-
398
- **Parameters:**
399
- - \\\`projectPath\\\` (required) - Absolute path to Git repository ROOT folder
400
- - \\\`autoDetect\\\` (optional) - Auto-detect repo name from remotes (default: true)
401
- - \\\`githubRepo\\\` (optional) - GitHub repo in format "owner/repo" (auto-detected if not provided)
402
- - \\\`giteaRepo\\\` (optional) - Gitea repo in format "owner/repo" (auto-detected if not provided)
403
-
404
- **Requirements:**
405
- - \\\`GITHUB_USERNAME\\\` env var (REQUIRED)
406
- - \\\`GITEA_USERNAME\\\` env var (REQUIRED)
407
- - \\\`GITEA_URL\\\` env var (default: http://localhost:3000)
408
-
409
- **When to use:**
410
- - ✅ Existing Git repo NOT configured for dual-provider
411
- - ✅ Migrating from single remote (GitHub OR Gitea) to dual-push
412
- - ✅ Fixing incorrect username configuration
413
- - ✅ Standardizing repository configuration across projects
414
-
415
- **What it does:**
416
- 1. ✅ Verifies/initializes Git repository
417
- 2. 🔍 Captures current remotes (before state)
418
- 3. 🔍 Auto-detects repository name from existing URLs
419
- 4. 🗑️ Removes old remotes (origin, github, gitea)
420
- 5. ➕ Adds new 'github' remote with correct username
421
- 6. ➕ Adds new 'gitea' remote with correct username
422
- 7. ⚙️ Configures 'origin' for dual-push (GitHub + Gitea)
423
- 8. 📝 Creates .gitignore if missing
424
- 9. 📊 Shows before/after comparison
425
-
426
- **Examples:**
427
-
428
- \\\`\\\`\\\`javascript
429
- // 1. Auto-detect and fix repository
430
- {
431
- "tool": "git-fix",
432
- "params": {
433
- "projectPath": "Z:/my-old-project",
434
- "autoDetect": true
435
- }
436
- }
437
-
438
- // Before:
439
- // origin → https://github.com/olduser/old-project.git
440
-
441
- // After:
442
- // github → https://github.com/Your-GitHub-Username/old-project.git
443
- // gitea → http://nas-ubuntu:9999/your-gitea-username/old-project.git
444
- // origin → dual-push to both
445
-
446
- // 2. Manual repo specification
447
- {
448
- "tool": "git-fix",
449
- "params": {
450
- "projectPath": "Z:/my-project",
451
- "githubRepo": "Andre-Buzeli/my-project",
452
- "giteaRepo": "andrebuzeli/my-project",
453
- "autoDetect": false
454
- }
455
- }
456
-
457
- // 3. Fix multiple projects (use sequentially)
458
- // Project 1
459
- {
460
- "tool": "git-fix",
461
- "params": {
462
- "projectPath": "Z:/project-1",
463
- "autoDetect": true
464
- }
465
- }
466
-
467
- // Project 2
468
- {
469
- "tool": "git-fix",
470
- "params": {
471
- "projectPath": "Z:/project-2",
472
- "autoDetect": true
473
- }
474
- }
475
- \\\`\\\`\\\`
476
-
477
- **Result Structure:**
478
- \\\`\\\`\\\`json
479
- {
480
- "success": true,
481
- "projectPath": "Z:/my-project",
482
- "fixed": [
483
- "✅ Repositório Git válido encontrado",
484
- "🔍 Nome do repo auto-detectado: my-project",
485
- "✅ GitHub repo: Andre-Buzeli/my-project",
486
- "✅ Gitea repo: andrebuzeli/my-project",
487
- "🗑️ Removido remote antigo: origin",
488
- "✅ Adicionado remote GitHub: https://github.com/Andre-Buzeli/my-project.git",
489
- "✅ Adicionado remote Gitea: http://nas-ubuntu:9999/andrebuzeli/my-project.git",
490
- "✅ Configurado origin para push dual (GitHub + Gitea)",
491
- "✅ Histórico de commits preservado",
492
- "✅ Criado .gitignore padrão"
493
- ],
494
- "warnings": [],
495
- "errors": [],
496
- "remotes": {
497
- "before": [...],
498
- "after": [...]
499
- }
500
- }
501
- \\\`\\\`\\\`
502
-
503
- **⚠️ Important Notes:**
504
- - Always backup your repository before running git-fix
505
- - Requires valid GITHUB_USERNAME and GITEA_USERNAME env vars
506
- - Repository name detection works with github.com and Gitea URLs
507
- - Falls back to folder name if no remote detected
508
- - Does NOT push to remotes (only configures them)
509
- - Safe to run multiple times (idempotent)
510
-
511
- ---
512
-
513
- ## 🌐 Remote Management Tools
514
-
515
- ### 5. **git-remote** (LOCAL)
516
- **Description:** Manage remote repository connections
517
-
518
- **Type:** LOCAL - Manages local Git remotes
519
-
520
- **Actions:**
521
- - \`add\` - Add new remote
522
- - \`remove\` - Remove remote
523
- - \`rename\` - Rename remote
524
- - \`show\` - Show remote details
525
- - \`set-url\` - Change remote URL
526
- - \`prune\` - Remove stale references
527
- - \`list\` - List all remotes
528
-
529
- **Examples:**
530
-
531
- \`\`\`javascript
532
- // 1. Add remote
533
- {
534
- "tool": "git-remote",
535
- "params": {
536
- "action": "add",
537
- "projectPath": "/path/to/project",
538
- "name": "upstream",
539
- "url": "https://github.com/original/repo.git"
540
- }
541
- }
542
-
543
- // 2. List remotes with URLs
544
- {
545
- "tool": "git-remote",
546
- "params": {
547
- "action": "list",
548
- "projectPath": "/path/to/project",
549
- "verbose": true
550
- }
551
- }
552
-
553
- // 3. Change remote URL
554
- {
555
- "tool": "git-remote",
556
- "params": {
557
- "action": "set-url",
558
- "projectPath": "/path/to/project",
559
- "name": "origin",
560
- "url": "git@github.com:user/repo.git"
561
- }
562
- }
563
- \`\`\`
564
-
565
- ---
566
-
567
- ### 6. **git-sync** (HYBRID)
568
- **Description:** Advanced repository synchronization with conflict resolution
569
-
570
- **Type:** HYBRID - Local sync + Remote provider sync
571
-
572
- **Actions:**
573
- - \`sync\` - Synchronize repository
574
- - \`status\` - Check sync status
575
-
576
- **Features:**
577
- - Pull from remote
578
- - Push to remote
579
- - Conflict detection
580
- - Merge strategies (merge, rebase, fast-forward)
581
- - Ahead/behind commit tracking
582
-
583
- **Examples:**
584
-
585
- \`\`\`javascript
586
- // 1. Sync with merge strategy
587
- {
588
- "tool": "git-sync",
589
- "params": {
590
- "action": "sync",
591
- "projectPath": "/path/to/project",
592
- "remote": "origin",
593
- "branch": "main",
594
- "strategy": "merge"
595
- }
596
- }
597
-
598
- // 2. Check sync status
599
- {
600
- "tool": "git-sync",
601
- "params": {
602
- "action": "status",
603
- "projectPath": "/path/to/project",
604
- "detailed": true,
605
- "checkAhead": true,
606
- "includeRemote": true
607
- }
608
- }
609
-
610
- // 3. Force sync (careful!)
611
- {
612
- "tool": "git-sync",
613
- "params": {
614
- "action": "sync",
615
- "projectPath": "/path/to/project",
616
- "force": true,
617
- "dryRun": false
618
- }
619
- }
620
- \`\`\`
621
-
622
- ---
623
-
624
- ## 🐛 Issue & Pull Request Tools
625
-
626
- ### 7. **git-issues** (DUAL)
627
- **Description:** Complete issue management for BOTH GitHub AND Gitea
628
-
629
- **Type:** DUAL - Executes on BOTH providers simultaneously
630
-
631
- **Actions:**
632
- - \`create\` - Create new issue
633
- - \`list\` - List issues
634
- - \`get\` - Get issue details
635
- - \`update\` - Update issue
636
- - \`close\` - Close issue
637
- - \`comment\` - Add comment
638
- - \`search\` - Search issues
639
-
640
- **Examples:**
641
-
642
- \`\`\`javascript
643
- // 1. Create issue on both providers
644
- {
645
- "tool": "git-issues",
646
- "params": {
647
- "action": "create",
648
- "projectPath": "/path/to/project",
649
- "repo": "my-repo",
650
- "title": "Bug: Login not working",
651
- "body": "Description of the bug...",
652
- "labels": ["bug", "urgent"],
653
- "assignees": ["developer1"]
654
- }
655
- }
656
- // Creates issue #X on GitHub AND Gitea simultaneously
657
-
658
- // 2. List open issues
659
- {
660
- "tool": "git-issues",
661
- "params": {
662
- "action": "list",
663
- "projectPath": "/path/to/project",
664
- "repo": "my-repo",
665
- "state_filter": "open",
666
- "sort": "created",
667
- "direction": "desc"
668
- }
669
- }
670
-
671
- // 3. Update issue
672
- {
673
- "tool": "git-issues",
674
- "params": {
675
- "action": "update",
676
- "projectPath": "/path/to/project",
677
- "repo": "my-repo",
678
- "issue_number": 42,
679
- "title": "Bug: Login fixed",
680
- "state": "closed"
681
- }
682
- }
683
-
684
- // 4. Add comment
685
- {
686
- "tool": "git-issues",
687
- "params": {
688
- "action": "comment",
689
- "projectPath": "/path/to/project",
690
- "repo": "my-repo",
691
- "issue_number": 42,
692
- "comment_body": "Fixed in commit abc123"
693
- }
694
- }
695
-
696
- // 5. Search issues
697
- {
698
- "tool": "git-issues",
699
- "params": {
700
- "action": "search",
701
- "projectPath": "/path/to/project",
702
- "repo": "my-repo",
703
- "query": "bug authentication",
704
- "search_sort": "updated"
705
- }
706
- }
707
- \`\`\`
708
-
709
- ---
710
-
711
- ### 8. **git-pulls** (DUAL)
712
- **Description:** Pull request management for BOTH GitHub AND Gitea
713
-
714
- **Type:** DUAL - Executes on BOTH providers simultaneously
715
-
716
- **Actions:**
717
- - \`create\` - Create pull request
718
- - \`list\` - List pull requests
719
- - \`get\` - Get PR details
720
- - \`update\` - Update pull request
721
- - \`merge\` - Merge pull request
722
- - \`close\` - Close pull request
723
- - \`review\` - Review pull request
724
- - \`search\` - Search pull requests
725
-
726
- **Examples:**
727
-
728
- \`\`\`javascript
729
- // 1. Create pull request on both providers
730
- {
731
- "tool": "git-pulls",
732
- "params": {
733
- "action": "create",
734
- "projectPath": "/path/to/project",
735
- "repo": "my-repo",
736
- "title": "Feature: Add user authentication",
737
- "body": "Implements JWT authentication...",
738
- "head": "feature/auth",
739
- "base": "main"
740
- }
741
- }
742
-
743
- // 2. List pull requests
744
- {
745
- "tool": "git-pulls",
746
- "params": {
747
- "action": "list",
748
- "projectPath": "/path/to/project",
749
- "repo": "my-repo",
750
- "state_filter": "open",
751
- "sort": "created"
752
- }
753
- }
754
-
755
- // 3. Review pull request
756
- {
757
- "tool": "git-pulls",
758
- "params": {
759
- "action": "review",
760
- "projectPath": "/path/to/project",
761
- "repo": "my-repo",
762
- "pull_number": 15,
763
- "event": "APPROVE",
764
- "review_body": "LGTM! Great work!"
765
- }
766
- }
767
-
768
- // 4. Merge pull request
769
- {
770
- "tool": "git-pulls",
771
- "params": {
772
- "action": "merge",
773
- "projectPath": "/path/to/project",
774
- "repo": "my-repo",
775
- "pull_number": 15,
776
- "merge_method": "squash",
777
- "commit_title": "feat: add authentication",
778
- "commit_message": "Squashed commits from PR #15"
779
- }
780
- }
781
- \`\`\`
782
-
783
- ---
784
-
785
- ## 🚀 Release & Package Tools
786
-
787
- ### 9. **git-release** (DUAL)
788
- **Description:** Release management for BOTH GitHub AND Gitea
789
-
790
- **Type:** DUAL - Executes on BOTH providers simultaneously
791
-
792
- **Actions:**
793
- - \`create\` - Create release
794
- - \`list\` - List releases
795
- - \`get\` - Get release details
796
- - \`update\` - Update release
797
- - \`delete\` - Delete release
798
- - \`publish\` - Publish draft release
799
- - \`download\` - Download release assets
800
-
801
- **Examples:**
802
-
803
- \`\`\`javascript
804
- // 1. Create release on both providers
805
- {
806
- "tool": "git-release",
807
- "params": {
808
- "action": "create",
809
- "projectPath": "/path/to/project",
810
- "tagName": "v1.0.0",
811
- "releaseName": "Version 1.0.0",
812
- "description": "First stable release",
813
- "draft": false,
814
- "prerelease": false,
815
- "generateNotes": true,
816
- "assets": ["/path/to/binary.zip"]
817
- }
818
- }
819
-
820
- // 2. List all releases
821
- {
822
- "tool": "git-release",
823
- "params": {
824
- "action": "list",
825
- "projectPath": "/path/to/project",
826
- "includeDrafts": true,
827
- "includePrerelease": true,
828
- "limit": 10
829
- }
830
- }
831
-
832
- // 3. Get specific release
833
- {
834
- "tool": "git-release",
835
- "params": {
836
- "action": "get",
837
- "projectPath": "/path/to/project",
838
- "tagName": "v1.0.0"
839
- }
840
- }
841
-
842
- // 4. Update release
843
- {
844
- "tool": "git-release",
845
- "params": {
846
- "action": "update",
847
- "projectPath": "/path/to/project",
848
- "tagName": "v1.0.0",
849
- "description": "Updated release notes",
850
- "draft": false
851
- }
852
- }
853
-
854
- // 5. Delete release
855
- {
856
- "tool": "git-release",
857
- "params": {
858
- "action": "delete",
859
- "projectPath": "/path/to/project",
860
- "tagName": "v1.0.0-beta",
861
- "force": true
862
- }
863
- }
864
- \`\`\`
865
-
866
- ---
867
-
868
- ### 10. **git-packages** (HYBRID)
869
- **Description:** Package management operations
870
-
871
- **Type:** HYBRID - Local packages + Remote operations (GitHub/Gitea)
872
-
873
- **Actions:**
874
- - \`list\` - List packages
875
- - \`get\` - Get package details
876
- - \`create\` - Create package
877
- - \`update\` - Update package
878
- - \`delete\` - Delete package
879
- - \`publish\` - Publish package
880
- - \`download\` - Download package
881
-
882
- **Examples:**
883
-
884
- \`\`\`javascript
885
- // 1. List packages
886
- {
887
- "tool": "git-packages",
888
- "params": {
889
- "action": "list",
890
- "projectPath": "/path/to/project",
891
- "packageType": "npm",
892
- "provider": "github"
893
- }
894
- }
895
-
896
- // 2. Get package details
897
- {
898
- "tool": "git-packages",
899
- "params": {
900
- "action": "get",
901
- "projectPath": "/path/to/project",
902
- "packageName": "my-package",
903
- "version": "1.0.0",
904
- "provider": "github"
905
- }
906
- }
907
-
908
- // 3. Publish package
909
- {
910
- "tool": "git-packages",
911
- "params": {
912
- "action": "publish",
913
- "projectPath": "/path/to/project",
914
- "packageName": "my-package",
915
- "version": "1.0.0",
916
- "provider": "github",
917
- "registry": "npm"
918
- }
919
- }
920
- \`\`\`
921
-
922
- ---
923
-
924
- ## 🌿 Branch & Tag Tools
925
-
926
- ### 11. **git-branches** (HYBRID)
927
- **Description:** Branch management operations
928
-
929
- **Type:** HYBRID - Local branches + Remote operations (GitHub/Gitea)
930
-
931
- **Actions:**
932
- - \`create\` - Create branch
933
- - \`list\` - List branches
934
- - \`get\` - Get branch details
935
- - \`delete\` - Delete branch
936
- - \`merge\` - Merge branches
937
- - \`compare\` - Compare branches
938
-
939
- **Examples:**
940
-
941
- \`\`\`javascript
942
- // 1. Create new branch
943
- {
944
- "tool": "git-branches",
945
- "params": {
946
- "action": "create",
947
- "projectPath": "/path/to/project",
948
- "branchName": "feature/new-feature",
949
- "sourceBranch": "main",
950
- "checkout": true
951
- }
952
- }
953
-
954
- // 2. List all branches
955
- {
956
- "tool": "git-branches",
957
- "params": {
958
- "action": "list",
959
- "projectPath": "/path/to/project",
960
- "remote": "origin"
961
- }
962
- }
963
-
964
- // 3. Compare branches
965
- {
966
- "tool": "git-branches",
967
- "params": {
968
- "action": "compare",
969
- "projectPath": "/path/to/project",
970
- "baseBranch": "main",
971
- "compareBranch": "feature/new-feature"
972
- }
973
- }
974
-
975
- // 4. Delete branch
976
- {
977
- "tool": "git-branches",
978
- "params": {
979
- "action": "delete",
980
- "projectPath": "/path/to/project",
981
- "branchName": "old-feature",
982
- "force": false
983
- }
984
- }
985
- \`\`\`
986
-
987
- ---
988
-
989
- ### 12. **git-tags** (HYBRID)
990
- **Description:** Tag management operations
991
-
992
- **Type:** HYBRID - Local tags + Remote operations (GitHub/Gitea)
993
-
994
- **Actions:**
995
- - \`create\` - Create tag
996
- - \`list\` - List tags
997
- - \`get\` - Get tag details
998
- - \`delete\` - Delete tag
999
- - \`search\` - Search tags
1000
-
1001
- **Examples:**
1002
-
1003
- \`\`\`javascript
1004
- // 1. Create annotated tag
1005
- {
1006
- "tool": "git-tags",
1007
- "params": {
1008
- "action": "create",
1009
- "projectPath": "/path/to/project",
1010
- "tagName": "v1.0.0",
1011
- "message": "Version 1.0.0 release",
1012
- "annotated": true,
1013
- "commit": "HEAD"
1014
- }
1015
- }
1016
-
1017
- // 2. List all tags
1018
- {
1019
- "tool": "git-tags",
1020
- "params": {
1021
- "action": "list",
1022
- "projectPath": "/path/to/project",
1023
- "pattern": "v*"
1024
- }
1025
- }
1026
-
1027
- // 3. Get tag details
1028
- {
1029
- "tool": "git-tags",
1030
- "params": {
1031
- "action": "get",
1032
- "projectPath": "/path/to/project",
1033
- "tagName": "v1.0.0"
1034
- }
1035
- }
1036
-
1037
- // 4. Delete tag
1038
- {
1039
- "tool": "git-tags",
1040
- "params": {
1041
- "action": "delete",
1042
- "projectPath": "/path/to/project",
1043
- "tagName": "v0.9.0-beta",
1044
- "force": true
1045
- }
1046
- }
1047
- \`\`\`
1048
-
1049
- ---
1050
-
1051
- ## ⚙️ Configuration & Monitoring Tools
1052
-
1053
- ### 13. **git-config** (LOCAL)
1054
- **Description:** Git configuration management
1055
-
1056
- **Type:** LOCAL - Manages local Git configuration
1057
-
1058
- **Actions:**
1059
- - \`get\` - Get configuration value
1060
- - \`set\` - Set configuration value
1061
- - \`unset\` - Remove configuration
1062
- - \`list\` - List all configuration
1063
- - \`edit\` - Open editor
1064
- - \`show\` - Show configuration details
1065
-
1066
- **Examples:**
1067
-
1068
- \`\`\`javascript
1069
- // 1. Get user name
1070
- {
1071
- "tool": "git-config",
1072
- "params": {
1073
- "action": "get",
1074
- "projectPath": "/path/to/project",
1075
- "key": "user.name",
1076
- "local": true
1077
- }
1078
- }
1079
-
1080
- // 2. Set user email
1081
- {
1082
- "tool": "git-config",
1083
- "params": {
1084
- "action": "set",
1085
- "projectPath": "/path/to/project",
1086
- "key": "user.email",
1087
- "value": "dev@example.com",
1088
- "global": false
1089
- }
1090
- }
1091
-
1092
- // 3. List all configuration
1093
- {
1094
- "tool": "git-config",
1095
- "params": {
1096
- "action": "list",
1097
- "projectPath": "/path/to/project",
1098
- "showOrigin": true
1099
- }
1100
- }
1101
-
1102
- // 4. Show specific config with scope
1103
- {
1104
- "tool": "git-config",
1105
- "params": {
1106
- "action": "show",
1107
- "projectPath": "/path/to/project",
1108
- "key": "core.editor",
1109
- "showScope": true
1110
- }
1111
- }
1112
- \`\`\`
1113
-
1114
- ---
1115
-
1116
- ### 14. **git-monitor** (LOCAL)
1117
- **Description:** Repository monitoring and status operations
1118
-
1119
- **Type:** LOCAL - Monitors local repository
1120
-
1121
- **Actions:**
1122
- - \`log\` - Show commit log
1123
- - \`status\` - Check repository status
1124
- - \`commits\` - Detailed commit history
1125
- - \`contributors\` - Show contributors
1126
-
1127
- **Examples:**
1128
-
1129
- \`\`\`javascript
1130
- // 1. Show recent commits
1131
- {
1132
- "tool": "git-monitor",
1133
- "params": {
1134
- "action": "log",
1135
- "projectPath": "/path/to/project",
1136
- "limit": 10,
1137
- "since": "1 week ago"
1138
- }
1139
- }
1140
-
1141
- // 2. Detailed status
1142
- {
1143
- "tool": "git-monitor",
1144
- "params": {
1145
- "action": "status",
1146
- "projectPath": "/path/to/project",
1147
- "detailed": true
1148
- }
1149
- }
1150
-
1151
- // 3. Get commits with statistics
1152
- {
1153
- "tool": "git-monitor",
1154
- "params": {
1155
- "action": "commits",
1156
- "projectPath": "/path/to/project",
1157
- "limit": 50,
1158
- "author": "john@example.com",
1159
- "includeStats": true,
1160
- "format": "full"
1161
- }
1162
- }
1163
-
1164
- // 4. Show contributors
1165
- {
1166
- "tool": "git-monitor",
1167
- "params": {
1168
- "action": "contributors",
1169
- "projectPath": "/path/to/project",
1170
- "sortBy": "commits",
1171
- "since": "2024-01-01"
1172
- }
1173
- }
1174
- \`\`\`
1175
-
1176
- ---
1177
-
1178
- ### 15. **git-analytics** (LOCAL)
1179
- **Description:** Repository analytics and statistics
1180
-
1181
- **Type:** LOCAL - Analyzes local repository
1182
-
1183
- **Actions:**
1184
- - \`stats\` - Repository statistics
1185
- - \`commits\` - Commit analysis
1186
- - \`contributors\` - Contributor analysis
1187
-
1188
- **Examples:**
1189
-
1190
- \`\`\`javascript
1191
- // 1. Get repository statistics
1192
- {
1193
- "tool": "git-analytics",
1194
- "params": {
1195
- "action": "stats",
1196
- "projectPath": "/path/to/project",
1197
- "branch": "main",
1198
- "includeFileTypes": true,
1199
- "groupBy": "month"
1200
- }
1201
- }
1202
-
1203
- // 2. Analyze commits
1204
- {
1205
- "tool": "git-analytics",
1206
- "params": {
1207
- "action": "commits",
1208
- "projectPath": "/path/to/project",
1209
- "since": "2024-01-01",
1210
- "until": "2024-12-31",
1211
- "author": "developer1",
1212
- "includeStats": true
1213
- }
1214
- }
1215
-
1216
- // 3. Contributor analysis
1217
- {
1218
- "tool": "git-analytics",
1219
- "params": {
1220
- "action": "contributors",
1221
- "projectPath": "/path/to/project",
1222
- "sortBy": "additions",
1223
- "minCommits": 5
1224
- }
1225
- }
1226
- \`\`\`
1227
-
1228
- ---
1229
-
1230
- ## 🔐 Advanced Tools
1231
-
1232
- ### 16. **git-stash** (LOCAL)
1233
- **Description:** Stash management for temporary changes
1234
-
1235
- **Type:** LOCAL - Manages local stash
1236
-
1237
- **Actions:**
1238
- - \`stash\` - Stash changes
1239
- - \`pop\` - Apply and remove stash
1240
- - \`apply\` - Apply stash
1241
- - \`list\` - List stashes
1242
- - \`show\` - Show stash contents
1243
- - \`drop\` - Remove stash
1244
- - \`clear\` - Clear all stashes
1245
-
1246
- **Examples:**
1247
-
1248
- \`\`\`javascript
1249
- // 1. Stash current changes
1250
- {
1251
- "tool": "git-stash",
1252
- "params": {
1253
- "action": "stash",
1254
- "projectPath": "/path/to/project",
1255
- "message": "WIP: feature development",
1256
- "includeUntracked": true
1257
- }
1258
- }
1259
-
1260
- // 2. List all stashes
1261
- {
1262
- "tool": "git-stash",
1263
- "params": {
1264
- "action": "list",
1265
- "projectPath": "/path/to/project",
1266
- "oneline": false
1267
- }
1268
- }
1269
-
1270
- // 3. Apply stash
1271
- {
1272
- "tool": "git-stash",
1273
- "params": {
1274
- "action": "apply",
1275
- "projectPath": "/path/to/project",
1276
- "stashRef": "stash@{0}",
1277
- "index": true
1278
- }
1279
- }
1280
-
1281
- // 4. Pop latest stash
1282
- {
1283
- "tool": "git-stash",
1284
- "params": {
1285
- "action": "pop",
1286
- "projectPath": "/path/to/project"
1287
- }
1288
- }
1289
- \`\`\`
1290
-
1291
- ---
1292
-
1293
- ### 17. **git-reset** (LOCAL)
1294
- **Description:** Reset repository state (USE WITH CAUTION)
1295
-
1296
- **Type:** LOCAL - Resets local repository
1297
-
1298
- **Actions:**
1299
- - \`soft\` - Reset keeping changes staged
1300
- - \`mixed\` - Reset keeping changes unstaged
1301
- - \`hard\` - Reset discarding all changes
1302
- - \`file\` - Reset specific file
1303
-
1304
- **⚠️ WARNING: Destructive operations! Use with extreme caution!**
1305
-
1306
- **Examples:**
1307
-
1308
- \`\`\`javascript
1309
- // 1. Soft reset (keeps changes staged)
1310
- {
1311
- "tool": "git-reset",
1312
- "params": {
1313
- "action": "soft",
1314
- "projectPath": "/path/to/project",
1315
- "commit": "HEAD~1"
1316
- }
1317
- }
1318
-
1319
- // 2. Mixed reset (keeps changes unstaged)
1320
- {
1321
- "tool": "git-reset",
1322
- "params": {
1323
- "action": "mixed",
1324
- "projectPath": "/path/to/project",
1325
- "commit": "abc123"
1326
- }
1327
- }
1328
-
1329
- // 3. Hard reset (DANGEROUS - discards everything!)
1330
- {
1331
- "tool": "git-reset",
1332
- "params": {
1333
- "action": "hard",
1334
- "projectPath": "/path/to/project",
1335
- "commit": "HEAD",
1336
- "force": true
1337
- }
1338
- }
1339
-
1340
- // 4. Reset specific file
1341
- {
1342
- "tool": "git-reset",
1343
- "params": {
1344
- "action": "file",
1345
- "projectPath": "/path/to/project",
1346
- "file": "src/config.js",
1347
- "commit": "HEAD"
1348
- }
1349
- }
1350
- \`\`\`
1351
-
1352
- ---
1353
-
1354
- ### 18. **git-backup** (LOCAL)
1355
- **Description:** Repository backup and restore operations
1356
-
1357
- **Type:** LOCAL - Manages local backups
1358
-
1359
- **Actions:**
1360
- - \`backup\` - Create backup
1361
- - \`restore\` - Restore from backup
1362
- - \`list\` - List backups
1363
- - \`verify\` - Verify backup integrity
1364
-
1365
- **Examples:**
1366
-
1367
- \`\`\`javascript
1368
- // 1. Create backup
1369
- {
1370
- "tool": "git-backup",
1371
- "params": {
1372
- "action": "backup",
1373
- "projectPath": "/path/to/project",
1374
- "backupPath": "/backups/project-backup.tar.gz",
1375
- "name": "pre-refactor-backup",
1376
- "compression": true,
1377
- "includeUntracked": false
1378
- }
1379
- }
1380
-
1381
- // 2. List backups
1382
- {
1383
- "tool": "git-backup",
1384
- "params": {
1385
- "action": "list",
1386
- "projectPath": "/path/to/project",
1387
- "sortBy": "date"
1388
- }
1389
- }
1390
-
1391
- // 3. Restore from backup
1392
- {
1393
- "tool": "git-backup",
1394
- "params": {
1395
- "action": "restore",
1396
- "projectPath": "/path/to/project",
1397
- "backupPath": "/backups/project-backup.tar.gz",
1398
- "targetPath": "/restore/location",
1399
- "overwrite": false
1400
- }
1401
- }
1402
-
1403
- // 4. Verify backup
1404
- {
1405
- "tool": "git-backup",
1406
- "params": {
1407
- "action": "verify",
1408
- "projectPath": "/path/to/project",
1409
- "backupPath": "/backups/project-backup.tar.gz",
1410
- "checkIntegrity": true
1411
- }
1412
- }
1413
- \`\`\`
1414
-
1415
- ---
1416
-
1417
- ### 19. **git-archive** (LOCAL)
1418
- **Description:** Archive repository for distribution
1419
-
1420
- **Type:** LOCAL - Creates archives
1421
-
1422
- **Actions:**
1423
- - \`create\` - Create archive
1424
- - \`extract\` - Extract archive
1425
- - \`list\` - List archive contents
1426
- - \`verify\` - Verify archive
1427
-
1428
- **Examples:**
1429
-
1430
- \`\`\`javascript
1431
- // 1. Create archive
1432
- {
1433
- "tool": "git-archive",
1434
- "params": {
1435
- "action": "create",
1436
- "projectPath": "/path/to/project",
1437
- "outputPath": "/archives/project-v1.0.0.zip",
1438
- "format": "zip",
1439
- "ref": "v1.0.0",
1440
- "prefix": "project-v1.0.0/",
1441
- "includeSubmodules": true
1442
- }
1443
- }
1444
-
1445
- // 2. Extract archive
1446
- {
1447
- "tool": "git-archive",
1448
- "params": {
1449
- "action": "extract",
1450
- "projectPath": "/path/to/project",
1451
- "archivePath": "/archives/project.zip",
1452
- "targetPath": "/extract/location",
1453
- "overwrite": false
1454
- }
1455
- }
1456
-
1457
- // 3. List archive contents
1458
- {
1459
- "tool": "git-archive",
1460
- "params": {
1461
- "action": "list",
1462
- "projectPath": "/path/to/project",
1463
- "archivePath": "/archives/project.zip",
1464
- "showDetails": true
1465
- }
1466
- }
1467
- \`\`\`
1468
-
1469
- ---
1470
-
1471
- ### 20. **git-files** (LOCAL)
1472
- **Description:** Read-only file operations for repositories
1473
-
1474
- **Type:** LOCAL - File browsing
1475
-
1476
- **Actions:**
1477
- - \`read\` - Read file
1478
- - \`list\` - List files
1479
- - \`search\` - Search files
1480
- - \`backup\` - Backup files
1481
-
1482
- **Examples:**
1483
-
1484
- \`\`\`javascript
1485
- // 1. Read file
1486
- {
1487
- "tool": "git-files",
1488
- "params": {
1489
- "action": "read",
1490
- "projectPath": "/path/to/project",
1491
- "filePath": "src/index.js",
1492
- "encoding": "utf8"
1493
- }
1494
- }
1495
-
1496
- // 2. List files
1497
- {
1498
- "tool": "git-files",
1499
- "params": {
1500
- "action": "list",
1501
- "projectPath": "/path/to/project",
1502
- "filePattern": "*.js"
1503
- }
1504
- }
1505
-
1506
- // 3. Search in files
1507
- {
1508
- "tool": "git-files",
1509
- "params": {
1510
- "action": "search",
1511
- "projectPath": "/path/to/project",
1512
- "query": "function authenticate",
1513
- "filePattern": "*.js",
1514
- "caseSensitive": false
1515
- }
1516
- }
1517
- \`\`\`
1518
-
1519
- ---
1520
-
1521
- ## 💡 Best Practices
1522
-
1523
- ### 1. Provider Configuration
1524
- \`\`\`javascript
1525
- // ALWAYS configure providers properly
1526
- // GitHub uses capitalized username: "Your-Username"
1527
- // Gitea uses lowercase username: "your-username"
1528
-
1529
- // mcp.json or .env:
1530
- {
1531
- "GITHUB_USERNAME": "Andre-Buzeli", // Capitalized
1532
- "GITEA_USERNAME": "andrebuzeli" // Lowercase
1533
- }
1534
- \`\`\`
1535
-
1536
- ### 2. DUAL Tools Behavior
1537
- \`\`\`javascript
1538
- // DUAL tools execute on BOTH providers automatically
1539
- // No need to specify provider parameter
1540
- // Example: git-upload creates repos on GitHub AND Gitea
1541
-
1542
- {
1543
- "tool": "git-upload",
1544
- "params": {
1545
- "projectPath": "/project"
1546
- // No "provider" parameter needed!
1547
- }
1548
- }
1549
- // Result: Repos created on BOTH providers
1550
- \`\`\`
1551
-
1552
- ### 3. Error Handling
1553
- \`\`\`javascript
1554
- // Always check result.success
1555
- const result = await callTool("git-workflow", params);
1556
- if (result.success) {
1557
- console.log("Operation successful:", result.result);
1558
- } else {
1559
- console.error("Operation failed:", result.error);
1560
- }
1561
- \`\`\`
1562
-
1563
- ### 4. Path Requirements
1564
- \`\`\`javascript
1565
- // ALWAYS use absolute paths
1566
- {
1567
- "projectPath": "/absolute/path/to/project" // ✅ Correct
1568
- // "projectPath": "./relative/path" // ❌ Wrong
1569
- }
1570
- \`\`\`
1571
-
1572
- ### 5. Destructive Operations
1573
- \`\`\`javascript
1574
- // For destructive operations, always:
1575
- // 1. Create backup first
1576
- // 2. Use dryRun when available
1577
- // 3. Verify force parameter
1578
-
1579
- // Example: Before hard reset
1580
- {
1581
- "tool": "git-backup",
1582
- "params": {
1583
- "action": "backup",
1584
- "projectPath": "/path/to/project"
1585
- }
1586
- }
1587
-
1588
- // Then reset
1589
- {
1590
- "tool": "git-reset",
1591
- "params": {
1592
- "action": "hard",
1593
- "force": true // Explicit confirmation
1594
- }
1595
- }
1596
- \`\`\`
1597
-
1598
- ### 6. Rate Limiting
1599
- \`\`\`javascript
1600
- // GitHub/Gitea have rate limits
1601
- // For bulk operations, add delays:
1602
-
1603
- for (const repo of repos) {
1604
- await callTool("git-workflow", { action: "get", repo });
1605
- await sleep(1000); // 1 second delay
1606
- }
1607
- \`\`\`
1608
-
1609
- ---
1610
-
1611
- ## 📊 Tool Summary Table
1612
-
1613
- | Tool | Type | Actions | Primary Use Case |
1614
- |------|------|---------|------------------|
1615
- | git-workflow | HYBRID | 12 | Repository lifecycle & remote management |
1616
- | git-upload | DUAL | 1 | Upload project to both providers |
1617
- | git-update | DUAL | 1 | Update & push to both providers |
1618
- | git-history | DUAL | 4 | Track changes via issues |
1619
- | git-issues | DUAL | 7 | Issue management on both providers |
1620
- | git-pulls | DUAL | 8 | PR management on both providers |
1621
- | git-release | DUAL | 7 | Release management on both providers |
1622
- | git-packages | HYBRID | 7 | Package management |
1623
- | git-branches | HYBRID | 6 | Branch operations |
1624
- | git-tags | HYBRID | 5 | Tag operations |
1625
- | git-remote | LOCAL | 7 | Remote management |
1626
- | git-sync | HYBRID | 2 | Repository synchronization |
1627
- | git-config | LOCAL | 6 | Configuration management |
1628
- | git-monitor | LOCAL | 4 | Repository monitoring |
1629
- | git-analytics | LOCAL | 3 | Statistics & analysis |
1630
- | git-stash | LOCAL | 7 | Temporary changes |
1631
- | git-reset | LOCAL | 4 | Repository reset |
1632
- | git-backup | LOCAL | 4 | Backup operations |
1633
- | git-archive | LOCAL | 4 | Archive creation |
1634
- | git-files | LOCAL | 4 | File operations |
1635
- | **git-fix** | **LOCAL** | **1** | **Migrate repos to dual-provider (NEW v6.3.1)** |
1636
-
1637
- **Total: 21 tools, 110+ actions**
1638
-
1639
- ---
1640
-
1641
- ## 🎯 Common Workflows
1642
-
1643
- ### Workflow 1: New Project Setup
1644
- \`\`\`javascript
1645
- // 1. Initialize local repository
1646
- { "tool": "git-workflow", "params": { "action": "init", "projectPath": "/project" }}
1647
-
1648
- // 2. Upload to both providers
1649
- { "tool": "git-upload", "params": { "projectPath": "/project", "name": "my-project" }}
1650
-
1651
- // 3. Create first release
1652
- { "tool": "git-release", "params": { "action": "create", "tagName": "v1.0.0" }}
1653
- \`\`\`
1654
-
1655
- ### Workflow 2: Daily Development
1656
- \`\`\`javascript
1657
- // 1. Check status
1658
- { "tool": "git-monitor", "params": { "action": "status" }}
1659
-
1660
- // 2. Update & push changes
1661
- { "tool": "git-update", "params": { "message": "feat: new feature" }}
1662
-
1663
- // 3. Track in history
1664
- { "tool": "git-history", "params": { "action": "track" }}
1665
- \`\`\`
1666
-
1667
- ### Workflow 3: Release Management
1668
- \`\`\`javascript
1669
- // 1. Create release branch
1670
- { "tool": "git-branches", "params": { "action": "create", "branchName": "release/v2.0" }}
1671
-
1672
- // 2. Tag version
1673
- { "tool": "git-tags", "params": { "action": "create", "tagName": "v2.0.0" }}
1674
-
1675
- // 3. Create release
1676
- { "tool": "git-release", "params": { "action": "create", "tagName": "v2.0.0" }}
1677
- \`\`\`
1678
-
1679
- ---
1680
-
1681
- ## 🔍 Troubleshooting
1682
-
1683
- ### Issue: Username case-sensitivity
1684
- **Problem:** Gitea returns 404 errors
1685
- **Solution:** Ensure GITEA_USERNAME is lowercase
1686
-
1687
- ### Issue: Authentication failed
1688
- **Problem:** 401 errors
1689
- **Solution:** Verify tokens are valid and have correct permissions
1690
-
1691
- ### Issue: Remote not found
1692
- **Problem:** Remote operations fail
1693
- **Solution:** Check remote configuration with git-remote list
1694
-
1695
- ### Issue: Merge conflicts
1696
- **Problem:** Sync fails with conflicts
1697
- **Solution:** Use git-stash before syncing, then apply after
1698
-
1699
- ---
1700
-
1701
- ## 📚 Additional Resources
1702
-
1703
- - **GitHub API:** https://docs.github.com/en/rest
1704
- - **Gitea API:** https://docs.gitea.io/en-us/api-usage/
1705
- - **Git Documentation:** https://git-scm.com/doc
1706
- - **MCP Protocol:** https://modelcontextprotocol.io
1707
-
1708
- ---
1709
-
1710
- **Git-MCP v6.3.1** | Built with ❤️ for developers | 110+ Actions | 21 Tools | 3 Provider Types | NEW: git-fix migration tool
1711
- `
1712
- };
1713
- export default TOOLS_GUIDE;