UNPKG

@agentled/cli

Version:

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

44 lines 1.81 kB
import { readFileSync } from 'node:fs'; import { AgentledClient } from '../client.js'; import { printError, printOutput } from '../utils/output.js'; function readBranding(opts) { if (!opts.input && !opts.file) throw new Error('Provide branding JSON with --input or --file'); if (opts.input && opts.file) throw new Error('Provide branding JSON with either --input or --file, not both'); return JSON.parse(opts.file ? readFileSync(opts.file, 'utf8') : opts.input); } export function registerBrandingCommands(program) { const branding = program.command('branding').description('Manage workspace branding settings'); branding .command('get') .description('Get workspace branding configuration') .option('--format <fmt>', 'Output format', 'json') .action(async (opts) => { try { const result = await new AgentledClient().getBranding(); printOutput(result, opts.format); } catch (error) { const message = error instanceof Error ? error.message : String(error); printError(message); } }); branding .command('update') .description('Update workspace branding configuration') .option('--input <json>', 'Branding JSON object') .option('--file <path>', 'Path to branding JSON file') .option('--format <fmt>', 'Output format', 'json') .action(async (opts) => { try { const result = await new AgentledClient().updateBranding(readBranding(opts)); printOutput(result, opts.format); } catch (error) { const message = error instanceof Error ? error.message : String(error); printError(message); } }); } //# sourceMappingURL=branding.js.map