@andrebuzeli/git-mcp 4.0.2 → 4.0.3
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.
- package/EXEMPLOS.md +861 -0
- package/INSTRUCOES.md +444 -0
- package/package.json +5 -3
package/EXEMPLOS.md
ADDED
|
@@ -0,0 +1,861 @@
|
|
|
1
|
+
# 🚀 EXEMPLOS PRÁTICOS - MCP Git AI Unification Server
|
|
2
|
+
|
|
3
|
+
## 📋 Casos de Uso Reais
|
|
4
|
+
|
|
5
|
+
### 1. Inicialização de Projeto Novo
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
// git-workflow init - Começar projeto do zero
|
|
9
|
+
{
|
|
10
|
+
"action": "init",
|
|
11
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
12
|
+
"message": "feat: Inicialização do projeto React com TypeScript"
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Resultado esperado:**
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"success": true,
|
|
20
|
+
"action": "init",
|
|
21
|
+
"message": "Projeto inicializado com sucesso - repositório criado, remotes configurados",
|
|
22
|
+
"autoDetected": {
|
|
23
|
+
"repo": "meu-app",
|
|
24
|
+
"owner": "johndoe",
|
|
25
|
+
"providers": ["gitea"]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Desenvolvimento Diário - Commit + Push
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
// git-workflow commit - Após implementar uma feature
|
|
34
|
+
{
|
|
35
|
+
"action": "commit",
|
|
36
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
37
|
+
"message": "feat: Implementar autenticação JWT\n\n- Adicionar middleware de validação\n- Criar endpoints /login e /register\n- Implementar refresh token\n- Adicionar testes unitários"
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 3. Sincronização Antes de Trabalhar
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
// git-workflow sync - Atualizar com mudanças do time
|
|
45
|
+
{
|
|
46
|
+
"action": "sync",
|
|
47
|
+
"projectPath": "C:\\projetos\\meu-app"
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 4. Verificar Status do Projeto
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
// git-workflow status - Overview completo
|
|
55
|
+
{
|
|
56
|
+
"action": "status",
|
|
57
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
58
|
+
"detailed": true
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Output inclui:**
|
|
63
|
+
- Status Git (modified, untracked, staged)
|
|
64
|
+
- Branches locais/remotas
|
|
65
|
+
- Últimos commits
|
|
66
|
+
- Status de sincronização com providers
|
|
67
|
+
|
|
68
|
+
### 5. Backup Estratégico
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
// git-workflow backup - Antes de mudanças arriscadas
|
|
72
|
+
{
|
|
73
|
+
"action": "backup",
|
|
74
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
75
|
+
"description": "Backup antes de refatoração da API"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 📁 Gerenciamento de Arquivos
|
|
82
|
+
|
|
83
|
+
### Criar Arquivo de Componente
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
// git-files write - Novo componente React
|
|
87
|
+
{
|
|
88
|
+
"action": "write",
|
|
89
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
90
|
+
"filePath": "src/components/LoginForm.tsx",
|
|
91
|
+
"content": "import React, { useState } from 'react';
|
|
92
|
+
|
|
93
|
+
interface LoginFormProps {
|
|
94
|
+
onLogin: (credentials: {email: string, password: string}) => void;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const LoginForm: React.FC<LoginFormProps> = ({ onLogin }) => {
|
|
98
|
+
const [email, setEmail] = useState('');
|
|
99
|
+
const [password, setPassword] = useState('');
|
|
100
|
+
|
|
101
|
+
const handleSubmit = (e: React.FormEvent) => {
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
onLogin({ email, password });
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<form onSubmit={handleSubmit}>
|
|
108
|
+
<input
|
|
109
|
+
type=\"email\"
|
|
110
|
+
value={email}
|
|
111
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
112
|
+
placeholder=\"Email\"
|
|
113
|
+
required
|
|
114
|
+
/>
|
|
115
|
+
<input
|
|
116
|
+
type=\"password\"
|
|
117
|
+
value={password}
|
|
118
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
119
|
+
placeholder=\"Senha\"
|
|
120
|
+
required
|
|
121
|
+
/>
|
|
122
|
+
<button type=\"submit\">Entrar</button>
|
|
123
|
+
</form>
|
|
124
|
+
);
|
|
125
|
+
};"
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Buscar Funções no Código
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
// git-files search - Encontrar todas as funções de validação
|
|
133
|
+
{
|
|
134
|
+
"action": "search",
|
|
135
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
136
|
+
"query": "function.*validate|const.*validate",
|
|
137
|
+
"path": "src",
|
|
138
|
+
"caseSensitive": false
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Backup de Arquivos de Configuração
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
// git-files backup-files - Salvar configs importantes
|
|
146
|
+
{
|
|
147
|
+
"action": "backup-files",
|
|
148
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
149
|
+
"patterns": ["*.json", "*.config.*", ".env*"],
|
|
150
|
+
"description": "Backup de arquivos de configuração"
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 🚀 Gerenciamento de Releases
|
|
157
|
+
|
|
158
|
+
### Release Patch (Correção de Bug)
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
// git-release create - Release automático de correção
|
|
162
|
+
{
|
|
163
|
+
"action": "create",
|
|
164
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
165
|
+
"changelog": true,
|
|
166
|
+
"notes": "Correção crítica no sistema de login",
|
|
167
|
+
"assets": ["dist/app.js", "dist/styles.css"]
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Output:**
|
|
172
|
+
- Versão automaticamente incrementada (ex: v1.2.3)
|
|
173
|
+
- Changelog gerado automaticamente
|
|
174
|
+
- Publicação em todos os providers configurados
|
|
175
|
+
|
|
176
|
+
### Bump de Versão Manual
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
// git-release version - Preparar para release major
|
|
180
|
+
{
|
|
181
|
+
"action": "version",
|
|
182
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
183
|
+
"type": "major"
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Rollback de Emergência
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
// git-release rollback - Reverter release problemático
|
|
191
|
+
{
|
|
192
|
+
"action": "rollback",
|
|
193
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
194
|
+
"createBackup": true
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 📊 Monitoramento e Analytics
|
|
201
|
+
|
|
202
|
+
### Status Completo do Projeto
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
// git-monitor status - Dashboard completo
|
|
206
|
+
{
|
|
207
|
+
"action": "status",
|
|
208
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
209
|
+
"includeMetrics": true,
|
|
210
|
+
"detailed": true
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Métricas incluídas:**
|
|
215
|
+
- Commits por dia/semana
|
|
216
|
+
- Arquivos modificados
|
|
217
|
+
- Branches ativas
|
|
218
|
+
- Tamanho do repositório
|
|
219
|
+
- Status de sincronização
|
|
220
|
+
|
|
221
|
+
### Análise de Produtividade
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
// git-monitor metrics - Métricas de desenvolvimento
|
|
225
|
+
{
|
|
226
|
+
"action": "metrics",
|
|
227
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
228
|
+
"period": "30d",
|
|
229
|
+
"includeCharts": true
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Check-up de Saúde
|
|
234
|
+
|
|
235
|
+
```json
|
|
236
|
+
// git-monitor health - Diagnóstico de problemas
|
|
237
|
+
{
|
|
238
|
+
"action": "health",
|
|
239
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
240
|
+
"deep": true,
|
|
241
|
+
"suggestions": true
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## 💾 Sistema de Backup
|
|
248
|
+
|
|
249
|
+
### Backup Completo
|
|
250
|
+
|
|
251
|
+
```json
|
|
252
|
+
// git-backup create - Backup full do projeto
|
|
253
|
+
{
|
|
254
|
+
"action": "create",
|
|
255
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
256
|
+
"type": "full",
|
|
257
|
+
"name": "backup-semanal",
|
|
258
|
+
"compress": true,
|
|
259
|
+
"includeUntracked": true
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Restauração Seletiva
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
// git-backup restore - Restaurar versão específica
|
|
267
|
+
{
|
|
268
|
+
"action": "restore",
|
|
269
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
270
|
+
"backupId": "backup-2025-09-25-full",
|
|
271
|
+
"preview": true,
|
|
272
|
+
"targetPath": "C:\\restauracao\\meu-app"
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Backup Automático
|
|
277
|
+
|
|
278
|
+
```json
|
|
279
|
+
// git-backup auto - Configurar backup diário
|
|
280
|
+
{
|
|
281
|
+
"action": "auto",
|
|
282
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
283
|
+
"enabled": true,
|
|
284
|
+
"schedule": "daily",
|
|
285
|
+
"retention": 30,
|
|
286
|
+
"maxBackups": 10
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 🌿 Gerenciamento de Branches
|
|
293
|
+
|
|
294
|
+
### Feature Branch Completo
|
|
295
|
+
|
|
296
|
+
```json
|
|
297
|
+
// 1. Criar feature branch
|
|
298
|
+
{
|
|
299
|
+
"action": "create",
|
|
300
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
301
|
+
"name": "feature/user-authentication"
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// 2. Trabalhar na feature (usar outras tools)
|
|
305
|
+
|
|
306
|
+
// 3. Comparar com main antes do merge
|
|
307
|
+
{
|
|
308
|
+
"action": "compare",
|
|
309
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
310
|
+
"base": "main",
|
|
311
|
+
"head": "feature/user-authentication",
|
|
312
|
+
"detailed": true
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// 4. Merge inteligente
|
|
316
|
+
{
|
|
317
|
+
"action": "merge",
|
|
318
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
319
|
+
"branch": "feature/user-authentication",
|
|
320
|
+
"strategy": "squash"
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// 5. Limpar branch
|
|
324
|
+
{
|
|
325
|
+
"action": "delete",
|
|
326
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
327
|
+
"name": "feature/user-authentication"
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Hotfix Urgente
|
|
332
|
+
|
|
333
|
+
```json
|
|
334
|
+
// Criar hotfix branch
|
|
335
|
+
{
|
|
336
|
+
"action": "create",
|
|
337
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
338
|
+
"name": "hotfix/critical-security-patch",
|
|
339
|
+
"from": "main"
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Implementar correção (usar git-files, git-workflow)
|
|
343
|
+
|
|
344
|
+
// Merge direto na main
|
|
345
|
+
{
|
|
346
|
+
"action": "switch",
|
|
347
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
348
|
+
"name": "main"
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
{
|
|
352
|
+
"action": "merge",
|
|
353
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
354
|
+
"branch": "hotfix/critical-security-patch",
|
|
355
|
+
"strategy": "merge"
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## 📝 Sistema de Issues Local
|
|
362
|
+
|
|
363
|
+
### Criar Issue Estruturada
|
|
364
|
+
|
|
365
|
+
```json
|
|
366
|
+
// git-issues create - Nova feature
|
|
367
|
+
{
|
|
368
|
+
"action": "create",
|
|
369
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
370
|
+
"title": "Implementar sistema de notificações push",
|
|
371
|
+
"description": "Adicionar notificações em tempo real para ações do usuário",
|
|
372
|
+
"labels": ["feature", "frontend", "backend"],
|
|
373
|
+
"priority": "high",
|
|
374
|
+
"assignee": "johndoe",
|
|
375
|
+
"dueDate": "2025-10-15"
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Auto-detecção de TODOs
|
|
380
|
+
|
|
381
|
+
```json
|
|
382
|
+
// git-issues scan - Converter TODOs em issues
|
|
383
|
+
{
|
|
384
|
+
"action": "scan",
|
|
385
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
386
|
+
"createIssues": true,
|
|
387
|
+
"patterns": ["TODO", "FIXME", "HACK", "XXX"]
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Converte automaticamente:**
|
|
392
|
+
```javascript
|
|
393
|
+
// TODO: Implementar validação de email
|
|
394
|
+
// FIXME: Corrigir bug no login mobile
|
|
395
|
+
```
|
|
396
|
+
**Em issues estruturadas com:**
|
|
397
|
+
- Título extraído do comentário
|
|
398
|
+
- Prioridade baseada no tipo (TODO=medium, FIXME=high)
|
|
399
|
+
- Localização do arquivo
|
|
400
|
+
- Labels apropriadas
|
|
401
|
+
|
|
402
|
+
### Gerenciamento de Sprint
|
|
403
|
+
|
|
404
|
+
```json
|
|
405
|
+
// Listar issues da sprint atual
|
|
406
|
+
{
|
|
407
|
+
"action": "list",
|
|
408
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
409
|
+
"state": "open",
|
|
410
|
+
"sort": "priority",
|
|
411
|
+
"limit": 20
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Atualizar progresso
|
|
415
|
+
{
|
|
416
|
+
"action": "update",
|
|
417
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
418
|
+
"id": "ISSUE-123",
|
|
419
|
+
"status": "in_progress"
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// Fechar issue completa
|
|
423
|
+
{
|
|
424
|
+
"action": "close",
|
|
425
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
426
|
+
"id": "ISSUE-123",
|
|
427
|
+
"comment": "Implementação concluída com testes unitários"
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## 🏷️ Gerenciamento de Tags
|
|
434
|
+
|
|
435
|
+
### Versionamento Semântico
|
|
436
|
+
|
|
437
|
+
```json
|
|
438
|
+
// Tag de release
|
|
439
|
+
{
|
|
440
|
+
"action": "create",
|
|
441
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
442
|
+
"name": "v2.1.0",
|
|
443
|
+
"message": "Release v2.1.0 - Sistema de notificações\n\nFeatures:\n- Notificações push em tempo real\n- Configurações de preferências\n- Suporte a múltiplos idiomas\n\nBugfixes:\n- Correção de memory leak\n- Validação de formulários aprimorada",
|
|
444
|
+
"type": "annotated"
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// Tag de pré-release
|
|
448
|
+
{
|
|
449
|
+
"action": "create",
|
|
450
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
451
|
+
"name": "v2.1.0-beta.1",
|
|
452
|
+
"message": "Beta release para testes",
|
|
453
|
+
"type": "annotated"
|
|
454
|
+
}
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### Busca de Tags
|
|
458
|
+
|
|
459
|
+
```json
|
|
460
|
+
// Encontrar releases de produção
|
|
461
|
+
{
|
|
462
|
+
"action": "search",
|
|
463
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
464
|
+
"query": "^v\\d+\\.\\d+\\.\\d+$",
|
|
465
|
+
"sort": "version"
|
|
466
|
+
}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## 💾 Gerenciamento de Stash
|
|
472
|
+
|
|
473
|
+
### Work in Progress (WIP)
|
|
474
|
+
|
|
475
|
+
```json
|
|
476
|
+
// Salvar trabalho em andamento
|
|
477
|
+
{
|
|
478
|
+
"action": "save",
|
|
479
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
480
|
+
"message": "WIP: Refatoração da API de usuários",
|
|
481
|
+
"includeUntracked": true,
|
|
482
|
+
"keepIndex": true
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Ver stashes disponíveis
|
|
486
|
+
{
|
|
487
|
+
"action": "list",
|
|
488
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
489
|
+
"detailed": true
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// Aplicar stash específico
|
|
493
|
+
{
|
|
494
|
+
"action": "apply",
|
|
495
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
496
|
+
"index": "1"
|
|
497
|
+
}
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
### Context Switching
|
|
501
|
+
|
|
502
|
+
```json
|
|
503
|
+
// Salvar contexto atual
|
|
504
|
+
{
|
|
505
|
+
"action": "save",
|
|
506
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
507
|
+
"message": "Context: Implementação do dashboard"
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// Mudar para hotfix urgente
|
|
511
|
+
// ... trabalhar no hotfix ...
|
|
512
|
+
|
|
513
|
+
// Retornar ao contexto anterior
|
|
514
|
+
{
|
|
515
|
+
"action": "pop",
|
|
516
|
+
"projectPath": "C:\\projetos\\meu-app"
|
|
517
|
+
}
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
## 🔧 Configuração e Remotos
|
|
523
|
+
|
|
524
|
+
### Setup Inicial de Remotos
|
|
525
|
+
|
|
526
|
+
```json
|
|
527
|
+
// Adicionar remote do Gitea
|
|
528
|
+
{
|
|
529
|
+
"action": "add",
|
|
530
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
531
|
+
"name": "origin",
|
|
532
|
+
"url": "https://gitea.example.com/johndoe/meu-app.git",
|
|
533
|
+
"provider": "gitea"
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Adicionar backup no GitHub
|
|
537
|
+
{
|
|
538
|
+
"action": "add",
|
|
539
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
540
|
+
"name": "github",
|
|
541
|
+
"url": "https://github.com/johndoe/meu-app.git",
|
|
542
|
+
"provider": "github"
|
|
543
|
+
}
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### Sincronização Multi-Provider
|
|
547
|
+
|
|
548
|
+
```json
|
|
549
|
+
// Verificar status de todos os remotos
|
|
550
|
+
{
|
|
551
|
+
"action": "show",
|
|
552
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
553
|
+
"detailed": true
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// Limpar referências obsoletas
|
|
557
|
+
{
|
|
558
|
+
"action": "prune",
|
|
559
|
+
"projectPath": "C:\\projetos\\meu-app"
|
|
560
|
+
}
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
## 🚨 Tratamento de Erros e Recovery
|
|
566
|
+
|
|
567
|
+
### Exemplo de Auto-Recovery
|
|
568
|
+
|
|
569
|
+
```json
|
|
570
|
+
// Request que pode falhar
|
|
571
|
+
{
|
|
572
|
+
"action": "commit",
|
|
573
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
574
|
+
"message": "feat: Nova funcionalidade"
|
|
575
|
+
}
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
**Response com erro e sugestão:**
|
|
579
|
+
```json
|
|
580
|
+
{
|
|
581
|
+
"success": false,
|
|
582
|
+
"action": "commit",
|
|
583
|
+
"message": "Falha no commit",
|
|
584
|
+
"error": {
|
|
585
|
+
"code": "GIT_PUSH_FAILED",
|
|
586
|
+
"message": "Não foi possível fazer push para o remote",
|
|
587
|
+
"cause": "Remote 'origin' não encontrado ou sem permissão",
|
|
588
|
+
"suggestion": "Execute 'git remote add origin <url>' ou verifique as credenciais"
|
|
589
|
+
},
|
|
590
|
+
"autoDetected": {
|
|
591
|
+
"repo": "meu-app",
|
|
592
|
+
"owner": "johndoe",
|
|
593
|
+
"providers": []
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
### Recovery Automático
|
|
599
|
+
|
|
600
|
+
```json
|
|
601
|
+
// Sistema tenta corrigir automaticamente
|
|
602
|
+
{
|
|
603
|
+
"action": "sync",
|
|
604
|
+
"projectPath": "C:\\projetos\\meu-app"
|
|
605
|
+
}
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
**Output:**
|
|
609
|
+
- Detecta problema
|
|
610
|
+
- Tenta `git pull --rebase`
|
|
611
|
+
- Se falhar, sugere resolução manual
|
|
612
|
+
- Backup automático antes de operações arriscadas
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
## 🎯 Workflows Completos
|
|
617
|
+
|
|
618
|
+
### Workflow de Desenvolvimento Diário
|
|
619
|
+
|
|
620
|
+
```json
|
|
621
|
+
// 1. Sincronizar com time
|
|
622
|
+
{
|
|
623
|
+
"action": "sync",
|
|
624
|
+
"projectPath": "C:\\projetos\\meu-app"
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// 2. Ver status
|
|
628
|
+
{
|
|
629
|
+
"action": "status",
|
|
630
|
+
"projectPath": "C:\\projetos\\meu-app"
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// 3. Criar feature branch
|
|
634
|
+
{
|
|
635
|
+
"action": "create",
|
|
636
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
637
|
+
"name": "feature/dark-mode"
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// 4. Implementar (usar git-files, etc.)
|
|
641
|
+
|
|
642
|
+
// 5. Commit progressivo
|
|
643
|
+
{
|
|
644
|
+
"action": "commit",
|
|
645
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
646
|
+
"message": "feat: Implementar tema dark\n\n- Adicionar variáveis CSS\n- Toggle component\n- Persistir preferência"
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// 6. Verificar qualidade
|
|
650
|
+
{
|
|
651
|
+
"action": "health",
|
|
652
|
+
"projectPath": "C:\\projetos\\meu-app"
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// 7. Merge na main
|
|
656
|
+
{
|
|
657
|
+
"action": "merge",
|
|
658
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
659
|
+
"branch": "feature/dark-mode"
|
|
660
|
+
}
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
### Workflow de Release
|
|
664
|
+
|
|
665
|
+
```json
|
|
666
|
+
// 1. Verificar saúde pré-release
|
|
667
|
+
{
|
|
668
|
+
"action": "health",
|
|
669
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
670
|
+
"deep": true
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
// 2. Backup estratégico
|
|
674
|
+
{
|
|
675
|
+
"action": "backup",
|
|
676
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
677
|
+
"description": "Backup pré-release v2.0.0"
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
// 3. Bump versão
|
|
681
|
+
{
|
|
682
|
+
"action": "version",
|
|
683
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
684
|
+
"type": "minor"
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// 4. Release completo
|
|
688
|
+
{
|
|
689
|
+
"action": "create",
|
|
690
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
691
|
+
"changelog": true,
|
|
692
|
+
"notes": "Major release com redesign completo",
|
|
693
|
+
"assets": ["dist/bundle.js", "dist/styles.css"]
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
// 5. Tag de versão
|
|
697
|
+
{
|
|
698
|
+
"action": "create",
|
|
699
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
700
|
+
"name": "v2.0.0",
|
|
701
|
+
"type": "annotated",
|
|
702
|
+
"message": "Release v2.0.0 - Redesign completo da interface"
|
|
703
|
+
}
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
### Workflow de Troubleshooting
|
|
707
|
+
|
|
708
|
+
```json
|
|
709
|
+
// 1. Diagnosticar problema
|
|
710
|
+
{
|
|
711
|
+
"action": "status",
|
|
712
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
713
|
+
"detailed": true
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
// 2. Verificar saúde
|
|
717
|
+
{
|
|
718
|
+
"action": "health",
|
|
719
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
720
|
+
"suggestions": true
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// 3. Backup antes de mudanças
|
|
724
|
+
{
|
|
725
|
+
"action": "backup",
|
|
726
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
727
|
+
"description": "Backup antes de troubleshooting"
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
// 4. Reset se necessário
|
|
731
|
+
{
|
|
732
|
+
"action": "reset-to-commit",
|
|
733
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
734
|
+
"commit": "HEAD~1",
|
|
735
|
+
"type": "mixed"
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// 5. Limpar stashes se houver
|
|
739
|
+
{
|
|
740
|
+
"action": "clear",
|
|
741
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
742
|
+
"confirm": true
|
|
743
|
+
}
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
---
|
|
747
|
+
|
|
748
|
+
## 🔧 Configurações Avançadas
|
|
749
|
+
|
|
750
|
+
### Ambiente de Desenvolvimento
|
|
751
|
+
|
|
752
|
+
```bash
|
|
753
|
+
# .env file
|
|
754
|
+
GITEA_USERNAME=developer
|
|
755
|
+
GITEA_TOKEN=your_personal_token
|
|
756
|
+
GITEA_URL=https://gitea.company.com
|
|
757
|
+
|
|
758
|
+
GITHUB_USERNAME=developer
|
|
759
|
+
GITHUB_TOKEN=your_github_token
|
|
760
|
+
|
|
761
|
+
# Optional
|
|
762
|
+
DEMO_MODE=false
|
|
763
|
+
LOG_LEVEL=debug
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
### Configuração Multi-Projeto
|
|
767
|
+
|
|
768
|
+
```json
|
|
769
|
+
// Para projetos diferentes, apenas mude o projectPath
|
|
770
|
+
{
|
|
771
|
+
"action": "status",
|
|
772
|
+
"projectPath": "C:\\projetos\\api-backend"
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
{
|
|
776
|
+
"action": "status",
|
|
777
|
+
"projectPath": "C:\\projetos\\web-frontend"
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
{
|
|
781
|
+
"action": "status",
|
|
782
|
+
"projectPath": "C:\\projetos\\mobile-app"
|
|
783
|
+
}
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
---
|
|
787
|
+
|
|
788
|
+
## 💡 Dicas e Boas Práticas
|
|
789
|
+
|
|
790
|
+
### 1. Commits Atômicos
|
|
791
|
+
```json
|
|
792
|
+
// ❌ Ruim
|
|
793
|
+
{
|
|
794
|
+
"action": "commit",
|
|
795
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
796
|
+
"message": "Update"
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// ✅ Bom
|
|
800
|
+
{
|
|
801
|
+
"action": "commit",
|
|
802
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
803
|
+
"message": "feat: Adicionar validação de formulário\n\n- Campo email obrigatório\n- Validação de formato\n- Mensagens de erro localizadas\n- Testes unitários incluídos"
|
|
804
|
+
}
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
### 2. Branches por Feature
|
|
808
|
+
```json
|
|
809
|
+
{
|
|
810
|
+
"action": "create",
|
|
811
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
812
|
+
"name": "feature/user-profile-page"
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
{
|
|
816
|
+
"action": "create",
|
|
817
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
818
|
+
"name": "bugfix/login-validation"
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
{
|
|
822
|
+
"action": "create",
|
|
823
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
824
|
+
"name": "refactor/api-cleanup"
|
|
825
|
+
}
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
### 3. Backups Estratégicos
|
|
829
|
+
```json
|
|
830
|
+
// Antes de mudanças arriscadas
|
|
831
|
+
{
|
|
832
|
+
"action": "backup",
|
|
833
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
834
|
+
"description": "Antes de refatoração da arquitetura"
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
// Backups automáticos
|
|
838
|
+
{
|
|
839
|
+
"action": "auto",
|
|
840
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
841
|
+
"enabled": true,
|
|
842
|
+
"schedule": "commit"
|
|
843
|
+
}
|
|
844
|
+
```
|
|
845
|
+
|
|
846
|
+
### 4. Monitoramento Contínuo
|
|
847
|
+
```json
|
|
848
|
+
// Status diário
|
|
849
|
+
{
|
|
850
|
+
"action": "metrics",
|
|
851
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
852
|
+
"period": "7d"
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// Health checks
|
|
856
|
+
{
|
|
857
|
+
"action": "health",
|
|
858
|
+
"projectPath": "C:\\projetos\\meu-app",
|
|
859
|
+
"suggestions": true
|
|
860
|
+
}
|
|
861
|
+
```
|
package/INSTRUCOES.md
ADDED
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
# 📖 INSTRUÇÕES DE USO - MCP Git AI Unification Server
|
|
2
|
+
|
|
3
|
+
## 🎯 Visão Geral
|
|
4
|
+
|
|
5
|
+
Sistema unificado de 18 ferramentas Git otimizadas para agentes de IA, com auto-detecção universal e zero-configuração.
|
|
6
|
+
|
|
7
|
+
## 📋 Formato Universal de Request
|
|
8
|
+
|
|
9
|
+
Todas as ferramentas seguem o mesmo padrão:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"action": "nome_da_action",
|
|
14
|
+
"projectPath": "/caminho/absoluto/do/projeto"
|
|
15
|
+
// outros parâmetros específicos da action
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 🛠️ Ferramentas Disponíveis
|
|
20
|
+
|
|
21
|
+
### 1. git-workflow (Workflow Principal)
|
|
22
|
+
**Responsável:** Operações essenciais de Git em workflow completo
|
|
23
|
+
|
|
24
|
+
#### Actions Disponíveis:
|
|
25
|
+
|
|
26
|
+
**`init`** - Inicialização completa do projeto
|
|
27
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
28
|
+
- **Parâmetros opcionais:** `message` (mensagem inicial do commit)
|
|
29
|
+
- **Funcionalidade:** Cria repositório, configura remotes, faz commit inicial
|
|
30
|
+
|
|
31
|
+
**`commit`** - Commit com push automático
|
|
32
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `message`
|
|
33
|
+
- **Funcionalidade:** Add automático + commit + push para todos os providers
|
|
34
|
+
|
|
35
|
+
**`sync`** - Sincronização completa
|
|
36
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
37
|
+
- **Parâmetros opcionais:** `message` (se houver mudanças locais)
|
|
38
|
+
- **Funcionalidade:** Pull de todos + commit opcional + push para todos
|
|
39
|
+
|
|
40
|
+
**`status`** - Status completo do projeto
|
|
41
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
42
|
+
- **Parâmetros opcionais:** `detailed` (boolean, default: false)
|
|
43
|
+
- **Funcionalidade:** Status Git + multi-provider + métricas
|
|
44
|
+
|
|
45
|
+
**`backup`** - Backup completo do estado atual
|
|
46
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
47
|
+
- **Parâmetros opcionais:** `description` (descrição do backup)
|
|
48
|
+
- **Funcionalidade:** Commit + push para todos os providers
|
|
49
|
+
|
|
50
|
+
### 2. git-files (Gerenciamento Inteligente de Arquivos)
|
|
51
|
+
**Responsável:** Operações de arquivo com backup automático
|
|
52
|
+
|
|
53
|
+
#### Actions Disponíveis:
|
|
54
|
+
|
|
55
|
+
**`read`** - Leitura de arquivos
|
|
56
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `filePath`
|
|
57
|
+
- **Funcionalidade:** Lê conteúdo, metadados e encoding
|
|
58
|
+
|
|
59
|
+
**`write`** - Escrita com backup automático
|
|
60
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `filePath`, `content`
|
|
61
|
+
- **Funcionalidade:** Escreve arquivo + commit automático + push
|
|
62
|
+
|
|
63
|
+
**`search`** - Busca eficiente no código
|
|
64
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `query`
|
|
65
|
+
- **Parâmetros opcionais:** `path` (diretório específico), `caseSensitive` (boolean), `patterns` (array de glob patterns)
|
|
66
|
+
- **Funcionalidade:** Busca em arquivos .js, .ts, .json, .md
|
|
67
|
+
|
|
68
|
+
**`update`** - Atualização com versionamento
|
|
69
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `filePath`, `content`
|
|
70
|
+
- **Funcionalidade:** Atualiza arquivo + backup automático
|
|
71
|
+
|
|
72
|
+
**`backup-files`** - Backup seletivo de arquivos
|
|
73
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
74
|
+
- **Parâmetros opcionais:** `patterns` (array de padrões glob), `description`
|
|
75
|
+
- **Funcionalidade:** Backup de arquivos específicos + commit
|
|
76
|
+
|
|
77
|
+
### 3. git-release (Automação de Releases)
|
|
78
|
+
**Responsável:** Versionamento semântico e publicação
|
|
79
|
+
|
|
80
|
+
#### Actions Disponíveis:
|
|
81
|
+
|
|
82
|
+
**`create`** - Release automático
|
|
83
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
84
|
+
- **Parâmetros opcionais:** `version`, `changelog`, `draft`, `prerelease`, `assets`, `notes`
|
|
85
|
+
- **Funcionalidade:** Auto-versioning + changelog + multi-provider publish
|
|
86
|
+
|
|
87
|
+
**`version`** - Controle de versão
|
|
88
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
89
|
+
- **Parâmetros opcionais:** `type` ("patch"/"minor"/"major")
|
|
90
|
+
- **Funcionalidade:** Bump automático de versão semântica
|
|
91
|
+
|
|
92
|
+
**`publish`** - Publicação de release
|
|
93
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
94
|
+
- **Parâmetros opcionais:** `providers` (array específico)
|
|
95
|
+
- **Funcionalidade:** Publicação em múltiplos providers
|
|
96
|
+
|
|
97
|
+
**`history`** - Histórico de releases
|
|
98
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
99
|
+
- **Parâmetros opcionais:** `limit`, `includeDrafts`
|
|
100
|
+
- **Funcionalidade:** Lista completa de releases
|
|
101
|
+
|
|
102
|
+
**`rollback`** - Rollback seguro
|
|
103
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
104
|
+
- **Parâmetros opcionais:** `createBackup`
|
|
105
|
+
- **Funcionalidade:** Reverte release com backup automático
|
|
106
|
+
|
|
107
|
+
### 4. git-monitor (Monitoramento e Analytics)
|
|
108
|
+
**Responsável:** Métricas e monitoramento de projeto
|
|
109
|
+
|
|
110
|
+
#### Actions Disponíveis:
|
|
111
|
+
|
|
112
|
+
**`status`** - Status detalhado
|
|
113
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
114
|
+
- **Parâmetros opcionais:** `includeMetrics`, `detailed`
|
|
115
|
+
- **Funcionalidade:** Status completo + métricas
|
|
116
|
+
|
|
117
|
+
**`history`** - Histórico de atividades
|
|
118
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
119
|
+
- **Parâmetros opcionais:** `since` (período), `limit`, `type`
|
|
120
|
+
- **Funcionalidade:** Timeline de atividades
|
|
121
|
+
|
|
122
|
+
**`metrics`** - Métricas de produtividade
|
|
123
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
124
|
+
- **Parâmetros opcionais:** `period` ("1d"/"7d"/"30d"/"90d"), `includeCharts`
|
|
125
|
+
- **Funcionalidade:** Estatísticas de desenvolvimento
|
|
126
|
+
|
|
127
|
+
**`health`** - Análise de saúde
|
|
128
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
129
|
+
- **Parâmetros opcionais:** `deep`, `suggestions`
|
|
130
|
+
- **Funcionalidade:** Diagnóstico de problemas
|
|
131
|
+
|
|
132
|
+
**`activity`** - Atividade recente
|
|
133
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
134
|
+
- **Parâmetros opcionais:** `hours`, `includeRemote`
|
|
135
|
+
- **Funcionalidade:** Atividade em tempo real
|
|
136
|
+
|
|
137
|
+
### 5. git-backup (Sistema de Backup Completo)
|
|
138
|
+
**Responsável:** Backups incrementais e restauração
|
|
139
|
+
|
|
140
|
+
#### Actions Disponíveis:
|
|
141
|
+
|
|
142
|
+
**`create`** - Criar backup
|
|
143
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
144
|
+
- **Parâmetros opcionais:** `type` ("full"/"incremental"/"checkpoint"), `name`, `includeUntracked`, `compress`
|
|
145
|
+
- **Funcionalidade:** Backup inteligente do estado atual
|
|
146
|
+
|
|
147
|
+
**`restore`** - Restaurar backup
|
|
148
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `backupId`
|
|
149
|
+
- **Parâmetros opcionais:** `preview`, `force`, `targetPath`
|
|
150
|
+
- **Funcionalidade:** Restauração granular
|
|
151
|
+
|
|
152
|
+
**`list`** - Listar backups
|
|
153
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
154
|
+
- **Parâmetros opcionais:** `filter`, `limit`, `sortBy`
|
|
155
|
+
- **Funcionalidade:** Gerenciamento de backups
|
|
156
|
+
|
|
157
|
+
**`auto`** - Backup automático
|
|
158
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
159
|
+
- **Parâmetros opcionais:** `enabled`, `schedule`, `retention`, `maxBackups`
|
|
160
|
+
- **Funcionalidade:** Configuração de backup automático
|
|
161
|
+
|
|
162
|
+
**`verify`** - Verificação de integridade
|
|
163
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `backupId`
|
|
164
|
+
- **Parâmetros opcionais:** `deep`
|
|
165
|
+
- **Funcionalidade:** Validação de backups
|
|
166
|
+
|
|
167
|
+
### 6. git-branches (Gerenciamento de Branches)
|
|
168
|
+
**Responsável:** Branches com sincronização multi-provider
|
|
169
|
+
|
|
170
|
+
#### Actions Disponíveis:
|
|
171
|
+
|
|
172
|
+
**`create`** - Criar branch
|
|
173
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `name`
|
|
174
|
+
- **Parâmetros opcionais:** `from` (branch base)
|
|
175
|
+
- **Funcionalidade:** Criação + push automático
|
|
176
|
+
|
|
177
|
+
**`list`** - Listar branches
|
|
178
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
179
|
+
- **Parâmetros opcionais:** `remote` (incluir remotas)
|
|
180
|
+
- **Funcionalidade:** Local + remoto
|
|
181
|
+
|
|
182
|
+
**`switch`** - Trocar branch
|
|
183
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `name`
|
|
184
|
+
- **Parâmetros opcionais:** `create` (criar se não existir)
|
|
185
|
+
- **Funcionalidade:** Troca segura
|
|
186
|
+
|
|
187
|
+
**`delete`** - Remover branch
|
|
188
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `name`
|
|
189
|
+
- **Parâmetros opcionais:** `force`
|
|
190
|
+
- **Funcionalidade:** Local e remoto
|
|
191
|
+
|
|
192
|
+
**`merge`** - Merge inteligente
|
|
193
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `branch`
|
|
194
|
+
- **Parâmetros opcionais:** `strategy` ("merge"/"rebase"/"squash"), `noCommit`
|
|
195
|
+
- **Funcionalidade:** Merge com resolução automática
|
|
196
|
+
|
|
197
|
+
**`compare`** - Comparação entre branches
|
|
198
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `base`, `head`
|
|
199
|
+
- **Parâmetros opcionais:** `detailed`
|
|
200
|
+
- **Funcionalidade:** Diff detalhado
|
|
201
|
+
|
|
202
|
+
### 7. git-remote (Gerenciamento de Remotos)
|
|
203
|
+
**Responsável:** Configuração e gerenciamento de remotos
|
|
204
|
+
|
|
205
|
+
#### Actions Disponíveis:
|
|
206
|
+
|
|
207
|
+
**`add`** - Adicionar remote
|
|
208
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `name`, `url`
|
|
209
|
+
- **Parâmetros opcionais:** `provider`
|
|
210
|
+
- **Funcionalidade:** Auto-detecção de provider
|
|
211
|
+
|
|
212
|
+
**`remove`** - Remover remote
|
|
213
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `name`
|
|
214
|
+
- **Parâmetros opcionais:** `force`
|
|
215
|
+
- **Funcionalidade:** Remoção segura
|
|
216
|
+
|
|
217
|
+
**`rename`** - Renomear remote
|
|
218
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `oldName`, `newName`
|
|
219
|
+
- **Funcionalidade:** Renomeação completa
|
|
220
|
+
|
|
221
|
+
**`show`** - Mostrar informações
|
|
222
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
223
|
+
- **Parâmetros opcionais:** `detailed`
|
|
224
|
+
- **Funcionalidade:** Status detalhado
|
|
225
|
+
|
|
226
|
+
**`set-url`** - Atualizar URL
|
|
227
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `name`, `url`
|
|
228
|
+
- **Parâmetros opcionais:** `push`
|
|
229
|
+
- **Funcionalidade:** URL específica para push
|
|
230
|
+
|
|
231
|
+
**`prune`** - Limpeza de referências
|
|
232
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
233
|
+
- **Funcionalidade:** Remove referências obsoletas
|
|
234
|
+
|
|
235
|
+
### 8. git-stash (Gerenciamento de Stash)
|
|
236
|
+
**Responsável:** Salvamento temporário de mudanças
|
|
237
|
+
|
|
238
|
+
#### Actions Disponíveis:
|
|
239
|
+
|
|
240
|
+
**`save`** - Salvar stash
|
|
241
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
242
|
+
- **Parâmetros opcionais:** `message`, `includeUntracked`, `keepIndex`
|
|
243
|
+
- **Funcionalidade:** Auto-naming inteligente
|
|
244
|
+
|
|
245
|
+
**`pop`** - Aplicar e remover
|
|
246
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
247
|
+
- **Parâmetros opcionais:** `index`
|
|
248
|
+
- **Funcionalidade:** Aplicação + remoção
|
|
249
|
+
|
|
250
|
+
**`apply`** - Aplicar sem remover
|
|
251
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
252
|
+
- **Parâmetros opcionais:** `index`
|
|
253
|
+
- **Funcionalidade:** Aplicação apenas
|
|
254
|
+
|
|
255
|
+
**`list`** - Listar stashes
|
|
256
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
257
|
+
- **Parâmetros opcionais:** `detailed`, `filter`
|
|
258
|
+
- **Funcionalidade:** Gerenciamento completo
|
|
259
|
+
|
|
260
|
+
**`show`** - Mostrar detalhes
|
|
261
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `index`
|
|
262
|
+
- **Parâmetros opcionais:** `patch`
|
|
263
|
+
- **Funcionalidade:** Conteúdo detalhado
|
|
264
|
+
|
|
265
|
+
**`drop`** - Remover stash
|
|
266
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `index`
|
|
267
|
+
- **Funcionalidade:** Remoção específica
|
|
268
|
+
|
|
269
|
+
**`clear`** - Limpar todos
|
|
270
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
271
|
+
- **Parâmetros opcionais:** `confirm`
|
|
272
|
+
- **Funcionalidade:** Limpeza completa
|
|
273
|
+
|
|
274
|
+
### 9. git-reset (Reset Seguro)
|
|
275
|
+
**Responsável:** Operações de reset controladas
|
|
276
|
+
|
|
277
|
+
#### Actions Disponíveis:
|
|
278
|
+
|
|
279
|
+
**`soft`** - Reset soft
|
|
280
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `commit`
|
|
281
|
+
- **Funcionalidade:** Mantém staging area
|
|
282
|
+
|
|
283
|
+
**`mixed`** - Reset mixed
|
|
284
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `commit`
|
|
285
|
+
- **Funcionalidade:** Limpa staging, preserva working
|
|
286
|
+
|
|
287
|
+
**`hard`** - Reset hard
|
|
288
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `commit`
|
|
289
|
+
- **Parâmetros opcionais:** `confirm`
|
|
290
|
+
- **Funcionalidade:** Remove tudo
|
|
291
|
+
|
|
292
|
+
**`reset-to-commit`** - Reset específico
|
|
293
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `commit`
|
|
294
|
+
- **Parâmetros opcionais:** `type` ("soft"/"mixed"/"hard")
|
|
295
|
+
- **Funcionalidade:** Reset para commit específico
|
|
296
|
+
|
|
297
|
+
**`reset-branch`** - Reset de branch
|
|
298
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `branch`
|
|
299
|
+
- **Parâmetros opcionais:** `target`, `type`
|
|
300
|
+
- **Funcionalidade:** Reset de branch específica
|
|
301
|
+
|
|
302
|
+
### 10. git-tags (Gerenciamento de Tags)
|
|
303
|
+
**Responsável:** Versionamento com tags semânticas
|
|
304
|
+
|
|
305
|
+
#### Actions Disponíveis:
|
|
306
|
+
|
|
307
|
+
**`create`** - Criar tag
|
|
308
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `name`
|
|
309
|
+
- **Parâmetros opcionais:** `message`, `target`, `type` ("lightweight"/"annotated")
|
|
310
|
+
- **Funcionalidade:** Auto-detecção de tipo
|
|
311
|
+
|
|
312
|
+
**`list`** - Listar tags
|
|
313
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
314
|
+
- **Parâmetros opcionais:** `pattern`, `sort`, `limit`
|
|
315
|
+
- **Funcionalidade:** Filtragem avançada
|
|
316
|
+
|
|
317
|
+
**`get`** - Detalhes da tag
|
|
318
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `name`
|
|
319
|
+
- **Parâmetros opcionais:** `detailed`
|
|
320
|
+
- **Funcionalidade:** Informações completas
|
|
321
|
+
|
|
322
|
+
**`delete`** - Remover tag
|
|
323
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `name`
|
|
324
|
+
- **Parâmetros opcionais:** `remote`, `force`
|
|
325
|
+
- **Funcionalidade:** Local e remoto
|
|
326
|
+
|
|
327
|
+
**`search`** - Busca de tags
|
|
328
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
329
|
+
- **Parâmetros opcionais:** `query`, `pattern`
|
|
330
|
+
- **Funcionalidade:** Busca avançada
|
|
331
|
+
|
|
332
|
+
### 11. git-issues (Sistema de Issues Local)
|
|
333
|
+
**Responsável:** Gerenciamento de tarefas locais
|
|
334
|
+
|
|
335
|
+
#### Actions Disponíveis:
|
|
336
|
+
|
|
337
|
+
**`create`** - Criar issue
|
|
338
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `title`
|
|
339
|
+
- **Parâmetros opcionais:** `description`, `labels`, `priority`, `assignee`, `dueDate`
|
|
340
|
+
- **Funcionalidade:** Issue estruturada
|
|
341
|
+
|
|
342
|
+
**`list`** - Listar issues
|
|
343
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
344
|
+
- **Parâmetros opcionais:** `state`, `limit`, `sort`
|
|
345
|
+
- **Funcionalidade:** Filtragem completa
|
|
346
|
+
|
|
347
|
+
**`get`** - Detalhes da issue
|
|
348
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `id`
|
|
349
|
+
- **Parâmetros opcionais:** `detailed`
|
|
350
|
+
- **Funcionalidade:** Informações completas
|
|
351
|
+
|
|
352
|
+
**`update`** - Atualizar issue
|
|
353
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `id`
|
|
354
|
+
- **Parâmetros opcionais:** `title`, `description`, `status`, `priority`, etc.
|
|
355
|
+
- **Funcionalidade:** Modificação completa
|
|
356
|
+
|
|
357
|
+
**`close`** - Fechar issue
|
|
358
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `id`
|
|
359
|
+
- **Parâmetros opcionais:** `comment`
|
|
360
|
+
- **Funcionalidade:** Fechamento com comentário
|
|
361
|
+
|
|
362
|
+
**`scan`** - Auto-detecção de TODOs
|
|
363
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
364
|
+
- **Parâmetros opcionais:** `createIssues`, `patterns`
|
|
365
|
+
- **Funcionalidade:** Converte TODO/FIXME em issues
|
|
366
|
+
|
|
367
|
+
### 12. git-pulls (Pull Requests Locais)
|
|
368
|
+
**Responsável:** Sistema básico de pull requests
|
|
369
|
+
|
|
370
|
+
#### Actions Disponíveis:
|
|
371
|
+
|
|
372
|
+
**`create`** - Criar PR
|
|
373
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `title`, `head`, `base`
|
|
374
|
+
- **Funcionalidade:** PR local básico
|
|
375
|
+
|
|
376
|
+
**`list`** - Listar PRs
|
|
377
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`
|
|
378
|
+
- **Funcionalidade:** PRs locais
|
|
379
|
+
|
|
380
|
+
**`merge`** - Merge PR
|
|
381
|
+
- **Parâmetros obrigatórios:** `action`, `projectPath`, `number`
|
|
382
|
+
- **Funcionalidade:** Merge básico
|
|
383
|
+
|
|
384
|
+
### 13-18. Ferramentas Especializadas (Placeholders)
|
|
385
|
+
|
|
386
|
+
**git-analytics, git-archive, git-packages, git-sync, git-repos, git-config**
|
|
387
|
+
- Status: Implementação básica disponível
|
|
388
|
+
- Funcionalidade: Estrutura pronta para expansão
|
|
389
|
+
- Parâmetros: Seguem padrão universal
|
|
390
|
+
|
|
391
|
+
## ⚙️ Configuração de Ambiente
|
|
392
|
+
|
|
393
|
+
### Variáveis Obrigatórias:
|
|
394
|
+
```bash
|
|
395
|
+
GITEA_USERNAME=seu_usuario
|
|
396
|
+
GITEA_TOKEN=seu_token_gitea
|
|
397
|
+
GITEA_URL=https://seu-gitea.com
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### Variáveis Opcionais:
|
|
401
|
+
```bash
|
|
402
|
+
GITHUB_USERNAME=seu_usuario_github
|
|
403
|
+
GITHUB_TOKEN=seu_token_github
|
|
404
|
+
DEMO_MODE=true # Para testes
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## 📊 Formato de Response Universal
|
|
408
|
+
|
|
409
|
+
Todas as ferramentas retornam:
|
|
410
|
+
|
|
411
|
+
```json
|
|
412
|
+
{
|
|
413
|
+
"success": true,
|
|
414
|
+
"action": "nome_da_action",
|
|
415
|
+
"message": "descrição do resultado",
|
|
416
|
+
"data": { /* dados específicos */ },
|
|
417
|
+
"error": { /* se houver erro */ },
|
|
418
|
+
"autoDetected": {
|
|
419
|
+
"repo": "nome_repo",
|
|
420
|
+
"owner": "dono_repo",
|
|
421
|
+
"providers": ["gitea", "github"],
|
|
422
|
+
"projectPath": "/caminho/projeto"
|
|
423
|
+
},
|
|
424
|
+
"metadata": {
|
|
425
|
+
"timestamp": "2025-09-30T22:26:04.378Z",
|
|
426
|
+
"operation": "nome_da_action",
|
|
427
|
+
"tool": "nome_da_tool"
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
## 🚨 Tratamento de Erros
|
|
433
|
+
|
|
434
|
+
- **Auto-recovery**: Tentativas automáticas de correção
|
|
435
|
+
- **Sugestões**: Recomendações específicas para resolução
|
|
436
|
+
- **Códigos padronizados**: Classificação consistente de erros
|
|
437
|
+
|
|
438
|
+
## 🎯 Boas Práticas
|
|
439
|
+
|
|
440
|
+
1. **Sempre use projectPath absoluto**
|
|
441
|
+
2. **Configure providers antes do uso**
|
|
442
|
+
3. **Verifique responses para autoDetected**
|
|
443
|
+
4. **Use error.suggestion para recovery**
|
|
444
|
+
5. **Prefira actions em lote quando possível**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrebuzeli/git-mcp",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"description": "MCP server for Gitea and GitHub integration - UNIFICADO: 18 ferramentas otimizadas para AI agents, auto-detecção universal, error handling inteligente, workflow completo - 100% COMPATÍVEL: git-workflow, git-files, git-release, git-monitor, git-backup, git-branches, git-remote, git-stash, git-reset, git-tags, git-issues, git-pulls + 6 ferramentas especializadas - ZERO CONFIG, FULLY IMPLEMENTED for AI agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"test": "node tests/basic.test.js",
|
|
14
14
|
"lint": "echo \"No linting configured\" && exit 0",
|
|
15
15
|
"prepublishOnly": "npm run build",
|
|
16
|
-
"postpublish": "echo 'Git MCP v4.0.
|
|
16
|
+
"postpublish": "echo 'Git MCP v4.0.3 published successfully - DOCUMENTADO: 18 ferramentas + documentação completa - INSTRUCOES.md com guia detalhado de todas as actions, EXEMPLOS.md com casos reais de uso, README.md atualizado - UNIFICADO para AI agents com auto-detecção universal, error handling inteligente e workflow completo!'"
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"mcp",
|
|
21
21
|
"gitea",
|
|
@@ -55,6 +55,8 @@
|
|
|
55
55
|
"files": [
|
|
56
56
|
"dist/**/*",
|
|
57
57
|
"README.md",
|
|
58
|
+
"INSTRUCOES.md",
|
|
59
|
+
"EXEMPLOS.md",
|
|
58
60
|
"LICENSE"
|
|
59
61
|
]
|
|
60
62
|
}
|