unbound-cli 0.9.7 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unbound-cli",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "description": "CLI tool for Unbound - AI Gateway management",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -26,7 +26,7 @@ function register(program) {
26
26
  .requiredOption('--api-key <key>', 'User API key (for tool setup and login)')
27
27
  .requiredOption('--discovery-key <key>', 'Discovery API key (for device scan)')
28
28
  .option('--domain <url>', 'Backend URL for discovery (defaults to configured backend)')
29
- .option('--backfill', 'Seed historical Claude Code / Codex sessions from local transcripts into Unbound analytics (Cursor skipped automatically)')
29
+ .option('--backfill', 'Seed historical Claude Code / Codex / Copilot sessions from local transcripts into Unbound analytics (Cursor skipped automatically)')
30
30
  .option('--cron', 'Set up a recurring 12-hour discovery scan instead of a one-time scan (macOS only)')
31
31
  .addOption(new Option('--backend-url <url>', 'Override backend URL for setup scripts (dev only)').hideHelp())
32
32
  .addOption(new Option('--frontend-url <url>', 'Override frontend URL for setup scripts (dev only)').hideHelp())
@@ -130,7 +130,7 @@ Examples:
130
130
  .requiredOption('--admin-api-key <key>', 'Admin API key for MDM enrollment')
131
131
  .requiredOption('--discovery-key <key>', 'Discovery API key (for device scan)')
132
132
  .option('--domain <url>', 'Backend URL for discovery (defaults to configured backend)')
133
- .option('--backfill', 'Seed historical Claude Code / Codex sessions from local transcripts into Unbound analytics (Cursor skipped automatically)')
133
+ .option('--backfill', 'Seed historical Claude Code / Codex / Copilot sessions from local transcripts into Unbound analytics (Cursor skipped automatically)')
134
134
  .addOption(new Option('--backend-url <url>', 'Override backend URL for setup scripts (dev only)').hideHelp())
135
135
  .addOption(new Option('--frontend-url <url>', 'Override frontend URL for setup scripts (dev only)').hideHelp())
136
136
  .addOption(new Option('--gateway-url <url>', 'Override gateway URL for setup scripts (dev only)').hideHelp())
