Files
seal-use/src/cli/commands/llm.ts
T

25 lines
871 B
TypeScript

import type { CorpConfig } from "../../core/config/types.js";
import type { createSealClient } from "../../core/http/factory.js";
import { runCapability } from "../helpers.js";
import { outputOptions } from "../printer.js";
import type { ParsedArgs } from "../types.js";
export async function handleLlmCommand(
action: string | undefined,
client: Awaited<ReturnType<typeof createSealClient>>,
corp: CorpConfig,
args: ParsedArgs
) {
if (action === "config" || action === "get") {
await runCapability("sealLlmConfigGet", client, corp, {}, outputOptions(args.options));
return;
}
if (action === "providers" || action === "list") {
await runCapability("sealLlmProvidersList", client, corp, {}, outputOptions(args.options));
return;
}
throw new Error(`Unknown llm command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
}