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 2.39 kB
/* eslint-disable no-console */ import { BUILTIN_TOOLS_CATALOG } from '../builtin-tools-catalog.js'; import { printOutput } from '../utils/output.js'; function renderTable() { const lines = []; lines.push(`Builtin tools for \`aiActionWithTools\` steps (${BUILTIN_TOOLS_CATALOG.length} total):`); lines.push(''); for (const t of BUILTIN_TOOLS_CATALOG) { const providers = t.providers.join(', '); const credits = t.typicalCreditsPerCall ? ` (~${t.typicalCreditsPerCall} credits/call)` : ''; lines.push(` - ${t.value} [providers: ${providers}]${credits}`); lines.push(` ${t.description}`); if (t.extraKeys?.length) { lines.push(` extra keys: ${t.extraKeys.join(', ')}`); } lines.push(` example: ${JSON.stringify(t.example)}`); } lines.push(''); lines.push('Usage on a step:'); lines.push(' {'); lines.push(' "id": "analyze",'); lines.push(' "type": "aiActionWithTools",'); lines.push(' "name": "Analyze with tools",'); lines.push(' "tools": ['); lines.push(' { "type": "builtin", "name": "web_search", "builtinType": "web_search" },'); lines.push(' { "type": "builtin", "name": "workspace_memory", "builtinType": "workspace_memory" }'); lines.push(' ],'); lines.push(' "pipelineStepPrompt": { "template": "…", "responseStructure": { … } },'); lines.push(' "creditCost": 10,'); lines.push(' "next": { "stepId": "…" }'); lines.push(' }'); lines.push(''); lines.push('Scaffold: `agentled workflows scaffold ai-with-tools`'); return lines.join('\n'); } export function registerToolsCommands(program) { const tools = program .command('tools') .description('Discover runtime tools (e.g. builtin tools for aiActionWithTools).'); tools .command('builtins') .description('List builtin tools (`tools[].builtinType`) accepted by aiActionWithTools steps.') .option('--format <format>', 'Output format: table (default), json', 'table') .action((opts) => { const format = opts.format; if (format === 'json' || format === 'minimal') { printOutput({ builtinTools: BUILTIN_TOOLS_CATALOG }, format); return; } console.log(renderTable()); }); } //# sourceMappingURL=tools.js.map