@@ -232,11 +232,13 @@ function buildScriptArgs(apiKey, { backendUrl, frontendUrl, gatewayUrl, clear, m
232
232
  return args.trim();
233
233
  }
234
234
 
235
- // Backfill only applies to the hooks variants of Claude Code / Codex; gateway
236
- // mode and Cursor have no local transcripts to seed.
235
+ // Backfill only applies to the hooks variants of Claude Code / Codex / Copilot;
236
+ // gateway mode and Cursor have no local transcripts to seed.
237
237
  function scriptSupportsBackfill(scriptPath) {
238
238
  return scriptPath.includes('/hooks/') && (
239
- scriptPath.startsWith('claude-code/') || scriptPath.startsWith('codex/')
239
+ scriptPath.startsWith('claude-code/') ||
240
+ scriptPath.startsWith('codex/') ||
241
+ scriptPath.startsWith('copilot/')
240
242
  );
241
243
  }
242
244
 
@@ -352,7 +354,7 @@ function register(program) {
352
354
  .option('--subscription', 'Use subscription mode for Claude Code / Codex (hooks only)')
353
355
  .option('--gateway', 'Use gateway mode for Claude Code / Codex (Unbound as AI provider)')
354
356
  .option('--all', 'Set up the default bundle: Cursor, Copilot, Claude Code (hooks), Codex (hooks)')
355
- .option('--backfill', 'Seed historical Claude Code / Codex sessions from local transcripts into Unbound analytics (subscription/hooks mode only; Cursor and Copilot unsupported)')
357
+ .option('--backfill', 'Seed historical Claude Code / Codex / Copilot sessions from local transcripts into Unbound analytics (subscription/hooks mode only; Cursor unsupported)')
356
358
  .addOption(new Option('--backend-url <url>', 'Override backend URL for setup scripts (dev only)').hideHelp())
357
359
  .addOption(new Option('--frontend-url <url>', 'Override frontend URL for setup scripts (dev only)').hideHelp())
358
360
  .addOption(new Option('--gateway-url <url>', 'Override gateway URL for setup scripts (dev only)').hideHelp())
@@ -386,9 +388,10 @@ Examples:
386
388
  $ unbound setup --all Set up the default bundle
387
389
  $ unbound setup --all --api-key <key> Login + set up the bundle
388
390
 
389
- Seed historical sessions (Claude Code / Codex subscription mode only):
391
+ Seed historical sessions (Claude Code / Codex subscription mode + Copilot):
390
392
  $ unbound setup claude-code --subscription --backfill Install hooks AND backfill local history
391
393
  $ unbound setup codex --subscription --backfill Install hooks AND backfill local history
394
+ $ unbound setup copilot --backfill Install hooks AND backfill local history
392
395
 
393
396
  One-step login and setup:
394
397
  $ unbound setup cursor --api-key <key> Login + set up Cursor
@@ -648,7 +651,7 @@ requires authentication.
648
651
  .option('--admin-api-key <key>', 'Admin API key for MDM enrollment (not required with --clear)')
649
652
  .option('--clear', 'Remove Unbound configuration for the specified tools (no API key required)')
650
653
  .option('--all', 'Set up all available tools')
651
- .option('--backfill', 'Seed historical Claude Code / Codex sessions from local transcripts into Unbound analytics (subscription/hooks mode only; Cursor and Copilot unsupported)')
654
+ .option('--backfill', 'Seed historical Claude Code / Codex / Copilot sessions from local transcripts into Unbound analytics (subscription/hooks mode only; Cursor unsupported)')
652
655
  .addHelpText('after', `
653
656
  Available tools:
654
657
  cursor Cursor IDE
@@ -671,6 +674,8 @@ Setup examples (require --admin-api-key):
671
674
  $ sudo unbound setup mdm --admin-api-key KEY --all
672
675
  $ sudo unbound setup mdm --admin-api-key KEY claude-code-subscription --backfill
673
676
  Install hooks AND backfill local history
677
+ $ sudo unbound setup mdm --admin-api-key KEY copilot --backfill
678
+ Install Copilot hooks AND backfill local history
674
679
 
675
680
  Clear examples (no API key required):
676
681
  $ sudo unbound setup mdm --clear cursor
@@ -802,9 +807,9 @@ async function runSetupAllBundle(apiKey, { backendUrl, frontendUrl, gatewayUrl,
802
807
  }
803
808
  }
804
809
  // Build args per-tool so --backfill only goes to tools whose script
805
- // actually supports it (Claude Code hooks and Codex hooks). Cursor would
806
- // print "not supported"; passing the flag to gateway-mode scripts would
807
- // error out — `scriptSupportsBackfill` checks for both.
810
+ // actually supports it (Claude Code hooks, Codex hooks, Copilot hooks).
811
+ // Cursor would print "not supported"; passing the flag to gateway-mode
812
+ // scripts would error out — `scriptSupportsBackfill` checks for both.
808
813
  return runBatch(resolvedTools, (tool) => {
809
814
  const args = buildScriptArgs(apiKey, {
810
815
  backendUrl, frontendUrl, gatewayUrl,
@@ -843,4 +848,5 @@ module.exports = {
843
848
  ALL_TOOLS,
844
849
  MDM_ALL_TOOLS,
845
850
  buildScriptArgs,
851
+ scriptSupportsBackfill,
846
852
  };
@@ -1,6 +1,6 @@
1
1
  const { test } = require('node:test');
2
2
  const assert = require('node:assert/strict');
3
- const { buildScriptArgs } = require('../src/commands/setup');
3
+ const { buildScriptArgs, scriptSupportsBackfill } = require('../src/commands/setup');
4
4
 
5
5
  // shellEscape single-quotes every value, so a real key surfaces as
6
6
  // --api-key '<key>' at the head of the argv tail.
@@ -51,6 +51,25 @@ test('buildScriptArgs: backfill:true appends --backfill', () => {
51
51
  assert.ok(args.includes('--backfill'), args);
52
52
  });
53
53
 
54
+ // Backfill is supported only by the hooks variants of Claude Code, Codex, and
55
+ // Copilot. Gateway-mode scripts and Cursor have no local transcripts to seed.
56
+ test('scriptSupportsBackfill: hooks variants of claude-code, codex, copilot are supported', () => {
57
+ assert.ok(scriptSupportsBackfill('claude-code/hooks/setup.py'));
58
+ assert.ok(scriptSupportsBackfill('claude-code/hooks/mdm/setup.py'));
59
+ assert.ok(scriptSupportsBackfill('codex/hooks/setup.py'));
60
+ assert.ok(scriptSupportsBackfill('codex/hooks/mdm/setup.py'));
61
+ assert.ok(scriptSupportsBackfill('copilot/hooks/setup.py'));
62
+ assert.ok(scriptSupportsBackfill('copilot/hooks/mdm/setup.py'));
63
+ });
64
+
65
+ test('scriptSupportsBackfill: cursor and gateway-mode scripts are unsupported', () => {
66
+ assert.ok(!scriptSupportsBackfill('cursor/setup.py'));
67
+ assert.ok(!scriptSupportsBackfill('cursor/mdm/setup.py'));
68
+ assert.ok(!scriptSupportsBackfill('claude-code/gateway/setup.py'));
69
+ assert.ok(!scriptSupportsBackfill('codex/gateway/setup.py'));
70
+ assert.ok(!scriptSupportsBackfill('gemini-cli/gateway/setup.py'));
71
+ });
72
+
54
73
  // MDM scripts have no browser-auth flow, so --domain (frontend URL) is
55
74
  // suppressed even when a frontendUrl is supplied.
56
75
  test('buildScriptArgs: mdm:true suppresses --domain even with frontendUrl', () => {