@bike4mind/cli 4.8.0 → 4.10.0

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 (39) hide show
  1. package/README.md +21 -0
  2. package/bin/bike4mind-cli.mjs +342 -239
  3. package/dist/{AgentHistoryStore-Bvmcy2kf.mjs → AgentHistoryStore-CjGVgxLR.mjs} +305 -644
  4. package/dist/{ApiClient-Yp2LPlX3.mjs → ApiClient-SVXSI3HI.mjs} +3 -3
  5. package/dist/{BubblewrapRuntime-OI4qFPNB.mjs → BubblewrapRuntime-CTc_KPnd.mjs} +2 -2
  6. package/dist/{ConfigStore-CP1W86Ui.mjs → ConfigStore-B2Dy-PT9.mjs} +7 -8
  7. package/dist/ConfigStore-zlY0PikB.mjs +2 -0
  8. package/dist/{Logger-3RbeTZ9o.mjs → Logger-7MmrU5w6.mjs} +4845 -1126
  9. package/dist/{SandboxOrchestrator-lpxVEFO7.mjs → SandboxOrchestrator-CeDwd6Fj.mjs} +1 -1
  10. package/dist/{SandboxRuntimeAdapter-u6c_IrjP.mjs → SandboxRuntimeAdapter-CFEIywKt.mjs} +1 -1
  11. package/dist/{SandboxRuntimeAdapter-C3xICJtQ.mjs → SandboxRuntimeAdapter-CjNDzYSf.mjs} +2 -2
  12. package/dist/{SeatbeltRuntime-Ccd_QbjX.mjs → SeatbeltRuntime-CQItj-F1.mjs} +2 -2
  13. package/dist/{WorkItemsClient-D4sFGL9X.mjs → WorkItemsClient-C9_pjHCo.mjs} +3 -4
  14. package/dist/{buildToolSearch-CqHKSLtG.mjs → buildToolSearch-8xyBwXRx.mjs} +2 -2
  15. package/dist/commands/acpCommand.mjs +6 -7
  16. package/dist/commands/apiCommand.mjs +1 -1
  17. package/dist/commands/doctorCommand.mjs +2 -2
  18. package/dist/commands/envCommand.mjs +1 -1
  19. package/dist/commands/headlessCommand.mjs +10 -11
  20. package/dist/commands/hostCommand.mjs +1 -1
  21. package/dist/commands/mcpCommand.mjs +3 -3
  22. package/dist/commands/mirrorCommand.mjs +2 -2
  23. package/dist/commands/modelsCommand.mjs +4 -4
  24. package/dist/commands/pluginCommand.mjs +1 -1
  25. package/dist/commands/skillsCommand.mjs +3 -3
  26. package/dist/commands/updateCommand.mjs +2 -2
  27. package/dist/dist-DHgMhdzV.mjs +10138 -0
  28. package/dist/{fit-BOnDsgbk.mjs → fit-D8Quui6j.mjs} +3 -3
  29. package/dist/index.mjs +732 -69
  30. package/dist/{modelServers-B7zI5XnO.mjs → modelServers-JsKBm7Wn.mjs} +1 -1
  31. package/dist/{package-WlxLVpUb.mjs → package-r_xumsGY.mjs} +1 -1
  32. package/dist/{serve-DpsV0mag.mjs → serve-BM9PKMLH.mjs} +873 -60
  33. package/dist/{store-xeJRhBtO.mjs → store-CmOg7JIt.mjs} +2 -0
  34. package/dist/store-OGMXhD4A.mjs +2 -0
  35. package/dist/{updateChecker-Boq0RruU.mjs → updateChecker-BOqaLeZU.mjs} +1 -1
  36. package/package.json +12 -44
  37. package/dist/ConfigStore-Bo4od3Eu.mjs +0 -2
  38. package/dist/dist-BPhZ0dCz.mjs +0 -4776
  39. package/dist/store-Bpdo9Syo.mjs +0 -2
@@ -1,12 +1,11 @@
1
1
  #!/usr/bin/env node
2
-
3
2
 
