UNPKG

@agentled/cli

Version:

CLI for Agentled — manage workflows, apps, and knowledge from the command line. Zero context-window cost for AI agents.

53 lines 1.88 kB
import { AgentledClient } from '../client.js'; import { printOutput, printError } from '../utils/output.js'; export function registerAppCommands(program) { const apps = program .command('apps') .description('Discover apps and test actions'); apps .command('list') .description('List available apps and integrations') .option('--format <fmt>', 'Output format', 'json') .action(async (opts) => { try { const client = new AgentledClient(); const result = await client.listApps(); printOutput(result, opts.format); } catch (e) { printError(e.message); } }); apps .command('actions <appId>') .description('Get action schemas for an app') .option('--format <fmt>', 'Output format', 'json') .action(async (appId, opts) => { try { const client = new AgentledClient(); const result = await client.getAppActions(appId); printOutput(result, opts.format); } catch (e) { printError(e.message); } }); apps .command('test <appId> <actionId>') .description('Test an app action with sample input') .option('--input <json>', 'Input data as JSON') .option('--bypass-cache', 'Bypass cached results') .option('--format <fmt>', 'Output format', 'json') .action(async (appId, actionId, opts) => { try { const input = opts.input ? JSON.parse(opts.input) : undefined; const client = new AgentledClient(); const result = await client.testAppAction(appId, actionId, input, opts.bypassCache); printOutput(result, opts.format); } catch (e) { printError(e.message); } }); } //# sourceMappingURL=apps.js.map