@startanaicompany/dns 1.4.0 → 1.5.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 (2) hide show
  1. package/bin/saac_dns.js +123 -1
  2. package/package.json +1 -1
package/bin/saac_dns.js CHANGED
@@ -10,7 +10,7 @@ const program = new Command();
10
10
 
11
11
  program
12
12
  .name('saac_dns')
13
- .description('SAAC DNS — Programmatic Domain Registration & DNS Management CLI')
13
+ .description('SAAC DNS — Programmatic Domain Registration & DNS Management CLI\n\n Quick start:\n saac_dns help Show all commands\n saac_dns tld list Browse 460+ supported TLDs with pricing\n saac_dns search <name> Check domain availability\n saac_dns buy <domain> Register a domain')
14
14
  .version('1.0.0')
15
15
  .option('--json', 'Output raw JSON')
16
16
  .option('--quiet', 'Minimal output')
@@ -1340,6 +1340,128 @@ webhooksCmd
1340
1340
  } catch (err) { handleError(err); }
1341
1341
  });
1342
1342
 
1343
+ // ─── tld ─────────────────────────────────────────────────────────────────────
1344
+
1345
+ const tldCmd = program.command('tld').description('TLD (top-level domain) utilities');
1346
+
1347
+ tldCmd
1348
+ .command('list')
1349
+ .description('List all supported TLDs with pricing')
1350
+ .option('--search <keyword>', 'Filter TLDs by keyword (e.g. health, tech, shop)')
1351
+ .option('--sort <by>', 'Sort by: tld (default) or price', 'tld')
1352
+ .option('--all', 'Show all 460+ TLDs (default shows top 50 by price)', false)
1353
+ .action(async (opts) => {
1354
+ try {
1355
+ const allPrices = await dns.prices();
1356
+ let entries = Object.entries(allPrices); // [['.com', 22.29], ...]
1357
+
1358
+ if (opts.search) {
1359
+ const kw = opts.search.toLowerCase();
1360
+ entries = entries.filter(([tld]) => tld.includes(kw));
1361
+ }
1362
+
1363
+ if (opts.sort === 'price') {
1364
+ entries.sort((a, b) => a[1] - b[1]);
1365
+ } else {
1366
+ entries.sort((a, b) => a[0].localeCompare(b[0]));
1367
+ }
1368
+
1369
+ const total = entries.length;
1370
+ if (!opts.all && !opts.search && entries.length > 50) {
1371
+ entries = entries.slice(0, 50);
1372
+ }
1373
+
1374
+ output({ entries, total }, (data) => {
1375
+ const table = new Table({
1376
+ head: ['TLD', 'Price/yr'],
1377
+ style: { head: ['cyan'] }
1378
+ });
1379
+ data.entries.forEach(([tld, price]) => {
1380
+ table.push([tld, `$${price}`]);
1381
+ });
1382
+ console.log(table.toString());
1383
+ if (!opts.all && !opts.search && data.total > 50) {
1384
+ console.log(`\nShowing 50 of ${data.total} TLDs. Use --all to see every one, or --search <keyword> to filter.`);
1385
+ } else {
1386
+ console.log(`\nTotal: ${data.entries.length} TLD(s)${opts.search ? ` matching "${opts.search}"` : ''}`);
1387
+ }
1388
+ if (!opts.search) console.log(`Tip: saac_dns tld list --search health — find domain extensions by keyword`);
1389
+ });
1390
+
1391
+ if (isJson()) {
1392
+ console.log(JSON.stringify(Object.fromEntries(entries), null, 2));
1393
+ }
1394
+ } catch (err) { handleError(err); }
1395
+ });
1396
+
1397
+ // ─── help ─────────────────────────────────────────────────────────────────────
1398
+
1399
+ program
1400
+ .command('help')
1401
+ .description('Show a friendly overview of all commands')
1402
+ .action(() => {
1403
+ console.log(`
1404
+ SAAC DNS — Programmatic Domain Registration & DNS Management CLI
1405
+ ────────────────────────────────────────────────────────────────
1406
+
1407
+ DOMAIN SEARCH & REGISTRATION
1408
+ saac_dns search <name> Search availability across 20+ popular TLDs
1409
+ saac_dns search example.health Search a specific TLD
1410
+ saac_dns buy <domain> Register a domain (sends confirmation email)
1411
+ saac_dns buy-confirm <token> Confirm a pending purchase
1412
+ saac_dns list List all your registered domains
1413
+
1414
+ TLD EXPLORER
1415
+ saac_dns tld list Show supported TLDs with pricing (top 50)
1416
+ saac_dns tld list --all Show all 460+ supported TLDs
1417
+ saac_dns tld list --search health Find TLDs matching a keyword
1418
+ saac_dns tld list --sort price Sort by cheapest first
1419
+ saac_dns prices --tld com,io,dev Check pricing for specific TLDs
1420
+
1421
+ DNS RECORDS
1422
+ saac_dns records list <domain> List DNS records
1423
+ saac_dns records add <domain> A @ 1.2.3.4
1424
+ saac_dns records update <domain> <id> --value 4.3.2.1
1425
+ saac_dns records delete <domain> <id>
1426
+ saac_dns setup-web <domain> --ip <address>
1427
+ saac_dns setup-web <domain> --hosting vercel|netlify|cloudflare|railway|render
1428
+
1429
+ EMAIL
1430
+ saac_dns email-fwd list <domain> List email forwards
1431
+ saac_dns email-fwd add <domain> contact me@gmail.com
1432
+ saac_dns setup-email <domain> gmail|office365|zoho|titan
1433
+
1434
+ NAMESERVERS
1435
+ saac_dns ns list <domain> Show nameservers
1436
+ saac_dns ns set <domain> ns1.example.com ns2.example.com
1437
+
1438
+ DOMAIN MANAGEMENT
1439
+ saac_dns info <domain> Full domain details
1440
+ saac_dns renew <domain> Renew a domain
1441
+ saac_dns lock <domain> Lock against unauthorized transfers
1442
+ saac_dns privacy <domain> on|off Toggle WHOIS privacy
1443
+ saac_dns auto-renew <domain> on|off Toggle auto-renewal
1444
+ saac_dns whois <domain> WHOIS lookup
1445
+ saac_dns expiring --days 30 Domains expiring soon
1446
+ saac_dns transfer <domain> --auth <epp-code>
1447
+
1448
+ ACCOUNT
1449
+ saac_dns account balance Check balance
1450
+ saac_dns account fund <amount> Add funds
1451
+ saac_dns config View/edit preferences
1452
+
1453
+ GLOBAL FLAGS
1454
+ --json Output raw JSON (great for AI agents and scripts)
1455
+ --quiet Minimal output
1456
+ --verbose Show raw API responses + timing
1457
+
1458
+ ENVIRONMENT VARIABLES
1459
+ SAAC_USER_API_KEY Your SAAC platform API key (us_...)
1460
+ SAAC_USER_EMAIL Your account email
1461
+ SAAC_DNS_BASE_URL API endpoint (default: https://dns.startanaicompany.com)
1462
+ `);
1463
+ });
1464
+
1343
1465
  // ─── Parse & run ─────────────────────────────────────────────────────────────
1344
1466
 
1345
1467
  // Verbose timing interceptor: check --verbose directly in argv so it runs before parse
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startanaicompany/dns",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "CLI tool for programmatic domain registration and DNS management — by Start An AI Company (SAAC)",
5
5
  "bin": {
6
6
  "saac_dns": "./bin/saac_dns.js"