4
3
  // Executable entry point for the CLI: tsx runs the TypeScript source in dev,
5
4
  // the compiled JavaScript in production.
6
5
 
7
6
  // Suppress punycode deprecation warning from older deps using Node's built-in punycode.
8
7
  process.removeAllListeners('warning');
9
- process.on('warning', (warning) => {
8
+ process.on('warning', warning => {
10
9
  if (warning.name === 'DeprecationWarning' && warning.message.includes('punycode')) {
11
10
  return;
12
11
  }
@@ -40,8 +39,7 @@ const hasDist = existsSync(distPath);
40
39
  // 1. NODE_ENV is explicitly 'development', OR
41
40
  // 2. dist doesn't exist but source does (fallback)
42
41
  // Otherwise: use production mode (this is what npm users will run)
43
- const isDev = process.env.NODE_ENV === 'development' ||
44
- (!hasDist && hasSource);
42
+ const isDev = process.env.NODE_ENV === 'development' || (!hasDist && hasSource);
45
43
 
46
44
  // `b4m host ...` is b4m-host: its arguments go through untouched, before yargs or the env flags see them,
47
45
  // and dial-stdio's stdout must carry nothing but the bridged bytes.
@@ -79,6 +77,11 @@ const argv = await yargs(hideBin(process.argv))
79
77
  type: 'boolean',
80
78
  description: 'Point the CLI at Bike4Mind production and remember it',
81
79
  })
80
+ .option('fullscreen', {
81
+ type: 'boolean',
82
+ description: 'Use alternate screen (TTY only); Ctrl+O browses completed messages',
83
+ default: false,
84
+ })
82
85
  .option('verbose', {
83
86
  alias: 'v',
84
87
  type: 'boolean',
@@ -107,7 +110,8 @@ const argv = await yargs(hideBin(process.argv))
107
110
  })
108
111
  .option('output-format', {
109
112
  type: 'string',
110
- description: 'Output format when using -p: text (default), json, stream-json (NDJSON); json also applies to b4m models ls/search/show/curated',
113
+ description:
114
+ 'Output format when using -p: text (default), json, stream-json (NDJSON); json also applies to b4m models ls/search/show/curated',
111
115
  choices: ['text', 'json', 'stream-json'],
112
116
  default: 'text',
113
117
  })
@@ -171,165 +175,218 @@ const argv = await yargs(hideBin(process.argv))
171
175
  description: 'Reset the API URL to the Bike4Mind default and clear auth tokens, then exit',
172
176
  default: false,
173
177
  })
