@nimbuslab/cli 0.13.1 → 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 +73 -1
- package/package.json +1 -1
- package/src/commands/lola.ts +89 -0
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: {
|
|
@@ -2507,6 +2507,78 @@ async function installLola() {
|
|
|
2507
2507
|
}
|
|
2508
2508
|
console.log(import_picocolors7.default.green(" Instalado!"));
|
|
2509
2509
|
}
|
|
2510
|
+
const isWindows = process.platform === "win32";
|
|
2511
|
+
const lolaAgent = join3(LOLA_DIR, "agents", "claude.md");
|
|
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
|
+
}
|
|
2528
|
+
`;
|
|
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'"));
|
|
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}`;
|
|
2548
|
+
const unixScript = `#!/bin/bash
|
|
2549
|
+
# lola - Code Agent da nimbuslab
|
|
2550
|
+
LOLA_AGENT="${lolaAgent}"
|
|
2551
|
+
|
|
2552
|
+
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
|
2553
|
+
echo "lola - Code Agent da nimbuslab"
|
|
2554
|
+
echo "Uso: lola [args]"
|
|
2555
|
+
echo " lola Abre Claude CLI com a Lola"
|
|
2556
|
+
echo " lola --resume Resume sessao anterior"
|
|
2557
|
+
exit 0
|
|
2558
|
+
fi
|
|
2559
|
+
|
|
2560
|
+
if [[ -f "$LOLA_AGENT" ]]; then
|
|
2561
|
+
exec claude --append-system-prompt-file "$LOLA_AGENT" "$@"
|
|
2562
|
+
else
|
|
2563
|
+
echo "Agente Lola nao encontrado: $LOLA_AGENT"
|
|
2564
|
+
echo "Rode: nimbus lola install"
|
|
2565
|
+
exit 1
|
|
2566
|
+
fi
|
|
2567
|
+
`;
|
|
2568
|
+
await Bun.write(lolaScript, unixScript);
|
|
2569
|
+
await Bun.$`chmod +x ${lolaScript}`;
|
|
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"));
|
|
2575
|
+
console.log(import_picocolors7.default.dim(" Adicione ao seu ~/.bashrc ou ~/.zshrc:"));
|
|
2576
|
+
console.log(import_picocolors7.default.dim(' export PATH="$HOME/.local/bin:$PATH"'));
|
|
2577
|
+
}
|
|
2578
|
+
} else {
|
|
2579
|
+
console.log(import_picocolors7.default.green(" Script lola ja existe"));
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2510
2582
|
const claudeDir = join3(HOME, ".claude");
|
|
2511
2583
|
if (!existsSync2(USER_MEMORY)) {
|
|
2512
2584
|
console.log();
|
package/package.json
CHANGED
package/src/commands/lola.ts
CHANGED
|
@@ -50,6 +50,95 @@ async function installLola(): Promise<void> {
|
|
|
50
50
|
console.log(pc.green(" Instalado!"))
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
// Criar comando lola
|
|
54
|
+
const isWindows = process.platform === "win32"
|
|
55
|
+
const lolaAgent = join(LOLA_DIR, "agents", "claude.md")
|
|
56
|
+
|
|
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
|
+
}
|
|
76
|
+
`
|
|
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'"))
|
|
93
|
+
} else {
|
|
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
|
+
|
|
104
|
+
const unixScript = `#!/bin/bash
|
|
105
|
+
# lola - Code Agent da nimbuslab
|
|
106
|
+
LOLA_AGENT="${lolaAgent}"
|
|
107
|
+
|
|
108
|
+
if [[ "\$1" == "-h" || "\$1" == "--help" ]]; then
|
|
109
|
+
echo "lola - Code Agent da nimbuslab"
|
|
110
|
+
echo "Uso: lola [args]"
|
|
111
|
+
echo " lola Abre Claude CLI com a Lola"
|
|
112
|
+
echo " lola --resume Resume sessao anterior"
|
|
113
|
+
exit 0
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
if [[ -f "\$LOLA_AGENT" ]]; then
|
|
117
|
+
exec claude --append-system-prompt-file "\$LOLA_AGENT" "\$@"
|
|
118
|
+
else
|
|
119
|
+
echo "Agente Lola nao encontrado: \$LOLA_AGENT"
|
|
120
|
+
echo "Rode: nimbus lola install"
|
|
121
|
+
exit 1
|
|
122
|
+
fi
|
|
123
|
+
`
|
|
124
|
+
await Bun.write(lolaScript, unixScript)
|
|
125
|
+
await Bun.$`chmod +x ${lolaScript}`
|
|
126
|
+
|
|
127
|
+
console.log(pc.green(` Script lola criado em ${lolaScript}`))
|
|
128
|
+
|
|
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"))
|
|
134
|
+
console.log(pc.dim(" Adicione ao seu ~/.bashrc ou ~/.zshrc:"))
|
|
135
|
+
console.log(pc.dim(" export PATH=\"$HOME/.local/bin:$PATH\""))
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
console.log(pc.green(" Script lola ja existe"))
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
53
142
|
// Verificar USER_MEMORY.md
|
|
54
143
|
const claudeDir = join(HOME, ".claude")
|
|
55
144
|
if (!existsSync(USER_MEMORY)) {
|