@gopherhole/cli 0.1.17 → 0.1.19

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/dist/index.js CHANGED
@@ -1096,6 +1096,7 @@ ${chalk_1.default.bold('Examples:')}
1096
1096
  .option('--content-mode <contentMode>', 'Filter by content mode (MIME type)')
1097
1097
  .option('--owner <owner>', 'Filter by organization/tenant name')
1098
1098
  .option('--verified', 'Only show agents from verified organizations')
1099
+ .option('--country <code>', 'Filter by country code (e.g., NZ, US)')
1099
1100
  .option('-s, --sort <sort>', 'Sort by: rating, popular, recent', 'rating')
1100
1101
  .option('-l, --limit <limit>', 'Number of results (max 50)', '10')
1101
1102
  .option('-o, --offset <offset>', 'Pagination offset')
@@ -1118,6 +1119,8 @@ ${chalk_1.default.bold('Examples:')}
1118
1119
  params.set('owner', options.owner);
1119
1120
  if (options.verified)
1120
1121
  params.set('verified', 'true');
1122
+ if (options.country)
1123
+ params.set('country', options.country);
1121
1124
  if (options.sort)
1122
1125
  params.set('sort', options.sort);
1123
1126
  if (options.limit)
@@ -1231,6 +1234,64 @@ discover
1231
1234
  process.exit(1);
1232
1235
  }
1233
1236
  });
1237
+ discover
1238
+ .command('nearby')
1239
+ .description(`Find agents near a location
1240
+
1241
+ ${chalk_1.default.bold('Examples:')}
1242
+ $ gopherhole discover nearby --lat -36.85 --lng 174.74
1243
+ $ gopherhole discover nearby --lat -36.85 --lng 174.74 --radius 25 --tag retail
1244
+ `)
1245
+ .requiredOption('--lat <lat>', 'Latitude')
1246
+ .requiredOption('--lng <lng>', 'Longitude')
1247
+ .option('-r, --radius <km>', 'Search radius in km', '10')
1248
+ .option('-t, --tag <tag>', 'Filter by tag')
1249
+ .option('-c, --category <category>', 'Filter by category')
1250
+ .option('-l, --limit <limit>', 'Number of results (max 50)', '20')
1251
+ .action(async (options) => {
1252
+ const spinner = (0, ora_1.default)('Searching nearby agents...').start();
1253
+ try {
1254
+ const sessionId = config.get('sessionId');
1255
+ const params = new URLSearchParams();
1256
+ params.set('lat', options.lat);
1257
+ params.set('lng', options.lng);
1258
+ params.set('radius', options.radius);
1259
+ if (options.tag)
1260
+ params.set('tag', options.tag);
1261
+ if (options.category)
1262
+ params.set('category', options.category);
1263
+ params.set('limit', options.limit);
1264
+ log('GET /discover/agents/nearby?' + params.toString());
1265
+ const headers = {};
1266
+ if (sessionId) {
1267
+ headers['X-Session-ID'] = sessionId;
1268
+ }
1269
+ const res = await fetch(`${API_URL}/discover/agents/nearby?${params}`, { headers });
1270
+ const data = await res.json();
1271
+ spinner.stop();
1272
+ if (!data.agents || data.agents.length === 0) {
1273
+ console.log(chalk_1.default.yellow('\nNo agents found nearby.'));
1274
+ console.log(chalk_1.default.gray(`Search area: ${options.radius}km from (${options.lat}, ${options.lng})`));
1275
+ return;
1276
+ }
1277
+ console.log(chalk_1.default.bold(`\n📍 Found ${data.agents.length} agents within ${data.radius}km:\n`));
1278
+ for (const agent of data.agents) {
1279
+ const stars = '★'.repeat(Math.round(agent.avgRating)) + '☆'.repeat(5 - Math.round(agent.avgRating));
1280
+ const instant = agent.autoApprove ? chalk_1.default.magenta('⚡INSTANT') : '';
1281
+ const verified = agent.verified ? chalk_1.default.blue('✓') : '';
1282
+ console.log(` ${chalk_1.default.bold(agent.name)} ${verified} ${chalk_1.default.yellow(stars)} ${instant}`);
1283
+ console.log(` ${chalk_1.default.gray(agent.description || 'No description')}`);
1284
+ console.log(` 📍 ${brand.green(agent.location?.name || 'Unknown')} - ${chalk_1.default.cyan(agent.distance + 'km away')}`);
1285
+ console.log(` ${chalk_1.default.gray(agent.id)}`);
1286
+ console.log('');
1287
+ }
1288
+ console.log(chalk_1.default.gray(`Tip: gopherhole discover info <agent-id> for details\n`));
1289
+ }
1290
+ catch (err) {
1291
+ spinner.fail(chalk_1.default.red(err.message));
1292
+ process.exit(1);
1293
+ }
1294
+ });
1234
1295
  discover
1235
1296
  .command('info <agentId>')
