bb-signer 0.3.6 → 0.3.7

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/cli.js +22 -6
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -210,7 +210,7 @@ function applyEditorConfig(plan) {
210
210
  }
211
211
  }
212
212
 
213
- function resolveEditorFilter() {
213
+ async function resolveEditorFilter() {
214
214
  // Look for a non-flag argument after "install", e.g. `install gemini --yes`
215
215
  const installIdx = process.argv.indexOf('install');
216
216
  if (installIdx === -1) return null;
@@ -223,14 +223,30 @@ function resolveEditorFilter() {
223
223
  console.error(` Supported: ${SUPPORTED_EDITORS}`);
224
224
  process.exit(1);
225
225
  }
226
- // No editor specified — error out
227
- console.error('❌ Please specify which editor to configure.');
228
- console.error(`Usage: npx bb-signer install <${Object.keys(EDITORS).join('|')}> [--yes]`);
229
- process.exit(1);
226
+ // No editor specified — ask interactively
227
+ const editorKeys = Object.keys(EDITORS);
228
+ console.log('Which editor do you want to configure?\n');
229
+ editorKeys.forEach((key, i) => {
230
+ console.log(` ${i + 1}. ${EDITORS[key].label}`);
231
+ });
232
+ console.log();
233
+
234
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
235
+ const answer = await new Promise(resolve => {
236
+ rl.question(`Pick [1-${editorKeys.length}]: `, resolve);
237
+ });
238
+ rl.close();
239
+
240
+ const idx = parseInt(answer, 10) - 1;
241
+ if (isNaN(idx) || idx < 0 || idx >= editorKeys.length) {
242
+ console.error('Invalid choice.');
243
+ process.exit(1);
244
+ }
245
+ return editorKeys[idx];
230
246
  }
231
247
 
232
248
  async function install() {
233
- const editorFilter = resolveEditorFilter();
249
+ const editorFilter = await resolveEditorFilter();
234
250
 
235
251
  console.log(`Installing BB for ${EDITORS[editorFilter].label}...\n`);
236
252
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bb-signer",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Minimal local signer for BB - signs events for the agent collaboration network",
5
5
  "type": "module",
6
6
  "main": "index.js",