fantasy-cli 1.2.6 → 1.2.8
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.
- checksums.yaml +4 -4
- data/README.md +156 -367
- data/lib/gsd/ai/chat_tui.rb +97 -0
- data/lib/gsd/ai/cli.rb +11 -4
- data/lib/gsd/ai/config.rb +5 -1
- data/lib/gsd/tui/app.rb +8 -0
- data/lib/gsd/tui/input_box.rb +6 -0
- data/lib/gsd/version.rb +1 -1
- metadata +4 -10
- /data/bin/{gsd → fantasy} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b21d6b0bc759338260d8652eb5e017738a251d453438561fbdd9ae0b15108f8f
|
|
4
|
+
data.tar.gz: 3959bba1608124afffe0427f916d58f87875dec563a467df6d4d48c8072f01cb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95f9f883c6af8103c696313f727a36c4da7894a3e013d8fa92de481f7327a6d64765c1edd493144d16fe41f059f856c74a9c8228f90991e88a71e95c98577811
|
|
7
|
+
data.tar.gz: 7b5bb8e32c75db325d3a459769bf00d744fec078957aec11fadb9fb7abde1adcd6d1e02a9d6e36fe8651175ebcf1ec88c0c8e53c5896debce962f71995b3d75c
|
data/README.md
CHANGED
|
@@ -1,456 +1,245 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Fantasy CLI
|
|
2
2
|
|
|
3
|
-
[](https://github.com/HikariLucky/Fantasy/actions/workflows/ci.yml)
|
|
4
|
+
[](https://badge.fury.io/rb/fantasy-cli)
|
|
5
|
+
[](https://www.ruby-lang.org/)
|
|
6
|
+
[](https://go.dev/)
|
|
6
7
|
|
|
7
|
-
CLI de alta performance para gerenciamento de projetos
|
|
8
|
+
**CLI de alta performance para gerenciamento de projetos com IA integrada.**
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
> ⚡ **Startup ~23ms** | 🧠 **AI Chat com comandos / e @** | 🔄 **Git context automático**
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
- **Baixo uso de memória**: ~15MB (vs ~50-150MB do Node.js) — **90% menos**
|
|
13
|
-
- **Binários nativos**: Sem necessidade de runtime
|
|
14
|
-
- **Cross-platform**: Windows, Linux, macOS (amd64 + arm64)
|
|
15
|
-
- **Compatível**: Mesma interface CLI da versão anterior
|
|
12
|
+
---
|
|
16
13
|
|
|
17
|
-
##
|
|
14
|
+
## ✨ Features
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
| Feature | Descrição |
|
|
17
|
+
|---------|-----------|
|
|
18
|
+
| 🤖 **AI Chat** | REPL interativo com suporte a múltiplos providers (Anthropic, OpenAI, Ollama, LM Studio, OpenRouter) |
|
|
19
|
+
| 📁 **Referências @** | Injete arquivos (`@arquivo.rb`) e diretórios (`@pasta/`) diretamente no contexto da conversa |
|
|
20
|
+
| ⌨️ **Comandos /** | `/help`, `/model`, `/cost`, `/clear`, `/export` e mais |
|
|
21
|
+
| 🔮 **Autocomplete** | Sugestões em tempo real para referências de arquivos |
|
|
22
|
+
| 📊 **Git Context** | Branch, status, arquivos modificados e ahead/behind integrados automaticamente |
|
|
23
|
+
| 💰 **Cost Tracking** | Monitoramento de tokens e custo em tempo real com alertas de orçamento |
|
|
24
|
+
| 🏗️ **Project Management** | State, Phase, Roadmap, Milestones, Workstreams |
|
|
25
|
+
| 📝 **Templates** | Geração automática de docs (SUMMARY.md, PLAN.md, VERIFICATION.md) |
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
# Instalar gem
|
|
23
|
-
gem install gsd
|
|
27
|
+
---
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
gsd version
|
|
27
|
-
```
|
|
29
|
+
## 📦 Instalação
|
|
28
30
|
|
|
29
|
-
###
|
|
31
|
+
### Ruby Gem (Recomendado)
|
|
30
32
|
|
|
31
33
|
```bash
|
|
32
|
-
|
|
33
|
-
# Windows amd64
|
|
34
|
-
curl -LO https://github.com/claude-ruby/gsd/releases/download/v1.0.0/gsd-core-windows-amd64.exe
|
|
35
|
-
mv gsd-core-windows-amd64.exe gsd-core.exe
|
|
36
|
-
|
|
37
|
-
# Linux amd64
|
|
38
|
-
curl -LO https://github.com/claude-ruby/gsd/releases/download/v1.0.0/gsd-core-linux-amd64
|
|
39
|
-
chmod +x gsd-core-linux-amd64
|
|
40
|
-
mv gsd-core-linux-amd64 gsd-core
|
|
41
|
-
|
|
42
|
-
# macOS Intel
|
|
43
|
-
curl -LO https://github.com/claude-ruby/gsd/releases/download/v1.0.0/gsd-core-darwin-amd64
|
|
44
|
-
chmod +x gsd-core-darwin-amd64
|
|
45
|
-
mv gsd-core-darwin-amd64 gsd-core
|
|
46
|
-
|
|
47
|
-
# macOS M1/M2
|
|
48
|
-
curl -LO https://github.com/claude-ruby/gsd/releases/download/v1.0.0/gsd-core-darwin-arm64
|
|
49
|
-
chmod +x gsd-core-darwin-arm64
|
|
50
|
-
mv gsd-core-darwin-arm64 gsd-core
|
|
51
|
-
|
|
52
|
-
# Adicionar ao PATH
|
|
53
|
-
mv gsd-core /usr/local/bin/
|
|
34
|
+
gem install fantasy-cli
|
|
54
35
|
```
|
|
55
36
|
|
|
56
|
-
###
|
|
37
|
+
### Ou build local:
|
|
57
38
|
|
|
58
39
|
```bash
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
# Clonar repositório
|
|
64
|
-
git clone https://github.com/claude-ruby/gsd.git
|
|
65
|
-
cd gsd
|
|
66
|
-
|
|
67
|
-
# Build completo
|
|
68
|
-
make build
|
|
69
|
-
|
|
70
|
-
# Ou apenas Go
|
|
71
|
-
make build-go
|
|
72
|
-
|
|
73
|
-
# Ou apenas Ruby
|
|
74
|
-
make build-ruby
|
|
40
|
+
git clone https://github.com/HikariLucky/Fantasy.git
|
|
41
|
+
cd Fantasy
|
|
42
|
+
bundle install
|
|
43
|
+
bundle exec rake install
|
|
75
44
|
```
|
|
76
45
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
| Componente | Versão Mínima | Opcional |
|
|
80
|
-
|------------|---------------|----------|
|
|
81
|
-
| Go | 1.21+ | Apenas para build from source |
|
|
82
|
-
| Ruby | 3.0+ | Apenas para gem installation |
|
|
83
|
-
| Bundler | 2.0+ | Apenas para desenvolvimento |
|
|
46
|
+
---
|
|
84
47
|
|
|
85
|
-
##
|
|
48
|
+
## 🚀 Uso Rápido
|
|
86
49
|
|
|
87
|
-
###
|
|
50
|
+
### AI Chat Interativo
|
|
88
51
|
|
|
89
52
|
```bash
|
|
90
|
-
#
|
|
91
|
-
|
|
53
|
+
# Iniciar chat (provider padrão: anthropic)
|
|
54
|
+
fantasy ai
|
|
92
55
|
|
|
93
|
-
#
|
|
94
|
-
|
|
56
|
+
# Ou com provider específico
|
|
57
|
+
fantasy ai --provider openai --model gpt-4
|
|
95
58
|
|
|
96
|
-
#
|
|
97
|
-
|
|
98
|
-
|
|
59
|
+
# Dentro do chat:
|
|
60
|
+
> /help # Lista comandos disponíveis
|
|
61
|
+
> /model claude-sonnet # Troca modelo
|
|
62
|
+
> /cost # Mostra estatísticas de custo
|
|
63
|
+
> @lib/fantasy/ai/chat.rb # Injeta arquivo no contexto
|
|
64
|
+
> @src/ # Lista diretório no contexto
|
|
99
65
|
```
|
|
100
66
|
|
|
101
|
-
###
|
|
67
|
+
### Gestão de Projeto
|
|
102
68
|
|
|
103
69
|
```bash
|
|
104
|
-
# Carregar
|
|
105
|
-
|
|
70
|
+
# Carregar estado
|
|
71
|
+
fantasy state load
|
|
106
72
|
|
|
107
|
-
#
|
|
108
|
-
|
|
73
|
+
# Verificar phase atual
|
|
74
|
+
fantasy phase find 1
|
|
109
75
|
|
|
110
|
-
#
|
|
111
|
-
|
|
76
|
+
# Analisar roadmap
|
|
77
|
+
fantasy roadmap analyze
|
|
112
78
|
|
|
113
|
-
#
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
# Obter conteúdo ou seção
|
|
117
|
-
gsd state get
|
|
118
|
-
gsd state get Notes
|
|
79
|
+
# Iniciar workflow
|
|
80
|
+
fantasy init execute-phase --phase 1
|
|
119
81
|
```
|
|
120
82
|
|
|
121
|
-
|
|
83
|
+
---
|
|
122
84
|
|
|
123
|
-
|
|
124
|
-
# Encontrar phase
|
|
125
|
-
gsd phase find 1
|
|
85
|
+
## 🤖 AI Chat Commands
|
|
126
86
|
|
|
127
|
-
|
|
128
|
-
gsd phase list
|
|
87
|
+
Durante o chat interativo, use:
|
|
129
88
|
|
|
130
|
-
|
|
131
|
-
|
|
89
|
+
| Comando | Descrição |
|
|
90
|
+
|---------|-----------|
|
|
91
|
+
| `/help [cmd]` | Ajuda geral ou de comando específico |
|
|
92
|
+
| `/clear` | Limpa histórico da conversa |
|
|
93
|
+
| `/reset` | Reseta contexto e histórico |
|
|
94
|
+
| `/model [nome]` | Lista ou muda modelo |
|
|
95
|
+
| `/cost` | Estatísticas de custo e tokens |
|
|
96
|
+
| `/context` | Tamanho atual do contexto |
|
|
97
|
+
| `/export [arquivo]` | Exporta histórico para JSON |
|
|
132
98
|
|
|
133
|
-
|
|
134
|
-
gsd phase add "New Phase"
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Roadmap Commands
|
|
99
|
+
### Referências (@)
|
|
138
100
|
|
|
139
|
-
|
|
140
|
-
# Extrair phase do ROADMAP.md
|
|
141
|
-
gsd roadmap get-phase 1
|
|
101
|
+
Prefixe qualquer mensagem com `@` para incluir conteúdo:
|
|
142
102
|
|
|
143
|
-
# Análise completa
|
|
144
|
-
gsd roadmap analyze
|
|
145
103
|
```
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
# Verificar estrutura do PLAN.md
|
|
151
|
-
gsd verify plan-structure .planning/phases/01-phase/PLAN.md
|
|
152
|
-
|
|
153
|
-
# Verificar completude da phase
|
|
154
|
-
gsd verify phase-completeness 1
|
|
155
|
-
|
|
156
|
-
# Verificar referências
|
|
157
|
-
gsd verify references .planning/phases/01-phase/PLAN.md
|
|
158
|
-
|
|
159
|
-
# Verificar commits
|
|
160
|
-
gsd verify commits abc123 def456
|
|
161
|
-
|
|
162
|
-
# Verificar artefatos
|
|
163
|
-
gsd verify artifacts .planning/phases/01-phase/PLAN.md
|
|
164
|
-
|
|
165
|
-
# Verificar key links
|
|
166
|
-
gsd verify key-links .planning/phases/01-phase/PLAN.md
|
|
167
|
-
|
|
168
|
-
# Verificar tasks
|
|
169
|
-
gsd verify tasks .planning/phases/01-phase/PLAN.md
|
|
170
|
-
|
|
171
|
-
# Verificar summary
|
|
172
|
-
gsd verify summary .planning/phases/01-phase/SUMMARY.md
|
|
104
|
+
> @README.md explica esse projeto
|
|
105
|
+
> @lib/fantasy/cli.rb o que esse arquivo faz?
|
|
106
|
+
> @src/ lista os arquivos desse diretório
|
|
173
107
|
```
|
|
174
108
|
|
|
175
|
-
|
|
109
|
+
**Limites:**
|
|
110
|
+
- Máximo 5 arquivos por mensagem
|
|
111
|
+
- Máximo 100KB por arquivo
|
|
112
|
+
- Imagens (.png, .jpg) convertidas para base64 (se provider suportar)
|
|
176
113
|
|
|
177
|
-
|
|
178
|
-
# Preencher SUMMARY.md
|
|
179
|
-
gsd template fill summary --phase 1 --plan 1 --name "Summary"
|
|
114
|
+
---
|
|
180
115
|
|
|
181
|
-
|
|
182
|
-
gsd template fill plan --phase 1 --plan 1 --type execute
|
|
116
|
+
## 🛠️ Comandos Disponíveis
|
|
183
117
|
|
|
184
|
-
|
|
185
|
-
|
|
118
|
+
### Core
|
|
119
|
+
- `fantasy help` - Ajuda geral
|
|
120
|
+
- `fantasy version` - Versão instalada
|
|
186
121
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
122
|
+
### AI
|
|
123
|
+
- `fantasy ai` - Chat interativo com IA
|
|
124
|
+
- `fantasy ai --provider anthropic --model claude-sonnet-4-5`
|
|
190
125
|
|
|
191
|
-
###
|
|
126
|
+
### Estado & Planejamento
|
|
127
|
+
- `fantasy state load|json|update|patch`
|
|
128
|
+
- `fantasy phase find|list|next-decimal|add`
|
|
129
|
+
- `fantasy roadmap get-phase|analyze`
|
|
130
|
+
- `fantasy milestone complete|archive`
|
|
131
|
+
- `fantasy workstream get|set|list`
|
|
192
132
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
133
|
+
### Verificação & Templates
|
|
134
|
+
- `fantasy verify plan-structure|phase-completeness|references|commits`
|
|
135
|
+
- `fantasy template fill summary|plan|verification|context`
|
|
136
|
+
- `fantasy frontmatter get|set|merge|validate`
|
|
197
137
|
|
|
198
|
-
|
|
199
|
-
|
|
138
|
+
### Workflow
|
|
139
|
+
- `fantasy init execute-phase|plan-phase|new-project|resume`
|
|
140
|
+
- `fantasy history digest`
|
|
141
|
+
- `fantasy profile get|set|list`
|
|
142
|
+
- `fantasy research websearch`
|
|
200
143
|
|
|
201
|
-
|
|
202
|
-
gsd frontmatter merge .planning/STATE.md --data '{"status":"done"}'
|
|
144
|
+
---
|
|
203
145
|
|
|
204
|
-
|
|
205
|
-
gsd frontmatter validate .planning/STATE.md --schema plan
|
|
146
|
+
## 🏗️ Arquitetura
|
|
206
147
|
|
|
207
|
-
# Extrair campos específicos
|
|
208
|
-
gsd frontmatter extract .planning/STATE.md --fields phase,plan,status
|
|
209
148
|
```
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
149
|
+
Ruby CLI (fantasy)
|
|
150
|
+
├── Core Commands (state, phase, roadmap, verify, template)
|
|
151
|
+
├── AI Module
|
|
152
|
+
│ ├── Chat (REPL com comandos / e @)
|
|
153
|
+
│ ├── Providers (anthropic, openai, ollama, lmstudio, openrouter)
|
|
154
|
+
│ ├── CommandParser (/commands)
|
|
155
|
+
│ ├── ReferenceResolver (@arquivos)
|
|
156
|
+
│ ├── GitContext (status, branch, commits)
|
|
157
|
+
│ ├── CostTracker (tokens, budget, alerts)
|
|
158
|
+
│ └── TUI (InputBox com autocomplete)
|
|
159
|
+
└── Go Bridge (gsd-core binary)
|
|
160
|
+
├── pkg/state, phase, roadmap
|
|
161
|
+
└── pkg/verify, template, frontmatter
|
|
222
162
|
```
|
|
223
163
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
# Obter workstream atual
|
|
228
|
-
gsd workstream get
|
|
229
|
-
|
|
230
|
-
# Definir workstream
|
|
231
|
-
gsd workstream set my-workstream
|
|
164
|
+
---
|
|
232
165
|
|
|
233
|
-
|
|
234
|
-
gsd workstream list
|
|
166
|
+
## ⚙️ Configuração
|
|
235
167
|
|
|
236
|
-
|
|
237
|
-
gsd workstream clear
|
|
238
|
-
```
|
|
168
|
+
### API Keys
|
|
239
169
|
|
|
240
|
-
|
|
170
|
+
Configure suas chaves:
|
|
241
171
|
|
|
242
172
|
```bash
|
|
243
|
-
#
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
# Extrair summary
|
|
247
|
-
gsd history summary-extract .planning/phases/01-phase/SUMMARY.md
|
|
248
|
-
```
|
|
173
|
+
# Anthropic (para Claude)
|
|
174
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
249
175
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
# Obter profile
|
|
254
|
-
gsd profile get default
|
|
176
|
+
# OpenAI (para GPT)
|
|
177
|
+
export OPENAI_API_KEY=sk-...
|
|
255
178
|
|
|
256
|
-
#
|
|
257
|
-
|
|
179
|
+
# OpenRouter (para modelos gratuitos)
|
|
180
|
+
export OPENROUTER_API_KEY=sk-or-...
|
|
258
181
|
|
|
259
|
-
#
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
# Definir profile padrão
|
|
263
|
-
gsd profile set-default default
|
|
264
|
-
|
|
265
|
-
# Obter profile para agent
|
|
266
|
-
gsd profile get-agent researcher
|
|
267
|
-
|
|
268
|
-
# Definir profile para agent
|
|
269
|
-
gsd profile set-agent researcher my-profile
|
|
270
|
-
|
|
271
|
-
# Obter pipeline config
|
|
272
|
-
gsd profile pipeline
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### Research Commands
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
# Web search (requer BRAVE_API_KEY)
|
|
279
|
-
gsd research websearch "query" --limit 10 --freshness week
|
|
280
|
-
|
|
281
|
-
# Iniciar research
|
|
282
|
-
gsd research start 1
|
|
283
|
-
|
|
284
|
-
# Completar research
|
|
285
|
-
gsd research complete 1
|
|
182
|
+
# Brave (para web search)
|
|
183
|
+
export BRAVE_API_KEY=...
|
|
286
184
|
```
|
|
287
185
|
|
|
288
|
-
###
|
|
186
|
+
### Profiles
|
|
289
187
|
|
|
290
|
-
|
|
291
|
-
# Audit UAT
|
|
292
|
-
gsd uat audit-uat
|
|
293
|
-
|
|
294
|
-
# Render checkpoint
|
|
295
|
-
gsd uat render-checkpoint --file .planning/phases/01-phase/UAT.md
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
### Progress Commands
|
|
188
|
+
Salve configurações de modelo:
|
|
299
189
|
|
|
300
190
|
```bash
|
|
301
|
-
#
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
# Output table
|
|
305
|
-
gsd progress table
|
|
191
|
+
# Criar profile
|
|
192
|
+
fantasy profile set fast --model claude-3-haiku
|
|
306
193
|
|
|
307
|
-
#
|
|
308
|
-
|
|
194
|
+
# Usar profile
|
|
195
|
+
fantasy ai --profile fast
|
|
309
196
|
```
|
|
310
197
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
```bash
|
|
314
|
-
# Criar CONTEXT.md
|
|
315
|
-
gsd scaffold context --phase 1 --name "Context"
|
|
316
|
-
|
|
317
|
-
# Criar UAT.md
|
|
318
|
-
gsd scaffold uat --phase 1 --name "UAT"
|
|
319
|
-
|
|
320
|
-
# Criar VERIFICATION.md
|
|
321
|
-
gsd scaffold verification --phase 1 --name "Verification"
|
|
322
|
-
```
|
|
198
|
+
---
|
|
323
199
|
|
|
324
|
-
|
|
200
|
+
## 🧪 Desenvolvimento
|
|
325
201
|
|
|
326
202
|
```bash
|
|
327
|
-
#
|
|
328
|
-
|
|
203
|
+
# Instalar dependências
|
|
204
|
+
bundle install
|
|
329
205
|
|
|
330
|
-
#
|
|
331
|
-
|
|
206
|
+
# Rodar tests
|
|
207
|
+
bundle exec rspec
|
|
332
208
|
|
|
333
|
-
#
|
|
334
|
-
|
|
209
|
+
# Lint
|
|
210
|
+
bundle exec rubocop
|
|
335
211
|
|
|
336
|
-
#
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
# Iniciar quick workflow
|
|
340
|
-
gsd init quick "description"
|
|
341
|
-
|
|
342
|
-
# Iniciar resume workflow
|
|
343
|
-
gsd init resume
|
|
344
|
-
|
|
345
|
-
# Iniciar verify-work workflow
|
|
346
|
-
gsd init verify-work --phase 1
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
## 🏗️ Arquitetura
|
|
350
|
-
|
|
351
|
-
```
|
|
352
|
-
gsd (Ruby CLI)
|
|
353
|
-
└── gsd-core (Go binary)
|
|
354
|
-
├── pkg/state — State operations (STATE.md)
|
|
355
|
-
├── pkg/phase — Phase operations (directories)
|
|
356
|
-
├── pkg/roadmap — Roadmap operations (ROADMAP.md)
|
|
357
|
-
├── pkg/verify — Verification operations
|
|
358
|
-
├── pkg/template — Template filling
|
|
359
|
-
├── pkg/frontmatter — Frontmatter CRUD
|
|
360
|
-
├── pkg/milestone — Milestone operations
|
|
361
|
-
├── pkg/workstream — Workstream management
|
|
362
|
-
├── pkg/history — History digest
|
|
363
|
-
├── pkg/profile — Model profiles
|
|
364
|
-
├── pkg/research — Web research
|
|
365
|
-
├── pkg/uat — UAT audit
|
|
366
|
-
├── pkg/progress — Progress tracking
|
|
367
|
-
├── pkg/scaffold — Scaffolding
|
|
368
|
-
└── pkg/init — Init workflows
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
### Bridge Ruby ↔ Go
|
|
372
|
-
|
|
373
|
-
A comunicação é feita via subprocess:
|
|
374
|
-
|
|
375
|
-
```ruby
|
|
376
|
-
require 'gsd/go/bridge'
|
|
377
|
-
|
|
378
|
-
result = Gsd::Go::Bridge.call('state', { 'json' => true }, cwd: '/path')
|
|
379
|
-
puts result['data']['model_profile']
|
|
380
|
-
# => "default"
|
|
212
|
+
# Build gem
|
|
213
|
+
bundle exec rake build
|
|
381
214
|
```
|
|
382
215
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
```bash
|
|
386
|
-
# Todos os tests
|
|
387
|
-
make test
|
|
388
|
-
|
|
389
|
-
# Apenas Go
|
|
390
|
-
make test-go
|
|
391
|
-
|
|
392
|
-
# Apenas Ruby
|
|
393
|
-
make test-ruby
|
|
394
|
-
```
|
|
216
|
+
---
|
|
395
217
|
|
|
396
218
|
## 📊 Performance
|
|
397
219
|
|
|
398
|
-
|
|
|
399
|
-
|
|
400
|
-
| Startup | ~
|
|
401
|
-
|
|
|
402
|
-
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
| Categoria | Commands |
|
|
407
|
-
|-----------|----------|
|
|
408
|
-
| **Base** | hello, version, help |
|
|
409
|
-
| **State** | load, json, update, patch, get |
|
|
410
|
-
| **Phase** | find, list, next-decimal, add |
|
|
411
|
-
| **Roadmap** | get-phase, analyze |
|
|
412
|
-
| **Verify** | plan-structure, phase-completeness, references, commits, artifacts, key-links, tasks, summary |
|
|
413
|
-
| **Template** | fill summary, fill plan, fill verification, fill context |
|
|
414
|
-
| **Frontmatter** | get, set, merge, validate, extract |
|
|
415
|
-
| **Milestone** | complete, archive, requirements mark-complete |
|
|
416
|
-
| **Workstream** | get, set, list, clear |
|
|
417
|
-
| **History** | digest, summary-extract |
|
|
418
|
-
| **Profile** | get, set, list, set-default, get-agent, set-agent, pipeline |
|
|
419
|
-
| **Research** | websearch, start, complete |
|
|
420
|
-
| **UAT** | audit-uat, render-checkpoint |
|
|
421
|
-
| **Progress** | json, table, bar |
|
|
422
|
-
| **Scaffold** | context, uat, verification |
|
|
423
|
-
| **Init** | execute-phase, plan-phase, new-project, new-milestone, quick, resume, verify-work |
|
|
424
|
-
|
|
425
|
-
**Total:** 70+ commands
|
|
220
|
+
| Métrica | Valor |
|
|
221
|
+
|---------|-------|
|
|
222
|
+
| Startup | ~23ms |
|
|
223
|
+
| Memória | ~15MB |
|
|
224
|
+
| Binários | 11MB (nativo) |
|
|
225
|
+
| Cross-platform | ✅ Windows, Linux, macOS |
|
|
226
|
+
|
|
227
|
+
---
|
|
426
228
|
|
|
427
229
|
## 🗺️ Roadmap
|
|
428
230
|
|
|
429
|
-
- [x]
|
|
430
|
-
- [x]
|
|
431
|
-
- [
|
|
432
|
-
- [
|
|
433
|
-
- [
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
- [x] Semana 3: macOS Cross-Compilation
|
|
437
|
-
- [x] Semana 4: Startup Time <50ms
|
|
438
|
-
- [x] Semana 5: Memory <50MB
|
|
439
|
-
- [x] Semana 6: Core Documentation
|
|
440
|
-
- [x] Semana 7: Migration Docs
|
|
441
|
-
- [x] Semana 8: CI/CD
|
|
442
|
-
- [x] Semana 9: Security
|
|
443
|
-
- [x] Semana 10: Testing
|
|
444
|
-
- [x] Semana 11: Beta
|
|
445
|
-
- [x] Semana 12: Release v1.0.0
|
|
231
|
+
- [x] **v1.2.5** - Git context, AI tests fixes
|
|
232
|
+
- [x] **v1.2.6** - Command parser (/), References (@), Autocomplete
|
|
233
|
+
- [ ] **v1.3.0** - Skills system, Tool registry
|
|
234
|
+
- [ ] **v1.4.0** - Multi-agent support
|
|
235
|
+
- [ ] **v2.0.0** - Web interface
|
|
236
|
+
|
|
237
|
+
---
|
|
446
238
|
|
|
447
239
|
## 📄 Licença
|
|
448
240
|
|
|
449
|
-
MIT
|
|
241
|
+
MIT © [Hikari Lucky](https://github.com/HikariLucky)
|
|
450
242
|
|
|
451
|
-
|
|
243
|
+
---
|
|
452
244
|
|
|
453
|
-
|
|
454
|
-
- [Issues](https://github.com/claude-ruby/gsd/issues)
|
|
455
|
-
- [Documentação Completa](docs/)
|
|
456
|
-
- [Migration Guide](docs/MIGRATION.md)
|
|
245
|
+
**Links:** [Issues](https://github.com/HikariLucky/Fantasy/issues) | [Releases](https://github.com/HikariLucky/Fantasy/releases) | [RubyGems](https://rubygems.org/gems/fantasy-cli)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'gsd/tui/app'
|
|
4
|
+
require 'gsd/ai/chat'
|
|
5
|
+
|
|
6
|
+
module Gsd
|
|
7
|
+
module AI
|
|
8
|
+
# AI Chat TUI - Integração da TUI com Chat AI
|
|
9
|
+
class ChatTUI < Gsd::TUI::App
|
|
10
|
+
def initialize(chat, theme: :fantasy)
|
|
11
|
+
super(theme: theme, header_style: :pixel)
|
|
12
|
+
@chat = chat
|
|
13
|
+
@input_box = Gsd::TUI::InputBox.new(placeholder: 'Ask AI anything...', cwd: @chat.instance_variable_get(:@cwd))
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def run
|
|
17
|
+
@running = true
|
|
18
|
+
setup_console
|
|
19
|
+
|
|
20
|
+
print Gsd::TUI::Colors::CURSOR_HIDE
|
|
21
|
+
system('cls') if @is_windows
|
|
22
|
+
print Gsd::TUI::Colors::HOME
|
|
23
|
+
|
|
24
|
+
# Mensagens iniciais do AI Chat
|
|
25
|
+
add_message(:system, "🤖 AI Chat iniciado - #{@chat.provider.model}")
|
|
26
|
+
add_message(:system, 'Digite /help para comandos, @arquivo para referências')
|
|
27
|
+
|
|
28
|
+
full_render
|
|
29
|
+
|
|
30
|
+
while @running
|
|
31
|
+
@frame_count += 1
|
|
32
|
+
@spinner.next_frame if (@frame_count % 5).zero?
|
|
33
|
+
|
|
34
|
+
handle_input
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
cleanup_console
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Sobrescreve handle_enter para processar mensagens com AI
|
|
41
|
+
def handle_enter
|
|
42
|
+
text = @input_box.submit
|
|
43
|
+
return if text.strip.empty?
|
|
44
|
+
|
|
45
|
+
@history << text
|
|
46
|
+
@history_index = @history.length
|
|
47
|
+
|
|
48
|
+
# Adiciona mensagem do usuário
|
|
49
|
+
add_message(:user, text)
|
|
50
|
+
|
|
51
|
+
# Limpa input e autocomplete
|
|
52
|
+
@input_box.clear
|
|
53
|
+
@auto_complete.clear
|
|
54
|
+
|
|
55
|
+
# Recria input_box com mesmo placeholder
|
|
56
|
+
@input_box = Gsd::TUI::InputBox.new(
|
|
57
|
+
placeholder: 'Ask AI anything...',
|
|
58
|
+
cwd: @chat.instance_variable_get(:@cwd)
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# Inicia spinner
|
|
62
|
+
@spinner.start
|
|
63
|
+
full_render
|
|
64
|
+
|
|
65
|
+
# Processa mensagem em thread separada
|
|
66
|
+
Thread.new do
|
|
67
|
+
begin
|
|
68
|
+
response = @chat.send(text, stream: false)
|
|
69
|
+
add_message(:assistant, response)
|
|
70
|
+
rescue => e
|
|
71
|
+
add_message(:error, "Erro: #{e.message}")
|
|
72
|
+
ensure
|
|
73
|
+
@spinner.stop
|
|
74
|
+
render
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Sobrescreve handle_palette_action para comandos do AI
|
|
80
|
+
def handle_palette_action(action)
|
|
81
|
+
case action
|
|
82
|
+
when :quit
|
|
83
|
+
stop
|
|
84
|
+
when :theme_fantasy, :theme_kilo, :theme_dark, :theme_light, :theme_nord
|
|
85
|
+
theme_name = action.to_s.split('_').last.to_sym
|
|
86
|
+
set_theme(theme_name)
|
|
87
|
+
when :clear
|
|
88
|
+
@output.clear
|
|
89
|
+
add_message(:system, '🧹 Histórico limpo')
|
|
90
|
+
else
|
|
91
|
+
add_message(:system, "Comando: #{action}")
|
|
92
|
+
end
|
|
93
|
+
full_render
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
data/lib/gsd/ai/cli.rb
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'gsd/ai/
|
|
3
|
+
require 'gsd/ai/config'
|
|
4
4
|
require 'gsd/ai/repl'
|
|
5
|
+
require 'gsd/ai/chat_tui'
|
|
5
6
|
require 'gsd/ai/config'
|
|
6
7
|
|
|
7
8
|
module Gsd
|
|
@@ -146,13 +147,19 @@ module Gsd
|
|
|
146
147
|
end
|
|
147
148
|
end
|
|
148
149
|
|
|
149
|
-
# Executa REPL interativo
|
|
150
|
+
# Executa REPL interativo com TUI
|
|
150
151
|
#
|
|
151
152
|
# @param chat [Chat] Instância do chat
|
|
152
153
|
# @return [void]
|
|
153
154
|
def run_repl(chat)
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
puts "DEBUG: Creating ChatTUI..." if @options[:debug]
|
|
156
|
+
tui = Gsd::AI::ChatTUI.new(chat, theme: :fantasy)
|
|
157
|
+
puts "DEBUG: ChatTUI created, starting..." if @options[:debug]
|
|
158
|
+
tui.run
|
|
159
|
+
puts "DEBUG: ChatTUI finished" if @options[:debug]
|
|
160
|
+
rescue => e
|
|
161
|
+
puts "❌ Erro na TUI: #{e.message}"
|
|
162
|
+
puts e.backtrace.first(5).join("\n") if @options[:debug]
|
|
156
163
|
end
|
|
157
164
|
|
|
158
165
|
# Imprime ajuda
|
data/lib/gsd/ai/config.rb
CHANGED
|
@@ -71,7 +71,9 @@ module Gsd
|
|
|
71
71
|
'openai' => ENV['OPENAI_API_KEY'],
|
|
72
72
|
'openrouter' => ENV['OPENROUTER_API_KEY'],
|
|
73
73
|
'ollama' => 'local (não requer key)',
|
|
74
|
-
'lmstudio' => 'local (não requer key)'
|
|
74
|
+
'lmstudio' => 'local (não requer key)',
|
|
75
|
+
'groq' => ENV['GROQ_API_KEY'],
|
|
76
|
+
'gemini' => ENV['GEMINI_API_KEY']
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
puts "\n🔑 API Keys Configuradas\n"
|
|
@@ -96,6 +98,8 @@ module Gsd
|
|
|
96
98
|
puts " export OPENROUTER_API_KEY=sk-or-..."
|
|
97
99
|
puts " export ANTHROPIC_API_KEY=sk-ant-..."
|
|
98
100
|
puts " export OPENAI_API_KEY=sk-..."
|
|
101
|
+
puts " export GROQ_API_KEY=..."
|
|
102
|
+
puts " export GEMINI_API_KEY=..."
|
|
99
103
|
puts
|
|
100
104
|
end
|
|
101
105
|
|
data/lib/gsd/tui/app.rb
CHANGED
|
@@ -70,6 +70,14 @@ module Gsd
|
|
|
70
70
|
@running = false
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
+
# Add a message to the output
|
|
74
|
+
# @param type [Symbol] Message type (:user, :assistant, :system, :error)
|
|
75
|
+
# @param text [String] Message text
|
|
76
|
+
def add_message(type, text)
|
|
77
|
+
@output << { type: type, text: text }
|
|
78
|
+
full_render if @running
|
|
79
|
+
end
|
|
80
|
+
|
|
73
81
|
private
|
|
74
82
|
|
|
75
83
|
# Setup console for raw input (Windows-safe)
|
data/lib/gsd/tui/input_box.rb
CHANGED
data/lib/gsd/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fantasy-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fantasy Team
|
|
@@ -83,20 +83,13 @@ description: Fantasy CLI - Terminal User Interface with Ruby + Go
|
|
|
83
83
|
email:
|
|
84
84
|
- fantasy@example.com
|
|
85
85
|
executables:
|
|
86
|
-
-
|
|
87
|
-
- gsd-core-darwin-amd64
|
|
88
|
-
- gsd-core-darwin-arm64
|
|
89
|
-
- gsd-core-linux-amd64
|
|
90
|
-
- gsd-core-linux-arm64
|
|
91
|
-
- gsd-core-windows-amd64.exe
|
|
92
|
-
- gsd-core-windows-arm64.exe
|
|
93
|
-
- gsd-core.exe
|
|
86
|
+
- fantasy
|
|
94
87
|
extensions: []
|
|
95
88
|
extra_rdoc_files: []
|
|
96
89
|
files:
|
|
97
90
|
- LICENSE
|
|
98
91
|
- README.md
|
|
99
|
-
- bin/
|
|
92
|
+
- bin/fantasy
|
|
100
93
|
- bin/gsd-core-darwin-amd64
|
|
101
94
|
- bin/gsd-core-darwin-arm64
|
|
102
95
|
- bin/gsd-core-linux-amd64
|
|
@@ -109,6 +102,7 @@ files:
|
|
|
109
102
|
- lib/gsd/agents/task_manager.rb
|
|
110
103
|
- lib/gsd/agents/worker.rb
|
|
111
104
|
- lib/gsd/ai/chat.rb
|
|
105
|
+
- lib/gsd/ai/chat_tui.rb
|
|
112
106
|
- lib/gsd/ai/cli.rb
|
|
113
107
|
- lib/gsd/ai/command_parser.rb
|
|
114
108
|
- lib/gsd/ai/commands/base.rb
|
/data/bin/{gsd → fantasy}
RENAMED
|
File without changes
|