UNPKG

newo

Version:

NEWO CLI: Professional command-line tool with modular architecture for NEWO AI Agent development. Features account migration, integration management, webhook automation, AKB knowledge base, project attributes, sandbox testing, IDN-based file management, r

39 lines • 2.08 kB
/** * List Registries Command Handler - Lists available project registries */ import { makeClient, listRegistries } from '../../api.js'; import { getValidAccessToken } from '../../auth.js'; import { requireSingleCustomer } from '../customer-selection.js'; export async function handleListRegistriesCommand(customerConfig, args, verbose = false) { try { const selectedCustomer = requireSingleCustomer(customerConfig, args.customer); if (verbose) { console.log(`šŸ“‹ Fetching registries for customer: ${selectedCustomer.idn}`); } // Get access token and create client const accessToken = await getValidAccessToken(selectedCustomer); const client = await makeClient(verbose, accessToken); console.log('šŸ” Fetching available project registries...\n'); const registries = await listRegistries(client); if (registries.length === 0) { console.log('No registries found.'); return; } console.log(`āœ… Found ${registries.length} registries:\n`); // Display registries in a table-like format console.log(' IDN │ Public │ ID'); console.log(' ────────────────────────┼────────┼────────────────────────────────────'); for (const registry of registries) { const publicStatus = registry.is_public ? 'Yes' : 'No'; const idnPadded = registry.idn.padEnd(22); const publicPadded = publicStatus.padEnd(6); console.log(` ${idnPadded} │ ${publicPadded} │ ${registry.id}`); } console.log('\nšŸ’” Use "newo list-registry-items <registry-idn>" to see available projects in a registry'); } catch (error) { console.error('āŒ Failed to list registries:', error instanceof Error ? error.message : String(error)); process.exit(1); } } //# sourceMappingURL=list-registries.js.map