1236
1297
  .description(`Get detailed info about an agent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gopherhole/cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "GopherHole CLI - Connect AI agents to the world",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -1217,6 +1217,7 @@ ${chalk.bold('Examples:')}
1217
1217
  .option('--content-mode <contentMode>', 'Filter by content mode (MIME type)')
1218
1218
  .option('--owner <owner>', 'Filter by organization/tenant name')
1219
1219
  .option('--verified', 'Only show agents from verified organizations')
1220
+ .option('--country <code>', 'Filter by country code (e.g., NZ, US)')
1220
1221
  .option('-s, --sort <sort>', 'Sort by: rating, popular, recent', 'rating')
1221
1222
  .option('-l, --limit <limit>', 'Number of results (max 50)', '10')
1222
1223
  .option('-o, --offset <offset>', 'Pagination offset')
@@ -1233,6 +1234,7 @@ ${chalk.bold('Examples:')}
1233
1234
  if (options.contentMode) params.set('contentMode', options.contentMode);
1234
1235
  if (options.owner) params.set('owner', options.owner);
1235
1236
  if (options.verified) params.set('verified', 'true');
1237
+ if (options.country) params.set('country', options.country);
1236
1238
  if (options.sort) params.set('sort', options.sort);
1237
1239
  if (options.limit) params.set('limit', options.limit);
1238
1240
  if (options.offset) params.set('offset', options.offset);
@@ -1349,6 +1351,69 @@ discover
1349
1351
  }
1350
1352
  });
1351
1353
 
1354
+ discover
1355
+ .command('nearby')
1356
+ .description(`Find agents near a location
1357
+
1358
+ ${chalk.bold('Examples:')}
1359
+ $ gopherhole discover nearby --lat -36.85 --lng 174.74
1360
+ $ gopherhole discover nearby --lat -36.85 --lng 174.74 --radius 25 --tag retail
1361
+ `)
1362
+ .requiredOption('--lat <lat>', 'Latitude')
1363
+ .requiredOption('--lng <lng>', 'Longitude')
1364
+ .option('-r, --radius <km>', 'Search radius in km', '10')
1365
+ .option('-t, --tag <tag>', 'Filter by tag')
1366
+ .option('-c, --category <category>', 'Filter by category')
1367
+ .option('-l, --limit <limit>', 'Number of results (max 50)', '20')
1368
+ .action(async (options) => {
1369
+ const spinner = ora('Searching nearby agents...').start();
1370
+
1371
+ try {
1372
+ const sessionId = config.get('sessionId') as string;
1373
+ const params = new URLSearchParams();
1374
+ params.set('lat', options.lat);
1375
+ params.set('lng', options.lng);
1376
+ params.set('radius', options.radius);
1377
+ if (options.tag) params.set('tag', options.tag);
1378
+ if (options.category) params.set('category', options.category);
1379
+ params.set('limit', options.limit);
1380
+
1381
+ log('GET /discover/agents/nearby?' + params.toString());
1382
+ const headers: Record<string, string> = {};
1383
+ if (sessionId) {
1384
+ headers['X-Session-ID'] = sessionId;
1385
+ }
1386
+ const res = await fetch(`${API_URL}/discover/agents/nearby?${params}`, { headers });
1387
+ const data = await res.json();
1388
+ spinner.stop();
1389
+
1390
+ if (!data.agents || data.agents.length === 0) {
1391
+ console.log(chalk.yellow('\nNo agents found nearby.'));
1392
+ console.log(chalk.gray(`Search area: ${options.radius}km from (${options.lat}, ${options.lng})`));
1393
+ return;
1394
+ }
1395
+
1396
+ console.log(chalk.bold(`\n📍 Found ${data.agents.length} agents within ${data.radius}km:\n`));
1397
+
1398
+ for (const agent of data.agents) {
1399
+ const stars = '★'.repeat(Math.round(agent.avgRating)) + '☆'.repeat(5 - Math.round(agent.avgRating));
1400
+ const instant = agent.autoApprove ? chalk.magenta('⚡INSTANT') : '';
1401
+ const verified = agent.verified ? chalk.blue('✓') : '';
1402
+
1403
+ console.log(` ${chalk.bold(agent.name)} ${verified} ${chalk.yellow(stars)} ${instant}`);
1404
+ console.log(` ${chalk.gray(agent.description || 'No description')}`);
1405
+ console.log(` 📍 ${brand.green(agent.location?.name || 'Unknown')} - ${chalk.cyan(agent.distance + 'km away')}`);
1406
+ console.log(` ${chalk.gray(agent.id)}`);
1407
+ console.log('');
1408
+ }
1409
+
1410
+ console.log(chalk.gray(`Tip: gopherhole discover info <agent-id> for details\n`));
1411
+ } catch (err) {
1412
+ spinner.fail(chalk.red((err as Error).message));
1413
+ process.exit(1);
1414
+ }
1415
+ });
1416
+
1352
1417
  discover
1353
1418
  .command('info <agentId>')
1354
1419
  .description(`Get detailed info about an agent