@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 +42 -29
- package/package.json +1 -1
- package/src/commands/lola.ts +54 -34
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.
|
|
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
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
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
package/src/commands/lola.ts
CHANGED
|
@@ -50,35 +50,57 @@ async function installLola(): Promise<void> {
|
|
|
50
50
|
console.log(pc.green(" Instalado!"))
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
// Criar
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
127
|
+
console.log(pc.green(` Script lola criado em ${lolaScript}`))
|
|
107
128
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
|