174
- .command('mcp', 'Manage MCP (Model Context Protocol) servers', (yargs) => {
178
+ .command('mcp', 'Manage MCP (Model Context Protocol) servers', yargs => {
175
179
  return yargs
176
180
  .command('list', 'List configured MCP servers', {}, async () => {
177
181
  // Handled by external command handler
178
182
  })
179
- .command('add <name>', 'Add a new MCP server', (yargs) => {
180
- return yargs
181
- .positional('name', {
183
+ .command(
184
+ 'add <name>',
185
+ 'Add a new MCP server',
186
+ yargs => {
187
+ return yargs
188
+ .positional('name', {
189
+ type: 'string',
190
+ describe: 'Server name',
191
+ })
192
+ .example('b4m mcp add context7 -- npx -y @upstash/context7-mcp', 'Add context7 MCP server')
193
+ .example(
194
+ 'b4m mcp add github -- docker run -i ghcr.io/modelcontextprotocol/servers/github',
195
+ 'Add GitHub MCP server'
196
+ );
197
+ },
198
+ async () => {
199
+ // Handled by external command handler
200
+ }
201
+ )
202
+ .command(
203
+ 'remove <name>',
204
+ 'Remove an MCP server',
205
+ yargs => {
206
+ return yargs.positional('name', {
182
207
  type: 'string',
183
208
  describe: 'Server name',
184
- })
185
- .example('b4m mcp add context7 -- npx -y @upstash/context7-mcp', 'Add context7 MCP server')
186
- .example('b4m mcp add github -- docker run -i ghcr.io/modelcontextprotocol/servers/github', 'Add GitHub MCP server');
187
- }, async () => {
188
- // Handled by external command handler
189
- })
190
- .command('remove <name>', 'Remove an MCP server', (yargs) => {
191
- return yargs.positional('name', {
192
- type: 'string',
193
- describe: 'Server name',
194
- });
195
- }, async () => {
196
- // Handled by external command handler
197
- })
198
- .command('enable <name>', 'Enable an MCP server', (yargs) => {
199
- return yargs.positional('name', {
200
- type: 'string',
201
- describe: 'Server name',
202
- });
203
- }, async () => {
204
- // Handled by external command handler
205
- })
206
- .command('disable <name>', 'Disable an MCP server', (yargs) => {
207
- return yargs.positional('name', {
208
- type: 'string',
209
- describe: 'Server name',
210
- });
211
- }, async () => {
212
- // Handled by external command handler
213
- })
214
- .command('serve', 'Run Bike4Mind as an MCP server (stdio by default, or --http)', (yargs) => {
215
- return yargs
216
- .option('http', {
217
- type: 'boolean',
218
- description: 'Serve over streamable HTTP instead of stdio',
219
- default: false,
220
- })
221
- .option('local', {
222
- type: 'boolean',
223
- description: 'Serve only the local model tools (models_*), with no Bike4Mind backend. Stdio only',
224
- default: false,
225
- })
226
- .option('port', {
227
- type: 'number',
228
- description: 'Port for --http mode',
229
- default: 7000,
230
- })
231
- .option('api-key', {
232
- type: 'string',
233
- description: 'Bike4Mind API key (overrides B4M_API_KEY and the stored login). Visible in process listings; prefer B4M_API_KEY',
234
- })
235
- .option('api-url', {
209
+ });
210
+ },
211
+ async () => {
212
+ // Handled by external command handler
213
+ }
214
+ )
215
+ .command(
216
+ 'enable <name>',
217
+ 'Enable an MCP server',
218
+ yargs => {
219
+ return yargs.positional('name', {
236
220
  type: 'string',
237
- description: 'Bike4Mind API URL (overrides B4M_API_URL and the configured backend)',
238
- })
239
- .option('token', {
221
+ describe: 'Server name',
222
+ });
223
+ },
224
+ async () => {
225
+ // Handled by external command handler
226
+ }
227
+ )
228
+ .command(
229
+ 'disable <name>',
230
+ 'Disable an MCP server',
231
+ yargs => {
232
+ return yargs.positional('name', {
240
233
  type: 'string',
241
- description: 'Bearer token required by --http mode (overrides B4M_MCP_TOKEN; generated and printed when unset). Visible in process listings; prefer B4M_MCP_TOKEN',
242
- })
243
- .example('b4m mcp serve', 'Serve over stdio for Claude Desktop and other local clients')
244
- .example('b4m mcp serve --local', 'Serve only the local model tools, without a backend')
245
- .example('b4m mcp serve --http --port 7000', 'Serve over streamable HTTP on port 7000');
246
- }, async () => {
247
- // Handled by external command handler
248
- })
234
+ describe: 'Server name',
235
+ });
236
+ },
237
+ async () => {
238
+ // Handled by external command handler
239
+ }
240
+ )
241
+ .command(
242
+ 'serve',
243
+ 'Run Bike4Mind as an MCP server (stdio by default, or --http)',
244
+ yargs => {
245
+ return yargs
246
+ .option('http', {
247
+ type: 'boolean',
248
+ description: 'Serve over streamable HTTP instead of stdio',
249
+ default: false,
250
+ })
251
+ .option('local', {
252
+ type: 'boolean',
253
+ description: 'Serve only the local model tools (models_*), with no Bike4Mind backend. Stdio only',
254
+ default: false,
255
+ })
256
+ .option('port', {
257
+ type: 'number',
258
+ description: 'Port for --http mode',
259
+ default: 7000,
260
+ })
261
+ .option('api-key', {
262
+ type: 'string',
263
+ description:
264
+ 'Bike4Mind API key (overrides B4M_API_KEY and the stored login). Visible in process listings; prefer B4M_API_KEY',
265
+ })
266
+ .option('api-url', {
267
+ type: 'string',
268
+ description: 'Bike4Mind API URL (overrides B4M_API_URL and the configured backend)',
269
+ })
270
+ .option('token', {
271
+ type: 'string',
272
+ description:
273
+ 'Bearer token required by --http mode (overrides B4M_MCP_TOKEN; generated and printed when unset). Visible in process listings; prefer B4M_MCP_TOKEN',
274
+ })
275
+ .example('b4m mcp serve', 'Serve over stdio for Claude Desktop and other local clients')
276
+ .example('b4m mcp serve --local', 'Serve only the local model tools, without a backend')
277
+ .example('b4m mcp serve --http --port 7000', 'Serve over streamable HTTP on port 7000');
278
+ },
279
+ async () => {
280
+ // Handled by external command handler
281
+ }
282
+ )
249
283
  .demandCommand(1, 'You must provide a subcommand (list, add, remove, enable, disable, serve)');
250
284
  })
251
- .command('plugin', 'Manage B4M feature-module plugins', (yargs) => {
285
+ .command('plugin', 'Manage B4M feature-module plugins', yargs => {
252
286
  return yargs
253
287
  .command('list', 'List installed plugins', {}, async () => {
254
288
  // Handled by external command handler
255
289
  })
256
- .command('add <spec>', 'Install a plugin package', (yargs) => {
257
- return yargs
258
- .positional('spec', {
290
+ .command(
291
+ 'add <spec>',
292
+ 'Install a plugin package',
293
+ yargs => {
294
+ return yargs
295
+ .positional('spec', {
296
+ type: 'string',
297
+ describe: 'npm package, @scope/package, github:user/repo, or file:<path>',
298
+ })
299
+ .example('b4m plugin add @someone/b4m-plugin-foo', 'Install from npm')
300
+ .example('b4m plugin add github:user/b4m-plugin-foo', 'Install from GitHub');
301
+ },
302
+ async () => {
303
+ // Handled by external command handler
304
+ }
305
+ )
306
+ .command(
307
+ 'remove <name>',
308
+ 'Uninstall a plugin',
309
+ yargs => {
310
+ return yargs.positional('name', {
259
311
  type: 'string',
260
- describe: 'npm package, @scope/package, github:user/repo, or file:<path>',
261
- })
262
- .example('b4m plugin add @someone/b4m-plugin-foo', 'Install from npm')
263
- .example('b4m plugin add github:user/b4m-plugin-foo', 'Install from GitHub');
264
- }, async () => {
265
- // Handled by external command handler
266
- })
267
- .command('remove <name>', 'Uninstall a plugin', (yargs) => {
268
- return yargs.positional('name', {
269
- type: 'string',
270
- describe: 'Plugin name (config key, package name, or short name)',
271
- });
272
- }, async () => {
273
- // Handled by external command handler
274
- })
312
+ describe: 'Plugin name (config key, package name, or short name)',
313
+ });
314
+ },
315
+ async () => {
316
+ // Handled by external command handler
317
+ }
318
+ )
275
319
  .demandCommand(1, 'You must provide a subcommand (list, add, remove)');
276
320
  })
277
- .command('skills', 'Manage your Bike4Mind skills', (yargs) => {
321
+ .command('skills', 'Manage your Bike4Mind skills', yargs => {
278
322
  return yargs
279
- .command('push <path>', 'Create or update a skill from a Claude Code SKILL.md, and optionally publish it', (yargs) => {
280
- return yargs
281
- .positional('path', {
282
- type: 'string',
283
- describe: 'Skill folder, its SKILL.md, or a commands/*.md file',
284
- })
285
- .option('update', {
286
- type: 'boolean',
287
- description: 'Overwrite your existing skill with the same name without asking',
288
- default: false,
289
- })
290
- .option('yes', {
291
- type: 'boolean',
292
- description: "Push another author's Skill Market skill as your own without asking",
293
- default: false,
294
- })
295
- .option('publish', {
296
- type: 'boolean',
297
- description: 'Also list it on the Skill Market: a new listing, or a new version of its live listing',
298
- default: false,
299
- })
300
- .option('visibility', {
301
- type: 'string',
302
- choices: ['organization', 'public', 'unlisted'],
303
- description: 'Who can see a new listing (with --publish)',
304
- default: 'organization',
305
- })
306
- .option('org', {
307
- type: 'string',
308
- description: 'Organization id for an organization listing; optional when you belong to exactly one',
309
- })
310
- .option('tags', {
311
- type: 'string',
312
- description: 'Comma-separated listing tags (with --publish)',
313
- })
314
- .option('api-key', {
315
- type: 'string',
316
- description:
317
- 'Bike4Mind API key with the skills:write and me:read scopes (overrides B4M_API_KEY and the stored login). Visible in process listings; prefer B4M_API_KEY, which also takes precedence over the stored login when set, even without --publish',
318
- })
319
- .example('b4m skills push ~/.claude/skills/my-skill', 'Create a skill from a Claude Code skill folder')
320
- .example('b4m skills push ./SKILL.md --update', 'Update the existing skill of the same name')
321
- .example('b4m skills push ./my-skill --publish --update', 'Update the skill and publish it to the Skill Market');
322
- }, async () => {
323
- // Handled by external command handler
324
- })
323
+ .command(
324
+ 'push <path>',
325
+ 'Create or update a skill from a Claude Code SKILL.md, and optionally publish it',
326
+ yargs => {
327
+ return yargs
328
+ .positional('path', {
329
+ type: 'string',
330
+ describe: 'Skill folder, its SKILL.md, or a commands/*.md file',
331
+ })
332
+ .option('update', {
333
+ type: 'boolean',
334
+ description: 'Overwrite your existing skill with the same name without asking',
335
+ default: false,
336
+ })
337
+ .option('yes', {
338
+ type: 'boolean',
339
+ description: "Push another author's Skill Market skill as your own without asking",
340
+ default: false,
341
+ })
342
+ .option('publish', {
343
+ type: 'boolean',
344
+ description: 'Also list it on the Skill Market: a new listing, or a new version of its live listing',
345
+ default: false,
346
+ })
347
+ .option('visibility', {
348
+ type: 'string',
349
+ choices: ['organization', 'public', 'unlisted'],
350
+ description: 'Who can see a new listing (with --publish)',
351
+ default: 'organization',
352
+ })
353
+ .option('org', {
354
+ type: 'string',
355
+ description: 'Organization id for an organization listing; optional when you belong to exactly one',
356
+ })
357
+ .option('tags', {
358
+ type: 'string',
359
+ description: 'Comma-separated listing tags (with --publish)',
360
+ })
361
+ .option('api-key', {
362
+ type: 'string',
363
+ description:
364
+ 'Bike4Mind API key with the skills:write and me:read scopes (overrides B4M_API_KEY and the stored login). Visible in process listings; prefer B4M_API_KEY, which also takes precedence over the stored login when set, even without --publish',
365
+ })
366
+ .example('b4m skills push ~/.claude/skills/my-skill', 'Create a skill from a Claude Code skill folder')
367
+ .example('b4m skills push ./SKILL.md --update', 'Update the existing skill of the same name')
368
+ .example(
369
+ 'b4m skills push ./my-skill --publish --update',
370
+ 'Update the skill and publish it to the Skill Market'
371
+ );
372
+ },
373
+ async () => {
374
+ // Handled by external command handler
375
+ }
376
+ )
325
377
  .demandCommand(1, 'You must provide a subcommand (push)');
326
378
  })
327
- .command('host', 'Run b4m-host, which reports this machine\'s hardware and Ollama to Bike4Mind (see: b4m host --help)', {}, () => {
328
- // `host` as the first argument is handled at the top of this file; reaching here means a flag came before it.
329
- process.stderr.write('b4m host must be the first argument: b4m host <command> (see: b4m host --help)\n');
330
- process.exit(2);
331
- })
332
- .command('models', 'Find, download and use local models (Ollama, Hugging Face GGUF)', (yargs) => {
379
+ .command(
380
+ 'host',
381
+ "Run b4m-host, which reports this machine's hardware and Ollama to Bike4Mind (see: b4m host --help)",
382
+ {},
383
+ () => {
384
+ // `host` as the first argument is handled at the top of this file; reaching here means a flag came before it.
385
+ process.stderr.write('b4m host must be the first argument: b4m host <command> (see: b4m host --help)\n');
386
+ process.exit(2);
387
+ }
388
+ )
389
+ .command('models', 'Find, download and use local models (Ollama, Hugging Face GGUF)', yargs => {
333
390
  return yargs
334
391
  .option('server', {
335
392
  type: 'string',
@@ -338,108 +395,153 @@ const argv = await yargs(hideBin(process.argv))
338
395
  .command(['ls', 'list'], 'List models installed on the local runtime', {}, async () => {
339
396
  // Handled by external command handler
340
397
  })
341
- .command('servers [action] [name]', "List Desktop's saved model servers, find the ones on a machine over SSH, or log in or out of one", (yargs) => {
342
- return yargs
343
- .positional('action', { type: 'string', choices: ['discover', 'login', 'logout'], describe: 'Find servers over SSH, or keep or remove the CLI\'s credential for a server' })
344
- .positional('name', { type: 'string', describe: 'Server name, as `b4m models servers` shows it; for discover, an SSH destination' })
345
- .option('port', {
346
- type: 'string',
347
- description: 'discover: look only at this port on that machine, instead of the usual ones',
348
- })
349
- .option('check-tools', {
350
- type: 'boolean',
351
- description: 'servers: send each OpenAI-compatible server a one-token request to see whether it accepts tool calls',
352
- default: false,
353
- })
354
- .option('token-stdin', {
355
- type: 'boolean',
356
- description: 'login: read the credential from stdin instead of prompting',
357
- default: false,
358
- })
359
- .example('b4m models servers', 'List the servers with their status')
360
- .example('b4m models servers discover me@gpu-box', 'Find Ollama, LM Studio, llama-server and vLLM on gpu-box over SSH')
361
- .example('b4m models servers login gpu-box', 'Enter the CLI\'s credential for gpu-box (hidden)');
362
- }, async () => {
363
- // Handled by external command handler
364
- })
365
- .command('search <query..>', 'Search Hugging Face for GGUF models', (yargs) => {
366
- return yargs
367
- .positional('query', { type: 'string', describe: 'Search terms' })
368
- .option('include-abliterated', {
398
+ .command(
399
+ 'servers [action] [name]',
400
+ "List Desktop's saved model servers, find the ones on a machine over SSH, or log in or out of one",
401
+ yargs => {
402
+ return yargs
403
+ .positional('action', {
404
+ type: 'string',
405
+ choices: ['discover', 'login', 'logout'],
406
+ describe: "Find servers over SSH, or keep or remove the CLI's credential for a server",
407
+ })
408
+ .positional('name', {
409
+ type: 'string',
410
+ describe: 'Server name, as `b4m models servers` shows it; for discover, an SSH destination',
411
+ })
412
+ .option('port', {
413
+ type: 'string',
414
+ description: 'discover: look only at this port on that machine, instead of the usual ones',
415
+ })
416
+ .option('check-tools', {
417
+ type: 'boolean',
418
+ description:
419
+ 'servers: send each OpenAI-compatible server a one-token request to see whether it accepts tool calls',
420
+ default: false,
421
+ })
422
+ .option('token-stdin', {
423
+ type: 'boolean',
424
+ description: 'login: read the credential from stdin instead of prompting',
425
+ default: false,
426
+ })
427
+ .example('b4m models servers', 'List the servers with their status')
428
+ .example(
429
+ 'b4m models servers discover me@gpu-box',
430
+ 'Find Ollama, LM Studio, llama-server and vLLM on gpu-box over SSH'
431
+ )
432
+ .example('b4m models servers login gpu-box', "Enter the CLI's credential for gpu-box (hidden)");
433
+ },
434
+ async () => {
435
+ // Handled by external command handler
436
+ }
437
+ )
438
+ .command(
439
+ 'search <query..>',
440
+ 'Search Hugging Face for GGUF models',
441
+ yargs => {
442
+ return yargs.positional('query', { type: 'string', describe: 'Search terms' }).option('include-abliterated', {
369
443
  type: 'boolean',
370
444
  description: 'Also list abliterated and uncensored builds, labelled and last',
371
445
  default: false,
372
446
  });
373
- }, async () => {
374
- // Handled by external command handler
375
- })
376
- .command('show <repo>', "Show a Hugging Face repo's GGUF builds, license and gating", (yargs) => {
377
- return yargs.positional('repo', { type: 'string', describe: 'owner/repo' });
378
- }, async () => {
379
- // Handled by external command handler
380
- })
381
- .command('curated', 'List the models Bike4Mind picked, with picks for this computer first', (yargs) => {
382
- return yargs
383
- .option('refresh', {
384
- type: 'boolean',
385
- description: 'Check for a newer signed list now instead of when the last check is 6 hours old',
386
- default: false,
387
- })
388
- .option('offline', {
389
- type: 'boolean',
390
- description: 'Use the last verified list on this computer (else the bundled one) with no update check (also: B4M_CURATED=off)',
391
- default: false,
392
- });
393
- }, async () => {
394
- // Handled by external command handler
395
- })
396
- .command('pull <ref>', 'Download a model after showing its size and license', (yargs) => {
397
- return yargs
398
- .positional('ref', {
399
- type: 'string',
400
- describe: 'owner/repo[:quant] or hf.co/owner/repo:quant (Hugging Face), or an Ollama name like qwen2.5:0.5b',
401
- })
402
- .option('yes', {
403
- type: 'boolean',
404
- description: 'Download without asking for confirmation',
405
- default: false,
406
- })
407
- .option('accept-license', {
408
- type: 'boolean',
409
- description: 'Accept a non-permissive model license without a prompt',
410
- default: false,
411
- })
412
- .option('force', {
413
- type: 'boolean',
414
- description: 'Download even when the fit check rates the model too large for this machine',
415
- default: false,
416
- })
417
- .option('offline', {
418
- type: 'boolean',
419
- description: 'Use the last verified curated list on this computer with no update check (also: B4M_CURATED=off)',
420
- default: false,
421
- })
422
- .example('b4m models pull Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M', 'Pull a Hugging Face GGUF build')
423
- .example('b4m models pull qwen2.5:0.5b', 'Pull from the Ollama library');
424
- }, async () => {
425
- // Handled by external command handler
426
- })
427
- .command(['rm <name>', 'remove <name>'], 'Remove an installed model', (yargs) => {
428
- return yargs
429
- .positional('name', { type: 'string', describe: 'Installed model name' })
430
- .option('yes', {
447
+ },
448
+ async () => {
449
+ // Handled by external command handler
450
+ }
451
+ )
452
+ .command(
453
+ 'show <repo>',
454
+ "Show a Hugging Face repo's GGUF builds, license and gating",
455
+ yargs => {
456
+ return yargs.positional('repo', { type: 'string', describe: 'owner/repo' });
457
+ },
458
+ async () => {
459
+ // Handled by external command handler
460
+ }
461
+ )
462
+ .command(
463
+ 'curated',
464
+ 'List the models Bike4Mind picked, with picks for this computer first',
465
+ yargs => {
466
+ return yargs
467
+ .option('refresh', {
468
+ type: 'boolean',
469
+ description: 'Check for a newer signed list now instead of when the last check is 6 hours old',
470
+ default: false,
471
+ })
472
+ .option('offline', {
473
+ type: 'boolean',
474
+ description:
475
+ 'Use the last verified list on this computer (else the bundled one) with no update check (also: B4M_CURATED=off)',
476
+ default: false,
477
+ });
478
+ },
479
+ async () => {
480
+ // Handled by external command handler
481
+ }
482
+ )
483
+ .command(
484
+ 'pull <ref>',
485
+ 'Download a model after showing its size and license',
486
+ yargs => {
487
+ return yargs
488
+ .positional('ref', {
489
+ type: 'string',
490
+ describe:
491
+ 'owner/repo[:quant] or hf.co/owner/repo:quant (Hugging Face), or an Ollama name like qwen2.5:0.5b',
492
+ })
493
+ .option('yes', {
494
+ type: 'boolean',
495
+ description: 'Download without asking for confirmation',
496
+ default: false,
497
+ })
498
+ .option('accept-license', {
499
+ type: 'boolean',
500
+ description: 'Accept a non-permissive model license without a prompt',
501
+ default: false,
502
+ })
503
+ .option('force', {
504
+ type: 'boolean',
505
+ description: 'Download even when the fit check rates the model too large for this machine',
506
+ default: false,
507
+ })
508
+ .option('offline', {
509
+ type: 'boolean',
510
+ description:
511
+ 'Use the last verified curated list on this computer with no update check (also: B4M_CURATED=off)',
512
+ default: false,
513
+ })
514
+ .example('b4m models pull Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M', 'Pull a Hugging Face GGUF build')
515
+ .example('b4m models pull qwen2.5:0.5b', 'Pull from the Ollama library');
516
+ },
517
+ async () => {
518
+ // Handled by external command handler
519
+ }
520
+ )
521
+ .command(
522
+ ['rm <name>', 'remove <name>'],
523
+ 'Remove an installed model',
524
+ yargs => {
525
+ return yargs.positional('name', { type: 'string', describe: 'Installed model name' }).option('yes', {
431
526
  type: 'boolean',
432
527
  description: 'Remove without asking for confirmation',
433
528
  default: false,
434
529
  });
435
- }, async () => {
436
- // Handled by external command handler
437
- })
438
- .command('use <name>', 'Make an installed model the default the CLI chats with', (yargs) => {
439
- return yargs.positional('name', { type: 'string', describe: 'Installed model name' });
440
- }, async () => {
441
- // Handled by external command handler
442
- })
530
+ },
531
+ async () => {
532
+ // Handled by external command handler
533
+ }
534
+ )
535
+ .command(
536
+ 'use <name>',
537
+ 'Make an installed model the default the CLI chats with',
538
+ yargs => {
539
+ return yargs.positional('name', { type: 'string', describe: 'Installed model name' });
540
+ },
541
+ async () => {
542
+ // Handled by external command handler
543
+ }
544
+ )
443
545
  .example('b4m models ls --ollama-host http://127.0.0.1:11434', 'Use and remember an Ollama host')
444
546
  .demandCommand(1, 'You must provide a subcommand (ls, search, show, curated, servers, pull, rm, use)');
445
547
  })
@@ -458,6 +560,7 @@ const argv = await yargs(hideBin(process.argv))
458
560
  .parse();
459
561
 
460
562
  // Set environment variables from CLI flags
563
+ process.env.B4M_FULLSCREEN = argv.fullscreen ? '1' : '0';
461
564
  if (argv.verbose) {
462
565
  process.env.B4M_VERBOSE = '1';
463
566
  process.env.LOG_LEVEL = 'debug'; // Enable debug logs in core packages
@@ -497,7 +600,7 @@ if (argv['append-system-prompt']) {
497
600
  if (argv.allowedTools && argv.allowedTools.length > 0) {
498
601
  // Each element may itself be a space-separated list (the host's board pane passes
499
602
  // "a b c" as a single argv token); flatten on whitespace into discrete patterns.
500
- const patterns = argv.allowedTools.flatMap((s) => String(s).split(/\s+/)).filter(Boolean);
603
+ const patterns = argv.allowedTools.flatMap(s => String(s).split(/\s+/)).filter(Boolean);
501
604
  process.env.B4M_ALLOWED_TOOLS = JSON.stringify(patterns);
502
605
  }
503
606
  if (argv.settings) {