@locusai/cli 0.9.5 → 0.9.8

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.
Files changed (2) hide show
  1. package/bin/locus.js +72 -9
  2. package/package.json +2 -2
package/bin/locus.js CHANGED
@@ -42353,7 +42353,8 @@ var TOP_LEVEL_KEYS = [
42353
42353
  "apiUrl",
42354
42354
  "provider",
42355
42355
  "model",
42356
- "workspaceId"
42356
+ "workspaceId",
42357
+ "agentCount"
42357
42358
  ];
42358
42359
  var TELEGRAM_KEYS = [
42359
42360
  "telegram.botToken",
@@ -42377,6 +42378,7 @@ function showConfigHelp() {
42377
42378
  ${c.dim("--api-url <URL> API base URL (optional)")}
42378
42379
  ${c.dim("--provider <P> AI provider (optional)")}
42379
42380
  ${c.dim("--model <M> AI model (optional)")}
42381
+ ${c.dim("--agents <N> Number of agents (1-5, optional)")}
42380
42382
  ${c.success("show")} Show current settings
42381
42383
  ${c.success("set")} Set a config value
42382
42384
  ${c.dim("locus config set <key> <value>")}
@@ -42398,6 +42400,7 @@ async function setupCommand(args, projectPath) {
42398
42400
  let apiUrl;
42399
42401
  let provider;
42400
42402
  let model;
42403
+ let agentCountStr;
42401
42404
  for (let i = 0;i < args.length; i++) {
42402
42405
  if (args[i] === "--api-key" && args[i + 1]) {
42403
42406
  apiKey = args[++i]?.trim();
@@ -42407,9 +42410,11 @@ async function setupCommand(args, projectPath) {
42407
42410
  provider = args[++i]?.trim();
42408
42411
  } else if (args[i] === "--model" && args[i + 1]) {
42409
42412
  model = args[++i]?.trim();
42413
+ } else if (args[i] === "--agents" && args[i + 1]) {
42414
+ agentCountStr = args[++i]?.trim();
42410
42415
  }
42411
42416
  }
42412
- if (!apiKey && !apiUrl && !provider && !model) {
42417
+ if (!apiKey && !apiUrl && !provider && !model && !agentCountStr) {
42413
42418
  console.log(`
42414
42419
  ${c.header(" LOCUS SETUP ")}
42415
42420
  `);
@@ -42421,15 +42426,15 @@ async function setupCommand(args, projectPath) {
42421
42426
  console.log(` ${c.error("✖")} API key is required. Get one from ${c.underline("Workspace Settings > API Keys")}`);
42422
42427
  }
42423
42428
  }
42424
- apiUrl = await ask(` ${c.primary("API URL")} ${c.dim("(optional, press Enter to skip)")}: `);
42425
42429
  provider = await ask(` ${c.primary("Provider")} ${c.dim("(optional, e.g. claude, codex)")}: `);
42426
42430
  model = await ask(` ${c.primary("Model")} ${c.dim("(optional, e.g. opus, sonnet)")}: `);
42427
- if (!apiUrl)
42428
- apiUrl = undefined;
42431
+ agentCountStr = await ask(` ${c.primary("Agent Count")} ${c.dim("(optional, 1-5, default: 1)")}: `);
42429
42432
  if (!provider)
42430
42433
  provider = undefined;
42431
42434
  if (!model)
42432
42435
  model = undefined;
42436
+ if (!agentCountStr)
42437
+ agentCountStr = undefined;
42433
42438
  }
42434
42439
  if (!apiKey) {
42435
42440
  console.error(`
@@ -42438,6 +42443,17 @@ async function setupCommand(args, projectPath) {
42438
42443
  `);
42439
42444
  process.exit(1);
42440
42445
  }
42446
+ let agentCount;
42447
+ if (agentCountStr) {
42448
+ const parsed = Number.parseInt(agentCountStr, 10);
42449
+ if (Number.isNaN(parsed) || parsed < 1 || parsed > 5) {
42450
+ console.error(`
42451
+ ${c.error("✖")} ${c.bold("Agent count must be a number between 1 and 5.")}
42452
+ `);
42453
+ process.exit(1);
42454
+ }
42455
+ agentCount = parsed;
42456
+ }
42441
42457
  const manager = new SettingsManager(projectPath);
42442
42458
  const existing = manager.load();
42443
42459
  const settings = {
@@ -42450,6 +42466,8 @@ async function setupCommand(args, projectPath) {
42450
42466
  settings.provider = provider;
42451
42467
  if (model)
42452
42468
  settings.model = model;
42469
+ if (agentCount !== undefined)
42470
+ settings.agentCount = agentCount;
42453
42471
  manager.save(settings);
42454
42472
  console.log(`
42455
42473
  ${c.success("✔")} ${c.bold("Settings configured successfully!")}
@@ -42460,7 +42478,8 @@ async function setupCommand(args, projectPath) {
42460
42478
  ${c.primary("API Key:")} ${maskSecret(apiKey)}${apiUrl ? `
42461
42479
  ${c.primary("API URL:")} ${apiUrl}` : ""}${provider ? `
42462
42480
  ${c.primary("Provider:")} ${provider}` : ""}${model ? `
42463
- ${c.primary("Model:")} ${model}` : ""}
42481
+ ${c.primary("Model:")} ${model}` : ""}${agentCount !== undefined ? `
42482
+ ${c.primary("Agents:")} ${agentCount}` : ""}
42464
42483
 
42465
42484
  ${c.bold("Next steps:")}
42466
42485
  Run agents: ${c.primary("locus run")}
@@ -42496,6 +42515,9 @@ function showCommand(projectPath) {
42496
42515
  if (settings.workspaceId) {
42497
42516
  console.log(` ${c.primary("workspaceId:")} ${settings.workspaceId}`);
42498
42517
  }
42518
+ if (settings.agentCount !== undefined) {
42519
+ console.log(` ${c.primary("agentCount:")} ${settings.agentCount}`);
42520
+ }
42499
42521
  if (settings.telegram) {
42500
42522
  const tg = settings.telegram;
42501
42523
  console.log(`
@@ -42550,6 +42572,15 @@ function setCommand(args, projectPath) {
42550
42572
  } else {
42551
42573
  settings.telegram[telegramKey] = value;
42552
42574
  }
42575
+ } else if (key === "agentCount") {
42576
+ const num = Number.parseInt(value, 10);
42577
+ if (Number.isNaN(num) || num < 1 || num > 5) {
42578
+ console.error(`
42579
+ ${c.error("✖")} ${c.bold("agentCount must be a number between 1 and 5.")}
42580
+ `);
42581
+ process.exit(1);
42582
+ }
42583
+ settings[key] = num;
42553
42584
  } else {
42554
42585
  settings[key] = value;
42555
42586
  }
@@ -44066,6 +44097,7 @@ function showTelegramHelp() {
44066
44097
 
44067
44098
  ${c.header(" SUBCOMMANDS ")}
44068
44099
  ${c.success("run")} Start the Telegram bot
44100
+ ${c.dim("--agents <N> Override agent count (1-5)")}
44069
44101
  ${c.success("setup")} Interactive Telegram bot setup (or pass flags below)
44070
44102
  ${c.dim("--token <TOKEN> Bot token from @BotFather (required)")}
44071
44103
  ${c.dim("--chat-id <ID> Your Telegram chat ID (required)")}
@@ -44077,6 +44109,7 @@ function showTelegramHelp() {
44077
44109
 
44078
44110
  ${c.header(" EXAMPLES ")}
44079
44111
  ${c.dim("$")} ${c.primary("locus telegram run")}
44112
+ ${c.dim("$")} ${c.primary("locus telegram run --agents 3")}
44080
44113
  ${c.dim("$")} ${c.primary('locus telegram setup --token "123:ABC" --chat-id 987654')}
44081
44114
  ${c.dim("$")} ${c.primary("locus telegram config")}
44082
44115
  ${c.dim("$")} ${c.primary("locus telegram remove")}
@@ -44265,7 +44298,22 @@ function removeCommand2(projectPath) {
44265
44298
  ${c.success("✔")} ${c.bold("Telegram configuration removed.")}
44266
44299
  `);
44267
44300
  }
44268
- function runBotCommand(projectPath) {
44301
+ function runBotCommand(subArgs, projectPath) {
44302
+ let agentCountOverride;
44303
+ for (let i = 0;i < subArgs.length; i++) {
44304
+ if (subArgs[i] === "--agents" && subArgs[i + 1]) {
44305
+ agentCountOverride = subArgs[++i]?.trim();
44306
+ }
44307
+ }
44308
+ if (agentCountOverride) {
44309
+ const parsed = Number.parseInt(agentCountOverride, 10);
44310
+ if (Number.isNaN(parsed) || parsed < 1 || parsed > 5) {
44311
+ console.error(`
44312
+ ${c.error("✖")} ${c.bold("Agent count must be a number between 1 and 5.")}
44313
+ `);
44314
+ process.exit(1);
44315
+ }
44316
+ }
44269
44317
  const manager = new SettingsManager(projectPath);
44270
44318
  const settings = manager.load();
44271
44319
  if (!settings.telegram?.botToken || !settings.telegram?.chatId) {
@@ -44286,10 +44334,14 @@ function runBotCommand(projectPath) {
44286
44334
  cmd = "locus-telegram";
44287
44335
  args = [];
44288
44336
  }
44337
+ const env = { ...process.env };
44338
+ if (agentCountOverride) {
44339
+ env.LOCUS_AGENT_COUNT = agentCountOverride;
44340
+ }
44289
44341
  const child = spawn4(cmd, args, {
44290
44342
  cwd: projectPath,
44291
44343
  stdio: "inherit",
44292
- env: process.env
44344
+ env
44293
44345
  });
44294
44346
  child.on("error", (err) => {
44295
44347
  if (err.code === "ENOENT" && !isMonorepo) {
@@ -44314,7 +44366,7 @@ async function telegramCommand(args) {
44314
44366
  const subArgs = args.slice(1);
44315
44367
  switch (subcommand) {
44316
44368
  case "run":
44317
- runBotCommand(projectPath);
44369
+ runBotCommand(subArgs, projectPath);
44318
44370
  break;
44319
44371
  case "setup":
44320
44372
  await setupCommand2(subArgs, projectPath);
@@ -44362,6 +44414,17 @@ async function upgradeCommand() {
44362
44414
  console.log(`
44363
44415
  ${c.header(" UPGRADE ")}
44364
44416
  `);
44417
+ try {
44418
+ console.log(` ${c.dim("◌")} Cleaning npm cache...`);
44419
+ execSync3("npm cache clean --force", {
44420
+ stdio: ["pipe", "pipe", "pipe"]
44421
+ });
44422
+ console.log(` ${c.success("✔")} npm cache cleaned
44423
+ `);
44424
+ } catch {
44425
+ console.log(` ${c.dim("⚠")} Could not clean npm cache, continuing...
44426
+ `);
44427
+ }
44365
44428
  for (const pkg of PACKAGES) {
44366
44429
  const current = getInstalledVersion(pkg);
44367
44430
  const latest = getLatestVersion(pkg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locusai/cli",
3
- "version": "0.9.5",
3
+ "version": "0.9.8",
4
4
  "description": "CLI for Locus - AI-native project management platform",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,7 +32,7 @@
32
32
  "author": "",
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@locusai/sdk": "^0.9.5"
35
+ "@locusai/sdk": "^0.9.8"
36
36
  },
37
37
  "devDependencies": {}
38
38
  }