@nimbuslab/cli 0.13.2 → 0.13.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/dist/index.js CHANGED
@@ -150,7 +150,7 @@ var require_src = __commonJS((exports, module) => {
150
150
  var require_package = __commonJS((exports, module) => {
151
151
  module.exports = {
152
152
  name: "@nimbuslab/cli",
153
- version: "0.13.2",
153
+ version: "0.13.3",
154
154
  description: "CLI para criar projetos nimbuslab",
155
155
  type: "module",
156
156
  bin: {
@@ -2508,28 +2508,43 @@ async function installLola() {
2508
2508
  console.log(import_picocolors7.default.green(" Instalado!"));
2509
2509
  }
2510
2510
  const isWindows = process.platform === "win32";
2511
- const binDir = join3(HOME, ".local", "bin");
2512
- const lolaScript = join3(binDir, isWindows ? "lola.cmd" : "lola");
2513
2511
  const lolaAgent = join3(LOLA_DIR, "agents", "claude.md");
2514
- if (!existsSync2(lolaScript)) {
2515
- console.log();
2516
- console.log(import_picocolors7.default.cyan(" Criando comando lola..."));
2517
- await Bun.$`mkdir -p ${binDir}`;
2518
- if (isWindows) {
2519
- const winScript = `@echo off
2520
- if "%1"=="-h" goto help
2521
- if "%1"=="--help" goto help
2522
- claude --append-system-prompt-file "${lolaAgent}" %*
2523
- goto end
2524
- :help
2525
- echo lola - Code Agent da nimbuslab
2526
- echo Uso: lola [args]
2527
- echo lola Abre Claude CLI com a Lola
2528
- echo lola --resume Resume sessao anterior
2529
- :end
2512
+ console.log();
2513
+ console.log(import_picocolors7.default.cyan(" Configurando comando lola..."));
2514
+ if (isWindows) {
2515
+ const psProfileDir = join3(HOME, "Documents", "PowerShell");
2516
+ const psProfile = join3(psProfileDir, "Microsoft.PowerShell_profile.ps1");
2517
+ const lolaFunction = `
2518
+ # Lola - Code Agent da nimbuslab
2519
+ function lola {
2520
+ param([Parameter(ValueFromRemainingArguments=$true)]$args)
2521
+ $agent = "$env:USERPROFILE\\.lola\\agents\\claude.md"
2522
+ if (Test-Path $agent) {
2523
+ claude --append-system-prompt-file $agent @args
2524
+ } else {
2525
+ Write-Host "Agente Lola nao encontrado. Rode: nimbus lola install"
2526
+ }
2527
+ }
2530
2528
  `;
2531
- await Bun.write(lolaScript, winScript);
2529
+ if (!existsSync2(psProfileDir)) {
2530
+ await Bun.$`mkdir -p ${psProfileDir}`;
2531
+ }
2532
+ let profileContent = "";
2533
+ if (existsSync2(psProfile)) {
2534
+ profileContent = await Bun.file(psProfile).text();
2535
+ }
2536
+ if (!profileContent.includes("function lola")) {
2537
+ await Bun.write(psProfile, profileContent + lolaFunction);
2538
+ console.log(import_picocolors7.default.green(" Funcao lola adicionada ao PowerShell profile"));
2539
+ console.log(import_picocolors7.default.yellow(" Reinicie o PowerShell para usar o comando 'lola'"));
2532
2540
  } else {
2541
+ console.log(import_picocolors7.default.green(" Funcao lola ja existe no PowerShell profile"));
2542
+ }
2543
+ } else {
2544
+ const binDir = join3(HOME, ".local", "bin");
2545
+ const lolaScript = join3(binDir, "lola");
2546
+ if (!existsSync2(lolaScript)) {
2547
+ await Bun.$`mkdir -p ${binDir}`;
2533
2548
  const unixScript = `#!/bin/bash
2534
2549
  # lola - Code Agent da nimbuslab
2535
2550
  LOLA_AGENT="${lolaAgent}"
@@ -2552,18 +2567,16 @@ fi
2552
2567
  `;
2553
2568
  await Bun.write(lolaScript, unixScript);
2554
2569
  await Bun.$`chmod +x ${lolaScript}`;
2555
- }
2556
- console.log(import_picocolors7.default.green(` Comando lola criado em ${lolaScript}`));
2557
- const pathEnv = process.env.PATH || "";
2558
- if (!pathEnv.includes(".local/bin")) {
2559
- console.log();
2560
- console.log(import_picocolors7.default.yellow(" IMPORTANTE: Adicione ~/.local/bin ao seu PATH"));
2561
- if (isWindows) {
2562
- console.log(import_picocolors7.default.dim(' PowerShell: $env:PATH += ";$env:USERPROFILE\\.local\\bin"'));
2563
- } else {
2570
+ console.log(import_picocolors7.default.green(` Script lola criado em ${lolaScript}`));
2571
+ const pathEnv = process.env.PATH || "";
2572
+ if (!pathEnv.includes(".local/bin")) {
2573
+ console.log();
2574
+ console.log(import_picocolors7.default.yellow(" IMPORTANTE: Adicione ~/.local/bin ao seu PATH"));
2564
2575
  console.log(import_picocolors7.default.dim(" Adicione ao seu ~/.bashrc ou ~/.zshrc:"));
2565
2576
  console.log(import_picocolors7.default.dim(' export PATH="$HOME/.local/bin:$PATH"'));
2566
2577
  }
2578
+ } else {
2579
+ console.log(import_picocolors7.default.green(" Script lola ja existe"));
2567
2580
  }
2568
2581
  }
2569
2582
  const claudeDir = join3(HOME, ".claude");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimbuslab/cli",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "description": "CLI para criar projetos nimbuslab",
5
5
  "type": "module",
6
6
  "bin": {
@@ -50,35 +50,57 @@ async function installLola(): Promise<void> {
50
50
  console.log(pc.green(" Instalado!"))
51
51
  }
52
52
 
53
- // Criar script lola em ~/.local/bin (Linux/macOS)
53
+ // Criar comando lola
54
54
  const isWindows = process.platform === "win32"
55
- const binDir = join(HOME, ".local", "bin")
56
- const lolaScript = join(binDir, isWindows ? "lola.cmd" : "lola")
57
55
  const lolaAgent = join(LOLA_DIR, "agents", "claude.md")
58
56
 
59
- if (!existsSync(lolaScript)) {
60
- console.log()
61
- console.log(pc.cyan(" Criando comando lola..."))
62
-
63
- await Bun.$`mkdir -p ${binDir}`
64
-
65
- if (isWindows) {
66
- // Windows batch script
67
- const winScript = `@echo off
68
- if "%1"=="-h" goto help
69
- if "%1"=="--help" goto help
70
- claude --append-system-prompt-file "${lolaAgent}" %*
71
- goto end
72
- :help
73
- echo lola - Code Agent da nimbuslab
74
- echo Uso: lola [args]
75
- echo lola Abre Claude CLI com a Lola
76
- echo lola --resume Resume sessao anterior
77
- :end
57
+ console.log()
58
+ console.log(pc.cyan(" Configurando comando lola..."))
59
+
60
+ if (isWindows) {
61
+ // Windows: adicionar função ao PowerShell profile
62
+ const psProfileDir = join(HOME, "Documents", "PowerShell")
63
+ const psProfile = join(psProfileDir, "Microsoft.PowerShell_profile.ps1")
64
+
65
+ const lolaFunction = `
66
+ # Lola - Code Agent da nimbuslab
67
+ function lola {
68
+ param([Parameter(ValueFromRemainingArguments=$true)]$args)
69
+ $agent = "$env:USERPROFILE\\.lola\\agents\\claude.md"
70
+ if (Test-Path $agent) {
71
+ claude --append-system-prompt-file $agent @args
72
+ } else {
73
+ Write-Host "Agente Lola nao encontrado. Rode: nimbus lola install"
74
+ }
75
+ }
78
76
  `
79
- await Bun.write(lolaScript, winScript)
77
+
78
+ // Criar diretório do profile se não existir
79
+ if (!existsSync(psProfileDir)) {
80
+ await Bun.$`mkdir -p ${psProfileDir}`
81
+ }
82
+
83
+ // Verificar se já tem a função no profile
84
+ let profileContent = ""
85
+ if (existsSync(psProfile)) {
86
+ profileContent = await Bun.file(psProfile).text()
87
+ }
88
+
89
+ if (!profileContent.includes("function lola")) {
90
+ await Bun.write(psProfile, profileContent + lolaFunction)
91
+ console.log(pc.green(" Funcao lola adicionada ao PowerShell profile"))
92
+ console.log(pc.yellow(" Reinicie o PowerShell para usar o comando 'lola'"))
80
93
  } else {
81
- // Unix shell script
94
+ console.log(pc.green(" Funcao lola ja existe no PowerShell profile"))
95
+ }
96
+ } else {
97
+ // Linux/macOS: criar script em ~/.local/bin
98
+ const binDir = join(HOME, ".local", "bin")
99
+ const lolaScript = join(binDir, "lola")
100
+
101
+ if (!existsSync(lolaScript)) {
102
+ await Bun.$`mkdir -p ${binDir}`
103
+
82
104
  const unixScript = `#!/bin/bash
83
105
  # lola - Code Agent da nimbuslab
84
106
  LOLA_AGENT="${lolaAgent}"
@@ -101,21 +123,19 @@ fi
101
123
  `
102
124
  await Bun.write(lolaScript, unixScript)
103
125
  await Bun.$`chmod +x ${lolaScript}`
104
- }
105
126
 
106
- console.log(pc.green(` Comando lola criado em ${lolaScript}`))
127
+ console.log(pc.green(` Script lola criado em ${lolaScript}`))
107
128
 
108
- // Verificar se ~/.local/bin está no PATH
109
- const pathEnv = process.env.PATH || ""
110
- if (!pathEnv.includes(".local/bin")) {
111
- console.log()
112
- console.log(pc.yellow(" IMPORTANTE: Adicione ~/.local/bin ao seu PATH"))
113
- if (isWindows) {
114
- console.log(pc.dim(" PowerShell: $env:PATH += \";$env:USERPROFILE\\.local\\bin\""))
115
- } else {
129
+ // Verificar se ~/.local/bin está no PATH
130
+ const pathEnv = process.env.PATH || ""
131
+ if (!pathEnv.includes(".local/bin")) {
132
+ console.log()
133
+ console.log(pc.yellow(" IMPORTANTE: Adicione ~/.local/bin ao seu PATH"))
116
134
  console.log(pc.dim(" Adicione ao seu ~/.bashrc ou ~/.zshrc:"))
117
135
  console.log(pc.dim(" export PATH=\"$HOME/.local/bin:$PATH\""))
118
136
  }
137
+ } else {
138
+ console.log(pc.green(" Script lola ja existe"))
119
139
  }
120
140
  }
121
141