bravecode-cli 0.1.0 ā 0.1.1
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/package.json +2 -1
- package/scripts/build.js +18 -0
- package/scripts/postinstall.js +70 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bravecode-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Agentic AI vibe coding CLI with free model support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/**/*",
|
|
12
|
+
"scripts/**/*",
|
|
12
13
|
"README.md",
|
|
13
14
|
"LICENSE"
|
|
14
15
|
],
|
package/scripts/build.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { build } from "esbuild";
|
|
2
|
+
|
|
3
|
+
await build({
|
|
4
|
+
entryPoints: ["src/cli.ts"],
|
|
5
|
+
bundle: true,
|
|
6
|
+
platform: "node",
|
|
7
|
+
target: "node18",
|
|
8
|
+
outfile: "dist/cli.cjs",
|
|
9
|
+
format: "cjs",
|
|
10
|
+
banner: {
|
|
11
|
+
js: '#!/usr/bin/env node',
|
|
12
|
+
},
|
|
13
|
+
sourcemap: true,
|
|
14
|
+
minify: false,
|
|
15
|
+
external: ["react-devtools-core", "ink", "ink-text-input", "react", "yoga-layout"],
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
console.log("Build completed successfully!");
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync } from "fs";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
import { homedir } from "os";
|
|
6
|
+
|
|
7
|
+
const configDir = join(homedir(), ".bravecode");
|
|
8
|
+
const configFile = join(configDir, "config.json");
|
|
9
|
+
const lastUpdateFile = join(configDir, "last-update-check");
|
|
10
|
+
|
|
11
|
+
function setup() {
|
|
12
|
+
console.log("š§ Setting up BraveCode AI...");
|
|
13
|
+
|
|
14
|
+
if (!existsSync(configDir)) {
|
|
15
|
+
mkdirSync(configDir, { recursive: true });
|
|
16
|
+
console.log("ā Created config directory:", configDir);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (!existsSync(configFile)) {
|
|
20
|
+
const defaultConfig = {
|
|
21
|
+
version: "0.1.0",
|
|
22
|
+
provider: {
|
|
23
|
+
default: "bravecode",
|
|
24
|
+
baseUrl: "https://codero.sohailsyed.com/api/chat",
|
|
25
|
+
},
|
|
26
|
+
model: {
|
|
27
|
+
default: "codestral-latest",
|
|
28
|
+
autoSelect: true,
|
|
29
|
+
preferred: ["codestral-latest", "mistral-large-2512", "DeepSeek-V3"],
|
|
30
|
+
},
|
|
31
|
+
agent: {
|
|
32
|
+
default: "build",
|
|
33
|
+
autoApprove: false,
|
|
34
|
+
maxIterations: 20,
|
|
35
|
+
},
|
|
36
|
+
permissions: {
|
|
37
|
+
bash: "ask",
|
|
38
|
+
edit: "ask",
|
|
39
|
+
write: "ask",
|
|
40
|
+
browser: "allow",
|
|
41
|
+
},
|
|
42
|
+
ui: {
|
|
43
|
+
theme: "auto",
|
|
44
|
+
showTokens: false,
|
|
45
|
+
streamingEnabled: true,
|
|
46
|
+
},
|
|
47
|
+
snapshot: {
|
|
48
|
+
enabled: true,
|
|
49
|
+
autoSnapshot: true,
|
|
50
|
+
},
|
|
51
|
+
telemetry: false,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
writeFileSync(configFile, JSON.stringify(defaultConfig, null, 2));
|
|
55
|
+
console.log("ā Created default config:", configFile);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!existsSync(lastUpdateFile)) {
|
|
59
|
+
writeFileSync(lastUpdateFile, Date.now().toString());
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
console.log("\n⨠BraveCode AI is ready!");
|
|
63
|
+
console.log("\nQuick start:");
|
|
64
|
+
console.log(" bravecode init # Initialize in your project");
|
|
65
|
+
console.log(" bravecode chat 'hello' # Start chatting");
|
|
66
|
+
console.log(" bravecode run 'fix this bug' # Run with tools");
|
|
67
|
+
console.log("\nDocs: https://bravecode.ai/docs");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
setup();
|