@gopherhole/cli 0.1.16 → 0.1.18
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 +59 -0
- package/package.json +1 -1
- package/src/index.ts +62 -0
package/dist/index.js
CHANGED
|
@@ -1095,6 +1095,8 @@ ${chalk_1.default.bold('Examples:')}
|
|
|
1095
1095
|
.option('--skill-tag <skillTag>', 'Filter by skill tag')
|
|
1096
1096
|
.option('--content-mode <contentMode>', 'Filter by content mode (MIME type)')
|
|
1097
1097
|
.option('--owner <owner>', 'Filter by organization/tenant name')
|
|
1098
|
+
.option('--verified', 'Only show agents from verified organizations')
|
|
1099
|
+
.option('--country <code>', 'Filter by country code (e.g., NZ, US)')
|
|
1098
1100
|
.option('-s, --sort <sort>', 'Sort by: rating, popular, recent', 'rating')
|
|
1099
1101
|
.option('-l, --limit <limit>', 'Number of results (max 50)', '10')
|
|
1100
1102
|
.option('-o, --offset <offset>', 'Pagination offset')
|
|
@@ -1115,6 +1117,10 @@ ${chalk_1.default.bold('Examples:')}
|
|
|
1115
1117
|
params.set('contentMode', options.contentMode);
|
|
1116
1118
|
if (options.owner)
|
|
1117
1119
|
params.set('owner', options.owner);
|
|
1120
|
+
if (options.verified)
|
|
1121
|
+
params.set('verified', 'true');
|
|
1122
|
+
if (options.country)
|
|
1123
|
+
params.set('country', options.country);
|
|
1118
1124
|
if (options.sort)
|
|
1119
1125
|
params.set('sort', options.sort);
|
|
1120
1126
|
if (options.limit)
|
|
@@ -1228,6 +1234,59 @@ discover
|
|
|
1228
1234
|
process.exit(1);
|
|
1229
1235
|
}
|
|
1230
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 params = new URLSearchParams();
|
|
1255
|
+
params.set('lat', options.lat);
|
|
1256
|
+
params.set('lng', options.lng);
|
|
1257
|
+
params.set('radius', options.radius);
|
|
1258
|
+
if (options.tag)
|
|
1259
|
+
params.set('tag', options.tag);
|
|
1260
|
+
if (options.category)
|
|
1261
|
+
params.set('category', options.category);
|
|
1262
|
+
params.set('limit', options.limit);
|
|
1263
|
+
log('GET /discover/agents/nearby?' + params.toString());
|
|
1264
|
+
const res = await fetch(`${API_URL}/discover/agents/nearby?${params}`);
|
|
1265
|
+
const data = await res.json();
|
|
1266
|
+
spinner.stop();
|
|
1267
|
+
if (!data.agents || data.agents.length === 0) {
|
|
1268
|
+
console.log(chalk_1.default.yellow('\nNo agents found nearby.'));
|
|
1269
|
+
console.log(chalk_1.default.gray(`Search area: ${options.radius}km from (${options.lat}, ${options.lng})`));
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
console.log(chalk_1.default.bold(`\n📍 Found ${data.agents.length} agents within ${data.radius}km:\n`));
|
|
1273
|
+
for (const agent of data.agents) {
|
|
1274
|
+
const stars = '★'.repeat(Math.round(agent.avgRating)) + '☆'.repeat(5 - Math.round(agent.avgRating));
|
|
1275
|
+
const instant = agent.autoApprove ? chalk_1.default.magenta('⚡INSTANT') : '';
|
|
1276
|
+
const verified = agent.verified ? chalk_1.default.blue('✓') : '';
|
|
1277
|
+
console.log(` ${chalk_1.default.bold(agent.name)} ${verified} ${chalk_1.default.yellow(stars)} ${instant}`);
|
|
1278
|
+
console.log(` ${chalk_1.default.gray(agent.description || 'No description')}`);
|
|
1279
|
+
console.log(` 📍 ${brand.green(agent.location?.name || 'Unknown')} - ${chalk_1.default.cyan(agent.distance + 'km away')}`);
|
|
1280
|
+
console.log(` ${chalk_1.default.gray(agent.id)}`);
|
|
1281
|
+
console.log('');
|
|
1282
|
+
}
|
|
1283
|
+
console.log(chalk_1.default.gray(`Tip: gopherhole discover info <agent-id> for details\n`));
|
|
1284
|
+
}
|
|
1285
|
+
catch (err) {
|
|
1286
|
+
spinner.fail(chalk_1.default.red(err.message));
|
|
1287
|
+
process.exit(1);
|
|
1288
|
+
}
|
|
1289
|
+
});
|
|
1231
1290
|
discover
|
|
1232
1291
|
.command('info <agentId>')
|
|
1233
1292
|
.description(`Get detailed info about an agent
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1216,6 +1216,8 @@ ${chalk.bold('Examples:')}
|
|
|
1216
1216
|
.option('--skill-tag <skillTag>', 'Filter by skill tag')
|
|
1217
1217
|
.option('--content-mode <contentMode>', 'Filter by content mode (MIME type)')
|
|
1218
1218
|
.option('--owner <owner>', 'Filter by organization/tenant name')
|
|
1219
|
+
.option('--verified', 'Only show agents from verified organizations')
|
|
1220
|
+
.option('--country <code>', 'Filter by country code (e.g., NZ, US)')
|
|
1219
1221
|
.option('-s, --sort <sort>', 'Sort by: rating, popular, recent', 'rating')
|
|
1220
1222
|
.option('-l, --limit <limit>', 'Number of results (max 50)', '10')
|
|
1221
1223
|
.option('-o, --offset <offset>', 'Pagination offset')
|
|
@@ -1231,6 +1233,8 @@ ${chalk.bold('Examples:')}
|
|
|
1231
1233
|
if (options.skillTag) params.set('skillTag', options.skillTag);
|
|
1232
1234
|
if (options.contentMode) params.set('contentMode', options.contentMode);
|
|
1233
1235
|
if (options.owner) params.set('owner', options.owner);
|
|
1236
|
+
if (options.verified) params.set('verified', 'true');
|
|
1237
|
+
if (options.country) params.set('country', options.country);
|
|
1234
1238
|
if (options.sort) params.set('sort', options.sort);
|
|
1235
1239
|
if (options.limit) params.set('limit', options.limit);
|
|
1236
1240
|
if (options.offset) params.set('offset', options.offset);
|
|
@@ -1347,6 +1351,64 @@ discover
|
|
|
1347
1351
|
}
|
|
1348
1352
|
});
|
|
1349
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 params = new URLSearchParams();
|
|
1373
|
+
params.set('lat', options.lat);
|
|
1374
|
+
params.set('lng', options.lng);
|
|
1375
|
+
params.set('radius', options.radius);
|
|
1376
|
+
if (options.tag) params.set('tag', options.tag);
|
|
1377
|
+
if (options.category) params.set('category', options.category);
|
|
1378
|
+
params.set('limit', options.limit);
|
|
1379
|
+
|
|
1380
|
+
log('GET /discover/agents/nearby?' + params.toString());
|
|
1381
|
+
const res = await fetch(`${API_URL}/discover/agents/nearby?${params}`);
|
|
1382
|
+
const data = await res.json();
|
|
1383
|
+
spinner.stop();
|
|
1384
|
+
|
|
1385
|
+
if (!data.agents || data.agents.length === 0) {
|
|
1386
|
+
console.log(chalk.yellow('\nNo agents found nearby.'));
|
|
1387
|
+
console.log(chalk.gray(`Search area: ${options.radius}km from (${options.lat}, ${options.lng})`));
|
|
1388
|
+
return;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
console.log(chalk.bold(`\n📍 Found ${data.agents.length} agents within ${data.radius}km:\n`));
|
|
1392
|
+
|
|
1393
|
+
for (const agent of data.agents) {
|
|
1394
|
+
const stars = '★'.repeat(Math.round(agent.avgRating)) + '☆'.repeat(5 - Math.round(agent.avgRating));
|
|
1395
|
+
const instant = agent.autoApprove ? chalk.magenta('⚡INSTANT') : '';
|
|
1396
|
+
const verified = agent.verified ? chalk.blue('✓') : '';
|
|
1397
|
+
|
|
1398
|
+
console.log(` ${chalk.bold(agent.name)} ${verified} ${chalk.yellow(stars)} ${instant}`);
|
|
1399
|
+
console.log(` ${chalk.gray(agent.description || 'No description')}`);
|
|
1400
|
+
console.log(` 📍 ${brand.green(agent.location?.name || 'Unknown')} - ${chalk.cyan(agent.distance + 'km away')}`);
|
|
1401
|
+
console.log(` ${chalk.gray(agent.id)}`);
|
|
1402
|
+
console.log('');
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
console.log(chalk.gray(`Tip: gopherhole discover info <agent-id> for details\n`));
|
|
1406
|
+
} catch (err) {
|
|
1407
|
+
spinner.fail(chalk.red((err as Error).message));
|
|
1408
|
+
process.exit(1);
|
|
1409
|
+
}
|
|
1410
|
+
});
|
|
1411
|
+
|
|
1350
1412
|
discover
|
|
1351
1413
|
.command('info <agentId>')
|
|
1352
1414
|
.description(`Get detailed info about an agent
|