@nimbuslab/cli 0.10.0 → 0.11.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.
- package/dist/index.js +159 -1
- package/package.json +1 -1
- package/src/commands/lola.ts +132 -0
- package/src/index.ts +4 -1
package/dist/index.js
CHANGED
|
@@ -146,6 +146,51 @@ var require_src = __commonJS((exports, module) => {
|
|
|
146
146
|
module.exports = { cursor, scroll, erase, beep };
|
|
147
147
|
});
|
|
148
148
|
|
|
149
|
+
// package.json
|
|
150
|
+
var require_package = __commonJS((exports, module) => {
|
|
151
|
+
module.exports = {
|
|
152
|
+
name: "@nimbuslab/cli",
|
|
153
|
+
version: "0.11.0",
|
|
154
|
+
description: "CLI para criar projetos nimbuslab",
|
|
155
|
+
type: "module",
|
|
156
|
+
bin: {
|
|
157
|
+
nimbus: "./dist/index.js"
|
|
158
|
+
},
|
|
159
|
+
scripts: {
|
|
160
|
+
dev: "bun run src/index.ts",
|
|
161
|
+
build: "bun build src/index.ts --outdir dist --target bun",
|
|
162
|
+
typecheck: "tsc --noEmit"
|
|
163
|
+
},
|
|
164
|
+
keywords: ["nimbuslab", "cli", "nextjs", "fast", "landing-page", "saas"],
|
|
165
|
+
author: {
|
|
166
|
+
name: "nimbuslab",
|
|
167
|
+
email: "contato@nimbuslab.com.br",
|
|
168
|
+
url: "https://nimbuslab.com.br"
|
|
169
|
+
},
|
|
170
|
+
license: "UNLICENSED",
|
|
171
|
+
private: false,
|
|
172
|
+
repository: {
|
|
173
|
+
type: "git",
|
|
174
|
+
url: "git+https://github.com/nimbuslab/cli.git"
|
|
175
|
+
},
|
|
176
|
+
homepage: "https://nimbuslab.com.br",
|
|
177
|
+
bugs: {
|
|
178
|
+
url: "https://github.com/nimbuslab/cli/issues"
|
|
179
|
+
},
|
|
180
|
+
engines: {
|
|
181
|
+
node: ">=18"
|
|
182
|
+
},
|
|
183
|
+
devDependencies: {
|
|
184
|
+
"@types/bun": "latest",
|
|
185
|
+
typescript: "^5"
|
|
186
|
+
},
|
|
187
|
+
dependencies: {
|
|
188
|
+
"@clack/prompts": "^0.11.0",
|
|
189
|
+
picocolors: "^1.1.1"
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
});
|
|
193
|
+
|
|
149
194
|
// src/index.ts
|
|
150
195
|
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
151
196
|
|
|
@@ -2426,10 +2471,120 @@ ${message}
|
|
|
2426
2471
|
console.log(import_picocolors6.default.green(" Sugestao enviada! Hugo vai revisar."));
|
|
2427
2472
|
console.log();
|
|
2428
2473
|
}
|
|
2474
|
+
var PROFILES = {
|
|
2475
|
+
millennial: {
|
|
2476
|
+
label: "Millennial",
|
|
2477
|
+
hint: "Nerd 90s/2000s, DBZ, Matrix, MSN",
|
|
2478
|
+
emoji: ""
|
|
2479
|
+
},
|
|
2480
|
+
genz: {
|
|
2481
|
+
label: "Gen Z",
|
|
2482
|
+
hint: "Direto, girias atuais, slay",
|
|
2483
|
+
emoji: ""
|
|
2484
|
+
},
|
|
2485
|
+
profissional: {
|
|
2486
|
+
label: "Profissional",
|
|
2487
|
+
hint: "100% tecnico, sem referencias",
|
|
2488
|
+
emoji: ""
|
|
2489
|
+
},
|
|
2490
|
+
nerd: {
|
|
2491
|
+
label: "Nerd",
|
|
2492
|
+
hint: "Star Trek, vim jokes, deep tech",
|
|
2493
|
+
emoji: ""
|
|
2494
|
+
},
|
|
2495
|
+
chill: {
|
|
2496
|
+
label: "Chill",
|
|
2497
|
+
hint: "Relaxado, vibes cafe, positivo",
|
|
2498
|
+
emoji: ""
|
|
2499
|
+
}
|
|
2500
|
+
};
|
|
2501
|
+
async function onboardDev() {
|
|
2502
|
+
console.log();
|
|
2503
|
+
console.log(import_picocolors6.default.cyan(" Lola - Onboarding"));
|
|
2504
|
+
console.log(import_picocolors6.default.dim(" ================="));
|
|
2505
|
+
console.log();
|
|
2506
|
+
if (!existsSync2(LOLA_DIR)) {
|
|
2507
|
+
console.log(import_picocolors6.default.yellow(" Lola nao instalada. Instalando primeiro..."));
|
|
2508
|
+
console.log();
|
|
2509
|
+
await installLola();
|
|
2510
|
+
console.log();
|
|
2511
|
+
}
|
|
2512
|
+
const gitUser = Bun.spawnSync(["git", "config", "user.name"], { stdout: "pipe" });
|
|
2513
|
+
const defaultName = gitUser.stdout.toString().trim() || "";
|
|
2514
|
+
Ie(import_picocolors6.default.bgCyan(import_picocolors6.default.black(" Bem-vindo a nimbuslab! ")));
|
|
2515
|
+
const devName = await he({
|
|
2516
|
+
message: "Qual seu nome?",
|
|
2517
|
+
placeholder: "Seu nome",
|
|
2518
|
+
initialValue: defaultName,
|
|
2519
|
+
validate: (v2) => v2 ? undefined : "Nome e obrigatorio"
|
|
2520
|
+
});
|
|
2521
|
+
if (pD(devName)) {
|
|
2522
|
+
xe("Onboarding cancelado");
|
|
2523
|
+
process.exit(0);
|
|
2524
|
+
}
|
|
2525
|
+
const profile = await ve({
|
|
2526
|
+
message: "Qual perfil da Lola voce prefere?",
|
|
2527
|
+
options: Object.entries(PROFILES).map(([value, { label, hint }]) => ({
|
|
2528
|
+
value,
|
|
2529
|
+
label,
|
|
2530
|
+
hint
|
|
2531
|
+
}))
|
|
2532
|
+
});
|
|
2533
|
+
if (pD(profile)) {
|
|
2534
|
+
xe("Onboarding cancelado");
|
|
2535
|
+
process.exit(0);
|
|
2536
|
+
}
|
|
2537
|
+
const claudeDir = join3(process.env.HOME || "~", ".claude");
|
|
2538
|
+
await Bun.$`mkdir -p ${claudeDir}`;
|
|
2539
|
+
const content = `# User Memory
|
|
2540
|
+
|
|
2541
|
+
Memoria persistente para sessoes Claude Code
|
|
2542
|
+
|
|
2543
|
+
---
|
|
2544
|
+
|
|
2545
|
+
## Dev
|
|
2546
|
+
|
|
2547
|
+
**Nome:** ${devName}
|
|
2548
|
+
**Maquina:** ${process.env.HOSTNAME || "local"}
|
|
2549
|
+
**Onboarding:** ${new Date().toISOString().split("T")[0]}
|
|
2550
|
+
|
|
2551
|
+
---
|
|
2552
|
+
|
|
2553
|
+
## Configuracoes da Lola
|
|
2554
|
+
|
|
2555
|
+
\`\`\`
|
|
2556
|
+
lola_profile: ${profile}
|
|
2557
|
+
\`\`\`
|
|
2558
|
+
|
|
2559
|
+
---
|
|
2560
|
+
|
|
2561
|
+
## Ultima Sessao
|
|
2562
|
+
|
|
2563
|
+
(sera preenchido automaticamente)
|
|
2564
|
+
|
|
2565
|
+
---
|
|
2566
|
+
`;
|
|
2567
|
+
await Bun.write(USER_MEMORY, content);
|
|
2568
|
+
Se(import_picocolors6.default.green("Onboarding concluido!"));
|
|
2569
|
+
console.log();
|
|
2570
|
+
console.log(import_picocolors6.default.bold(" Resumo:"));
|
|
2571
|
+
console.log(import_picocolors6.default.dim(" Nome: ") + import_picocolors6.default.white(devName));
|
|
2572
|
+
console.log(import_picocolors6.default.dim(" Perfil: ") + import_picocolors6.default.white(PROFILES[profile].label));
|
|
2573
|
+
console.log();
|
|
2574
|
+
console.log(import_picocolors6.default.bold(" Proximos passos:"));
|
|
2575
|
+
console.log(import_picocolors6.default.dim(" 1. ") + import_picocolors6.default.white("lola") + import_picocolors6.default.dim(" - Iniciar sessao com a Lola"));
|
|
2576
|
+
console.log(import_picocolors6.default.dim(" 2. ") + import_picocolors6.default.white("nimbus create meu-projeto --fast") + import_picocolors6.default.dim(" - Criar projeto"));
|
|
2577
|
+
console.log(import_picocolors6.default.dim(" 3. ") + import_picocolors6.default.white('lola suggest "sua ideia"') + import_picocolors6.default.dim(" - Sugerir melhoria"));
|
|
2578
|
+
console.log();
|
|
2579
|
+
console.log(import_picocolors6.default.dim(" Docs: ~/.lola/README.md"));
|
|
2580
|
+
console.log();
|
|
2581
|
+
}
|
|
2429
2582
|
async function lola(args) {
|
|
2430
2583
|
const subcommand = args[0];
|
|
2431
2584
|
if (!subcommand || subcommand === "install" || subcommand === "sync") {
|
|
2432
2585
|
await installLola();
|
|
2586
|
+
} else if (subcommand === "onboard") {
|
|
2587
|
+
await onboardDev();
|
|
2433
2588
|
} else if (subcommand === "suggest") {
|
|
2434
2589
|
const message = args.slice(1).join(" ");
|
|
2435
2590
|
await suggestImprovement(message);
|
|
@@ -2450,18 +2605,21 @@ function showLolaHelp() {
|
|
|
2450
2605
|
console.log(import_picocolors6.default.bold(" Subcomandos:"));
|
|
2451
2606
|
console.log(import_picocolors6.default.dim(" install ") + import_picocolors6.default.white("Instalar/atualizar Lola"));
|
|
2452
2607
|
console.log(import_picocolors6.default.dim(" sync ") + import_picocolors6.default.white("Alias para install"));
|
|
2608
|
+
console.log(import_picocolors6.default.dim(" onboard ") + import_picocolors6.default.white("Configurar perfil (novos devs)"));
|
|
2453
2609
|
console.log(import_picocolors6.default.dim(' suggest "msg" ') + import_picocolors6.default.white("Sugerir melhoria (cria issue)"));
|
|
2454
2610
|
console.log(import_picocolors6.default.dim(" help ") + import_picocolors6.default.white("Mostrar esta ajuda"));
|
|
2455
2611
|
console.log();
|
|
2456
2612
|
console.log(import_picocolors6.default.bold(" Exemplos:"));
|
|
2457
2613
|
console.log(import_picocolors6.default.dim(" $ nimbus lola install"));
|
|
2614
|
+
console.log(import_picocolors6.default.dim(" $ nimbus lola onboard"));
|
|
2458
2615
|
console.log(import_picocolors6.default.dim(' $ nimbus lola suggest "adicionar suporte a X"'));
|
|
2459
2616
|
console.log();
|
|
2460
2617
|
}
|
|
2461
2618
|
|
|
2462
2619
|
// src/index.ts
|
|
2463
2620
|
var PACKAGE_NAME = "@nimbuslab/cli";
|
|
2464
|
-
var
|
|
2621
|
+
var pkg = await Promise.resolve().then(() => __toESM(require_package(), 1));
|
|
2622
|
+
var CURRENT_VERSION = pkg.version;
|
|
2465
2623
|
var LOGO = `
|
|
2466
2624
|
\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
2467
2625
|
\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
|
package/package.json
CHANGED
package/src/commands/lola.ts
CHANGED
|
@@ -165,11 +165,141 @@ ${message}
|
|
|
165
165
|
console.log()
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
const PROFILES = {
|
|
169
|
+
millennial: {
|
|
170
|
+
label: "Millennial",
|
|
171
|
+
hint: "Nerd 90s/2000s, DBZ, Matrix, MSN",
|
|
172
|
+
emoji: "",
|
|
173
|
+
},
|
|
174
|
+
genz: {
|
|
175
|
+
label: "Gen Z",
|
|
176
|
+
hint: "Direto, girias atuais, slay",
|
|
177
|
+
emoji: "",
|
|
178
|
+
},
|
|
179
|
+
profissional: {
|
|
180
|
+
label: "Profissional",
|
|
181
|
+
hint: "100% tecnico, sem referencias",
|
|
182
|
+
emoji: "",
|
|
183
|
+
},
|
|
184
|
+
nerd: {
|
|
185
|
+
label: "Nerd",
|
|
186
|
+
hint: "Star Trek, vim jokes, deep tech",
|
|
187
|
+
emoji: "",
|
|
188
|
+
},
|
|
189
|
+
chill: {
|
|
190
|
+
label: "Chill",
|
|
191
|
+
hint: "Relaxado, vibes cafe, positivo",
|
|
192
|
+
emoji: "",
|
|
193
|
+
},
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async function onboardDev(): Promise<void> {
|
|
197
|
+
console.log()
|
|
198
|
+
console.log(pc.cyan(" Lola - Onboarding"))
|
|
199
|
+
console.log(pc.dim(" ================="))
|
|
200
|
+
console.log()
|
|
201
|
+
|
|
202
|
+
// Verificar se Lola está instalada
|
|
203
|
+
if (!existsSync(LOLA_DIR)) {
|
|
204
|
+
console.log(pc.yellow(" Lola nao instalada. Instalando primeiro..."))
|
|
205
|
+
console.log()
|
|
206
|
+
await installLola()
|
|
207
|
+
console.log()
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Pegar nome do git config
|
|
211
|
+
const gitUser = Bun.spawnSync(["git", "config", "user.name"], { stdout: "pipe" })
|
|
212
|
+
const defaultName = gitUser.stdout.toString().trim() || ""
|
|
213
|
+
|
|
214
|
+
p.intro(pc.bgCyan(pc.black(" Bem-vindo a nimbuslab! ")))
|
|
215
|
+
|
|
216
|
+
// Nome do dev
|
|
217
|
+
const devName = await p.text({
|
|
218
|
+
message: "Qual seu nome?",
|
|
219
|
+
placeholder: "Seu nome",
|
|
220
|
+
initialValue: defaultName,
|
|
221
|
+
validate: (v) => v ? undefined : "Nome e obrigatorio",
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
if (p.isCancel(devName)) {
|
|
225
|
+
p.cancel("Onboarding cancelado")
|
|
226
|
+
process.exit(0)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Perfil preferido
|
|
230
|
+
const profile = await p.select({
|
|
231
|
+
message: "Qual perfil da Lola voce prefere?",
|
|
232
|
+
options: Object.entries(PROFILES).map(([value, { label, hint }]) => ({
|
|
233
|
+
value,
|
|
234
|
+
label,
|
|
235
|
+
hint,
|
|
236
|
+
})),
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
if (p.isCancel(profile)) {
|
|
240
|
+
p.cancel("Onboarding cancelado")
|
|
241
|
+
process.exit(0)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Atualizar USER_MEMORY.md
|
|
245
|
+
const claudeDir = join(process.env.HOME || "~", ".claude")
|
|
246
|
+
await Bun.$`mkdir -p ${claudeDir}`
|
|
247
|
+
|
|
248
|
+
const content = `# User Memory
|
|
249
|
+
|
|
250
|
+
Memoria persistente para sessoes Claude Code
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Dev
|
|
255
|
+
|
|
256
|
+
**Nome:** ${devName}
|
|
257
|
+
**Maquina:** ${process.env.HOSTNAME || "local"}
|
|
258
|
+
**Onboarding:** ${new Date().toISOString().split("T")[0]}
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Configuracoes da Lola
|
|
263
|
+
|
|
264
|
+
\`\`\`
|
|
265
|
+
lola_profile: ${profile}
|
|
266
|
+
\`\`\`
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Ultima Sessao
|
|
271
|
+
|
|
272
|
+
(sera preenchido automaticamente)
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
`
|
|
276
|
+
|
|
277
|
+
await Bun.write(USER_MEMORY, content)
|
|
278
|
+
|
|
279
|
+
p.outro(pc.green("Onboarding concluido!"))
|
|
280
|
+
|
|
281
|
+
// Resumo
|
|
282
|
+
console.log()
|
|
283
|
+
console.log(pc.bold(" Resumo:"))
|
|
284
|
+
console.log(pc.dim(" Nome: ") + pc.white(devName as string))
|
|
285
|
+
console.log(pc.dim(" Perfil: ") + pc.white(PROFILES[profile as keyof typeof PROFILES].label))
|
|
286
|
+
console.log()
|
|
287
|
+
console.log(pc.bold(" Proximos passos:"))
|
|
288
|
+
console.log(pc.dim(" 1. ") + pc.white("lola") + pc.dim(" - Iniciar sessao com a Lola"))
|
|
289
|
+
console.log(pc.dim(" 2. ") + pc.white("nimbus create meu-projeto --fast") + pc.dim(" - Criar projeto"))
|
|
290
|
+
console.log(pc.dim(" 3. ") + pc.white("lola suggest \"sua ideia\"") + pc.dim(" - Sugerir melhoria"))
|
|
291
|
+
console.log()
|
|
292
|
+
console.log(pc.dim(" Docs: ~/.lola/README.md"))
|
|
293
|
+
console.log()
|
|
294
|
+
}
|
|
295
|
+
|
|
168
296
|
export async function lola(args: string[]) {
|
|
169
297
|
const subcommand = args[0]
|
|
170
298
|
|
|
171
299
|
if (!subcommand || subcommand === "install" || subcommand === "sync") {
|
|
172
300
|
await installLola()
|
|
301
|
+
} else if (subcommand === "onboard") {
|
|
302
|
+
await onboardDev()
|
|
173
303
|
} else if (subcommand === "suggest") {
|
|
174
304
|
const message = args.slice(1).join(" ")
|
|
175
305
|
await suggestImprovement(message)
|
|
@@ -191,11 +321,13 @@ function showLolaHelp() {
|
|
|
191
321
|
console.log(pc.bold(" Subcomandos:"))
|
|
192
322
|
console.log(pc.dim(" install ") + pc.white("Instalar/atualizar Lola"))
|
|
193
323
|
console.log(pc.dim(" sync ") + pc.white("Alias para install"))
|
|
324
|
+
console.log(pc.dim(" onboard ") + pc.white("Configurar perfil (novos devs)"))
|
|
194
325
|
console.log(pc.dim(" suggest \"msg\" ") + pc.white("Sugerir melhoria (cria issue)"))
|
|
195
326
|
console.log(pc.dim(" help ") + pc.white("Mostrar esta ajuda"))
|
|
196
327
|
console.log()
|
|
197
328
|
console.log(pc.bold(" Exemplos:"))
|
|
198
329
|
console.log(pc.dim(" $ nimbus lola install"))
|
|
330
|
+
console.log(pc.dim(" $ nimbus lola onboard"))
|
|
199
331
|
console.log(pc.dim(" $ nimbus lola suggest \"adicionar suporte a X\""))
|
|
200
332
|
console.log()
|
|
201
333
|
}
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,10 @@ import { upgrade } from "./commands/upgrade"
|
|
|
8
8
|
import { lola } from "./commands/lola"
|
|
9
9
|
|
|
10
10
|
const PACKAGE_NAME = "@nimbuslab/cli"
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
// Lê versão do package.json em runtime
|
|
13
|
+
const pkg = await import("../package.json")
|
|
14
|
+
const CURRENT_VERSION = pkg.version
|
|
12
15
|
|
|
13
16
|
const LOGO = `
|
|
14
17
|
███╗ ██╗██╗███╗ ███╗██████╗ ██╗ ██╗███████╗
|