@nimbuslab/cli 0.13.0 → 0.13.2
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 +66 -5
- package/package.json +1 -1
- package/src/commands/lola.ts +75 -4
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.2",
|
|
154
154
|
description: "CLI para criar projetos nimbuslab",
|
|
155
155
|
type: "module",
|
|
156
156
|
bin: {
|
|
@@ -2470,9 +2470,11 @@ async function update(args) {
|
|
|
2470
2470
|
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
2471
2471
|
import { existsSync as existsSync2 } from "fs";
|
|
2472
2472
|
import { join as join3 } from "path";
|
|
2473
|
-
|
|
2473
|
+
import { homedir } from "os";
|
|
2474
|
+
var HOME = homedir();
|
|
2475
|
+
var LOLA_DIR = join3(HOME, ".lola");
|
|
2474
2476
|
var LOLA_REPO = "git@github.com:nimbuslab/lola.git";
|
|
2475
|
-
var USER_MEMORY = join3(
|
|
2477
|
+
var USER_MEMORY = join3(HOME, ".claude", "USER_MEMORY.md");
|
|
2476
2478
|
async function installLola() {
|
|
2477
2479
|
console.log();
|
|
2478
2480
|
console.log(import_picocolors7.default.cyan(" Lola - Code Agent da nimbuslab"));
|
|
@@ -2505,7 +2507,66 @@ async function installLola() {
|
|
|
2505
2507
|
}
|
|
2506
2508
|
console.log(import_picocolors7.default.green(" Instalado!"));
|
|
2507
2509
|
}
|
|
2508
|
-
const
|
|
2510
|
+
const isWindows = process.platform === "win32";
|
|
2511
|
+
const binDir = join3(HOME, ".local", "bin");
|
|
2512
|
+
const lolaScript = join3(binDir, isWindows ? "lola.cmd" : "lola");
|
|
2513
|
+
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
|
|
2530
|
+
`;
|
|
2531
|
+
await Bun.write(lolaScript, winScript);
|
|
2532
|
+
} else {
|
|
2533
|
+
const unixScript = `#!/bin/bash
|
|
2534
|
+
# lola - Code Agent da nimbuslab
|
|
2535
|
+
LOLA_AGENT="${lolaAgent}"
|
|
2536
|
+
|
|
2537
|
+
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
|
2538
|
+
echo "lola - Code Agent da nimbuslab"
|
|
2539
|
+
echo "Uso: lola [args]"
|
|
2540
|
+
echo " lola Abre Claude CLI com a Lola"
|
|
2541
|
+
echo " lola --resume Resume sessao anterior"
|
|
2542
|
+
exit 0
|
|
2543
|
+
fi
|
|
2544
|
+
|
|
2545
|
+
if [[ -f "$LOLA_AGENT" ]]; then
|
|
2546
|
+
exec claude --append-system-prompt-file "$LOLA_AGENT" "$@"
|
|
2547
|
+
else
|
|
2548
|
+
echo "Agente Lola nao encontrado: $LOLA_AGENT"
|
|
2549
|
+
echo "Rode: nimbus lola install"
|
|
2550
|
+
exit 1
|
|
2551
|
+
fi
|
|
2552
|
+
`;
|
|
2553
|
+
await Bun.write(lolaScript, unixScript);
|
|
2554
|
+
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 {
|
|
2564
|
+
console.log(import_picocolors7.default.dim(" Adicione ao seu ~/.bashrc ou ~/.zshrc:"));
|
|
2565
|
+
console.log(import_picocolors7.default.dim(' export PATH="$HOME/.local/bin:$PATH"'));
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
const claudeDir = join3(HOME, ".claude");
|
|
2509
2570
|
if (!existsSync2(USER_MEMORY)) {
|
|
2510
2571
|
console.log();
|
|
2511
2572
|
console.log(import_picocolors7.default.cyan(" Criando USER_MEMORY.md..."));
|
|
@@ -2672,7 +2733,7 @@ async function onboardDev() {
|
|
|
2672
2733
|
xe("Onboarding cancelado");
|
|
2673
2734
|
process.exit(0);
|
|
2674
2735
|
}
|
|
2675
|
-
const claudeDir = join3(
|
|
2736
|
+
const claudeDir = join3(HOME, ".claude");
|
|
2676
2737
|
await Bun.$`mkdir -p ${claudeDir}`;
|
|
2677
2738
|
const content = `# User Memory
|
|
2678
2739
|
|
package/package.json
CHANGED
package/src/commands/lola.ts
CHANGED
|
@@ -2,10 +2,12 @@ import * as p from "@clack/prompts"
|
|
|
2
2
|
import pc from "picocolors"
|
|
3
3
|
import { existsSync } from "node:fs"
|
|
4
4
|
import { join } from "node:path"
|
|
5
|
+
import { homedir } from "node:os"
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
+
const HOME = homedir()
|
|
8
|
+
const LOLA_DIR = join(HOME, ".lola")
|
|
7
9
|
const LOLA_REPO = "git@github.com:nimbuslab/lola.git"
|
|
8
|
-
const USER_MEMORY = join(
|
|
10
|
+
const USER_MEMORY = join(HOME, ".claude", "USER_MEMORY.md")
|
|
9
11
|
|
|
10
12
|
async function installLola(): Promise<void> {
|
|
11
13
|
console.log()
|
|
@@ -48,8 +50,77 @@ async function installLola(): Promise<void> {
|
|
|
48
50
|
console.log(pc.green(" Instalado!"))
|
|
49
51
|
}
|
|
50
52
|
|
|
53
|
+
// Criar script lola em ~/.local/bin (Linux/macOS)
|
|
54
|
+
const isWindows = process.platform === "win32"
|
|
55
|
+
const binDir = join(HOME, ".local", "bin")
|
|
56
|
+
const lolaScript = join(binDir, isWindows ? "lola.cmd" : "lola")
|
|
57
|
+
const lolaAgent = join(LOLA_DIR, "agents", "claude.md")
|
|
58
|
+
|
|
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
|
|
78
|
+
`
|
|
79
|
+
await Bun.write(lolaScript, winScript)
|
|
80
|
+
} else {
|
|
81
|
+
// Unix shell script
|
|
82
|
+
const unixScript = `#!/bin/bash
|
|
83
|
+
# lola - Code Agent da nimbuslab
|
|
84
|
+
LOLA_AGENT="${lolaAgent}"
|
|
85
|
+
|
|
86
|
+
if [[ "\$1" == "-h" || "\$1" == "--help" ]]; then
|
|
87
|
+
echo "lola - Code Agent da nimbuslab"
|
|
88
|
+
echo "Uso: lola [args]"
|
|
89
|
+
echo " lola Abre Claude CLI com a Lola"
|
|
90
|
+
echo " lola --resume Resume sessao anterior"
|
|
91
|
+
exit 0
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
if [[ -f "\$LOLA_AGENT" ]]; then
|
|
95
|
+
exec claude --append-system-prompt-file "\$LOLA_AGENT" "\$@"
|
|
96
|
+
else
|
|
97
|
+
echo "Agente Lola nao encontrado: \$LOLA_AGENT"
|
|
98
|
+
echo "Rode: nimbus lola install"
|
|
99
|
+
exit 1
|
|
100
|
+
fi
|
|
101
|
+
`
|
|
102
|
+
await Bun.write(lolaScript, unixScript)
|
|
103
|
+
await Bun.$`chmod +x ${lolaScript}`
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
console.log(pc.green(` Comando lola criado em ${lolaScript}`))
|
|
107
|
+
|
|
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 {
|
|
116
|
+
console.log(pc.dim(" Adicione ao seu ~/.bashrc ou ~/.zshrc:"))
|
|
117
|
+
console.log(pc.dim(" export PATH=\"$HOME/.local/bin:$PATH\""))
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
51
122
|
// Verificar USER_MEMORY.md
|
|
52
|
-
const claudeDir = join(
|
|
123
|
+
const claudeDir = join(HOME, ".claude")
|
|
53
124
|
if (!existsSync(USER_MEMORY)) {
|
|
54
125
|
console.log()
|
|
55
126
|
console.log(pc.cyan(" Criando USER_MEMORY.md..."))
|
|
@@ -242,7 +313,7 @@ async function onboardDev(): Promise<void> {
|
|
|
242
313
|
}
|
|
243
314
|
|
|
244
315
|
// Atualizar USER_MEMORY.md
|
|
245
|
-
const claudeDir = join(
|
|
316
|
+
const claudeDir = join(HOME, ".claude")
|
|
246
317
|
await Bun.$`mkdir -p ${claudeDir}`
|
|
247
318
|
|
|
248
319
|
const content = `# User Memory
|