@nimbuslab/cli 0.13.2 → 0.13.4
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 +54 -29
- package/package.json +1 -1
- package/src/commands/lola.ts +72 -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.4",
|
|
154
154
|
description: "CLI para criar projetos nimbuslab",
|
|
155
155
|
type: "module",
|
|
156
156
|
bin: {
|
|
@@ -2508,28 +2508,55 @@ 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 ps5ProfileDir = join3(HOME, "Documents", "WindowsPowerShell");
|
|
2516
|
+
const ps7ProfileDir = join3(HOME, "Documents", "PowerShell");
|
|
2517
|
+
const profileName = "Microsoft.PowerShell_profile.ps1";
|
|
2518
|
+
const lolaFunction = `
|
|
2519
|
+
# Lola - Code Agent da nimbuslab
|
|
2520
|
+
function lola {
|
|
2521
|
+
param([Parameter(ValueFromRemainingArguments=$true)]$args)
|
|
2522
|
+
$agent = "$env:USERPROFILE\\.lola\\agents\\claude.md"
|
|
2523
|
+
if (Test-Path $agent) {
|
|
2524
|
+
claude --append-system-prompt-file $agent @args
|
|
2525
|
+
} else {
|
|
2526
|
+
Write-Host "Agente Lola nao encontrado. Rode: nimbus lola install"
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2530
2529
|
`;
|
|
2531
|
-
|
|
2530
|
+
const profiles = [
|
|
2531
|
+
{ dir: ps5ProfileDir, name: "PowerShell 5.x" },
|
|
2532
|
+
{ dir: ps7ProfileDir, name: "PowerShell 7+" }
|
|
2533
|
+
];
|
|
2534
|
+
let addedToAny = false;
|
|
2535
|
+
for (const { dir, name } of profiles) {
|
|
2536
|
+
const profilePath = join3(dir, profileName);
|
|
2537
|
+
if (!existsSync2(dir)) {
|
|
2538
|
+
await Bun.$`mkdir -p ${dir}`;
|
|
2539
|
+
}
|
|
2540
|
+
let profileContent = "";
|
|
2541
|
+
if (existsSync2(profilePath)) {
|
|
2542
|
+
profileContent = await Bun.file(profilePath).text();
|
|
2543
|
+
}
|
|
2544
|
+
if (!profileContent.includes("function lola")) {
|
|
2545
|
+
await Bun.write(profilePath, profileContent + lolaFunction);
|
|
2546
|
+
console.log(import_picocolors7.default.green(` Funcao lola adicionada ao ${name} profile`));
|
|
2547
|
+
addedToAny = true;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
if (addedToAny) {
|
|
2551
|
+
console.log(import_picocolors7.default.yellow(" Reinicie o PowerShell para usar o comando 'lola'"));
|
|
2532
2552
|
} else {
|
|
2553
|
+
console.log(import_picocolors7.default.green(" Funcao lola ja existe nos profiles do PowerShell"));
|
|
2554
|
+
}
|
|
2555
|
+
} else {
|
|
2556
|
+
const binDir = join3(HOME, ".local", "bin");
|
|
2557
|
+
const lolaScript = join3(binDir, "lola");
|
|
2558
|
+
if (!existsSync2(lolaScript)) {
|
|
2559
|
+
await Bun.$`mkdir -p ${binDir}`;
|
|
2533
2560
|
const unixScript = `#!/bin/bash
|
|
2534
2561
|
# lola - Code Agent da nimbuslab
|
|
2535
2562
|
LOLA_AGENT="${lolaAgent}"
|
|
@@ -2552,18 +2579,16 @@ fi
|
|
|
2552
2579
|
`;
|
|
2553
2580
|
await Bun.write(lolaScript, unixScript);
|
|
2554
2581
|
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 {
|
|
2582
|
+
console.log(import_picocolors7.default.green(` Script lola criado em ${lolaScript}`));
|
|
2583
|
+
const pathEnv = process.env.PATH || "";
|
|
2584
|
+
if (!pathEnv.includes(".local/bin")) {
|
|
2585
|
+
console.log();
|
|
2586
|
+
console.log(import_picocolors7.default.yellow(" IMPORTANTE: Adicione ~/.local/bin ao seu PATH"));
|
|
2564
2587
|
console.log(import_picocolors7.default.dim(" Adicione ao seu ~/.bashrc ou ~/.zshrc:"));
|
|
2565
2588
|
console.log(import_picocolors7.default.dim(' export PATH="$HOME/.local/bin:$PATH"'));
|
|
2566
2589
|
}
|
|
2590
|
+
} else {
|
|
2591
|
+
console.log(import_picocolors7.default.green(" Script lola ja existe"));
|
|
2567
2592
|
}
|
|
2568
2593
|
}
|
|
2569
2594
|
const claudeDir = join3(HOME, ".claude");
|
package/package.json
CHANGED
package/src/commands/lola.ts
CHANGED
|
@@ -50,35 +50,75 @@ 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
|
+
// PowerShell 5.x usa WindowsPowerShell, PowerShell 7+ usa PowerShell
|
|
63
|
+
const ps5ProfileDir = join(HOME, "Documents", "WindowsPowerShell")
|
|
64
|
+
const ps7ProfileDir = join(HOME, "Documents", "PowerShell")
|
|
65
|
+
const profileName = "Microsoft.PowerShell_profile.ps1"
|
|
66
|
+
|
|
67
|
+
const lolaFunction = `
|
|
68
|
+
# Lola - Code Agent da nimbuslab
|
|
69
|
+
function lola {
|
|
70
|
+
param([Parameter(ValueFromRemainingArguments=$true)]$args)
|
|
71
|
+
$agent = "$env:USERPROFILE\\.lola\\agents\\claude.md"
|
|
72
|
+
if (Test-Path $agent) {
|
|
73
|
+
claude --append-system-prompt-file $agent @args
|
|
74
|
+
} else {
|
|
75
|
+
Write-Host "Agente Lola nao encontrado. Rode: nimbus lola install"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
78
|
`
|
|
79
|
-
|
|
79
|
+
|
|
80
|
+
// Adicionar função em ambos os profiles (PS 5.x e 7+)
|
|
81
|
+
const profiles = [
|
|
82
|
+
{ dir: ps5ProfileDir, name: "PowerShell 5.x" },
|
|
83
|
+
{ dir: ps7ProfileDir, name: "PowerShell 7+" },
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
let addedToAny = false
|
|
87
|
+
|
|
88
|
+
for (const { dir, name } of profiles) {
|
|
89
|
+
const profilePath = join(dir, profileName)
|
|
90
|
+
|
|
91
|
+
// Criar diretório se não existir
|
|
92
|
+
if (!existsSync(dir)) {
|
|
93
|
+
await Bun.$`mkdir -p ${dir}`
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Verificar se já tem a função no profile
|
|
97
|
+
let profileContent = ""
|
|
98
|
+
if (existsSync(profilePath)) {
|
|
99
|
+
profileContent = await Bun.file(profilePath).text()
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (!profileContent.includes("function lola")) {
|
|
103
|
+
await Bun.write(profilePath, profileContent + lolaFunction)
|
|
104
|
+
console.log(pc.green(` Funcao lola adicionada ao ${name} profile`))
|
|
105
|
+
addedToAny = true
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (addedToAny) {
|
|
110
|
+
console.log(pc.yellow(" Reinicie o PowerShell para usar o comando 'lola'"))
|
|
80
111
|
} else {
|
|
81
|
-
|
|
112
|
+
console.log(pc.green(" Funcao lola ja existe nos profiles do PowerShell"))
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
// Linux/macOS: criar script em ~/.local/bin
|
|
116
|
+
const binDir = join(HOME, ".local", "bin")
|
|
117
|
+
const lolaScript = join(binDir, "lola")
|
|
118
|
+
|
|
119
|
+
if (!existsSync(lolaScript)) {
|
|
120
|
+
await Bun.$`mkdir -p ${binDir}`
|
|
121
|
+
|
|
82
122
|
const unixScript = `#!/bin/bash
|
|
83
123
|
# lola - Code Agent da nimbuslab
|
|
84
124
|
LOLA_AGENT="${lolaAgent}"
|
|
@@ -101,21 +141,19 @@ fi
|
|
|
101
141
|
`
|
|
102
142
|
await Bun.write(lolaScript, unixScript)
|
|
103
143
|
await Bun.$`chmod +x ${lolaScript}`
|
|
104
|
-
}
|
|
105
144
|
|
|
106
|
-
|
|
145
|
+
console.log(pc.green(` Script lola criado em ${lolaScript}`))
|
|
107
146
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (isWindows) {
|
|
114
|
-
console.log(pc.dim(" PowerShell: $env:PATH += \";$env:USERPROFILE\\.local\\bin\""))
|
|
115
|
-
} else {
|
|
147
|
+
// Verificar se ~/.local/bin está no PATH
|
|
148
|
+
const pathEnv = process.env.PATH || ""
|
|
149
|
+
if (!pathEnv.includes(".local/bin")) {
|
|
150
|
+
console.log()
|
|
151
|
+
console.log(pc.yellow(" IMPORTANTE: Adicione ~/.local/bin ao seu PATH"))
|
|
116
152
|
console.log(pc.dim(" Adicione ao seu ~/.bashrc ou ~/.zshrc:"))
|
|
117
153
|
console.log(pc.dim(" export PATH=\"$HOME/.local/bin:$PATH\""))
|
|
118
154
|
}
|
|
155
|
+
} else {
|
|
156
|
+
console.log(pc.green(" Script lola ja existe"))
|
|
119
157
|
}
|
|
120
158
|
}
|
|
121
159
|
|