Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

chore(cli): update package.json and build script for unified CLI

Jiayuanc35ffb1f80da
diff --git a/package.json b/package.json
index d1d4b72014..66d593d0fb 100644
--- a/package.json
+++ b/package.json
@@ -5,24 +5,17 @@
"type": "module",
"main": "dist/index.js",
"bin": {
- "multica": "./bin/multica-interactive.mjs",
- "multica-interactive": "./bin/multica-interactive.mjs",
- "multica-cli": "./bin/multica-cli.mjs",
- "multica-profile": "./bin/multica-profile.mjs",
- "multica-credentials": "./bin/multica-credentials.mjs"
+ "multica": "./bin/multica.mjs",
+ "mu": "./bin/multica.mjs"
},
"scripts": {
- "dev": "concurrently -n gateway,console,web -c blue,yellow,green \"pnpm dev:gateway\" \"pnpm dev:console\" \"pnpm dev:web\"",
- "agent:cli": "tsx src/agent/cli/non-interactive.ts",
- "agent:interactive": "tsx src/agent/cli/interactive.ts",
- "agent:profile": "tsx src/agent/cli/profile.ts",
- "credentials:cli": "tsx src/agent/credentials-cli.ts",
- "skills:cli": "tsx src/agent/cli/skills.ts",
- "tools:cli": "tsx src/agent/cli/tools.ts",
- "dev:gateway": "tsx --watch src/gateway/main.ts",
- "dev:console": "tsx --watch src/console/main.ts",
- "dev:web": "pnpm --filter @multica/web dev",
- "dev:desktop": "pnpm --filter @multica/desktop dev",
+ "multica": "tsx src/agent/cli/index.ts",
+ "mu": "tsx src/agent/cli/index.ts",
+ "dev": "tsx src/agent/cli/index.ts dev",
+ "dev:gateway": "tsx src/agent/cli/index.ts dev gateway",
+ "dev:console": "tsx src/agent/cli/index.ts dev console",
+ "dev:web": "tsx src/agent/cli/index.ts dev web",
+ "dev:desktop": "tsx src/agent/cli/index.ts dev desktop",
"build": "turbo build",
"build:sdk": "pnpm --filter @multica/sdk build",
"build:cli": "node scripts/build-cli.js",
diff --git a/scripts/build-cli.js b/scripts/build-cli.js
index 8c85fa211d..3df78e4bf7 100644
--- a/scripts/build-cli.js
+++ b/scripts/build-cli.js
@@ -28,44 +28,48 @@ const stripShebangPlugin = {
};
async function build() {
- const entryPoints = [
- { entry: "src/agent/cli/interactive.ts", outfile: "bin/multica-interactive.mjs" },
- { entry: "src/agent/cli/non-interactive.ts", outfile: "bin/multica-cli.mjs" },
- { entry: "src/agent/cli/profile.ts", outfile: "bin/multica-profile.mjs" },
- { entry: "src/agent/credentials-cli.ts", outfile: "bin/multica-credentials.mjs" },
- ];
+ // Unified CLI entry point
+ const entryPoint = {
+ entry: "src/agent/cli/index.ts",
+ outfile: "bin/multica.mjs",
+ };
- for (const { entry, outfile } of entryPoints) {
- console.log(`Building ${entry} -> ${outfile}...`);
+ console.log(`Building ${entryPoint.entry} -> ${entryPoint.outfile}...`);
- await esbuild.build({
- entryPoints: [resolve(rootDir, entry)],
- outfile: resolve(rootDir, outfile),
- bundle: true,
- platform: "node",
- target: "node20",
- format: "esm",
- banner: {
- js: "#!/usr/bin/env node",
- },
- plugins: [stripShebangPlugin],
- sourcemap: true,
- minify: false,
- // Externalize all dependencies - they will be loaded from node_modules at runtime
- external: allDeps,
- });
+ await esbuild.build({
+ entryPoints: [resolve(rootDir, entryPoint.entry)],
+ outfile: resolve(rootDir, entryPoint.outfile),
+ bundle: true,
+ platform: "node",
+ target: "node20",
+ format: "esm",
+ banner: {
+ js: "#!/usr/bin/env node",
+ },
+ plugins: [stripShebangPlugin],
+ sourcemap: true,
+ minify: false,
+ // Externalize all dependencies - they will be loaded from node_modules at runtime
+ external: allDeps,
+ });
- // Make executable
- chmodSync(resolve(rootDir, outfile), 0o755);
- console.log(` ✓ ${outfile}`);
- }
+ // Make executable
+ chmodSync(resolve(rootDir, entryPoint.outfile), 0o755);
+ console.log(` ✓ ${entryPoint.outfile}`);
- console.log("\nBuild complete! Binaries are in ./bin/");
+ console.log("\nBuild complete! Binary is in ./bin/");
console.log("\nUsage:");
- console.log(" node bin/multica-interactive.mjs # Interactive CLI");
- console.log(" node bin/multica-cli.mjs # Non-interactive CLI");
- console.log(" node bin/multica-profile.mjs # Profile management");
- console.log("\nNote: The built binaries require node_modules to be present.");
+ console.log(" multica # Interactive mode (default)");
+ console.log(" multica run <prompt> # Run a single prompt");
+ console.log(" multica chat # Interactive mode");
+ console.log(" multica session list # List sessions");
+ console.log(" multica profile list # List profiles");
+ console.log(" multica skills list # List skills");
+ console.log(" multica tools list # List tools");
+ console.log(" multica credentials init # Initialize credentials");
+ console.log(" multica dev # Start dev servers");
+ console.log(" multica help # Show help");
+ console.log("\nNote: The built binary requires node_modules to be present.");
console.log("Run 'pnpm install --prod' to install only production dependencies.");
}