@agentled/cli
Version:
CLI for Agentled — manage workflows, apps, and knowledge from the command line. Zero context-window cost for AI agents.
111 lines • 5.05 kB
JavaScript
/**
* Agentled CLI — Zero context-window cost access to workflows, apps, and knowledge.
*
* Usage:
* agentled auth login --key wsk_...
* agentled workflows list
* agentled apps test web-scraping scrape --input '{"url": "..."}'
*
* Environment variables:
* AGENTLED_API_KEY — Workspace API key (wsk_*)
* AGENTLED_URL — Base URL (default: https://www.agentled.app)
* AGENTLED_WORKSPACE — Saved workspace id, alias, or name to target
*/
import { Command } from 'commander';
import { createRequire } from 'module';
import { registerAuthCommands } from './commands/auth.js';
import { registerWorkflowCommands } from './commands/workflows.js';
import { registerExecutionCommands } from './commands/executions.js';
import { registerAppCommands } from './commands/apps.js';
import { registerKnowledgeCommands } from './commands/knowledge.js';
import { registerAiCommands } from './commands/ai.js';
import { registerWorkspaceCommands } from './commands/workspace.js';
import { registerDoCommand } from './commands/do.js';
import { registerChatCommands } from './commands/chat.js';
import { registerOnboardingCommands } from './commands/onboarding.js';
import { registerSkillsCommands } from './commands/skills.js';
import { registerSchemaCommand } from './commands/schema.js';
import { registerExamplesCommand } from './commands/examples.js';
import { registerToolsCommands } from './commands/tools.js';
import { registerAgentCommands } from './commands/agents.js';
import { registerBrandingCommands } from './commands/branding.js';
import { registerMemoryCommands } from './commands/memory.js';
import { registerFeedbackCommands } from './commands/feedback.js';
import { registerClientsCommands } from './commands/clients.js';
import { registerIntentCommands } from './commands/intent.js';
import { registerProactiveAgentCommands } from './commands/proactive-agents.js';
import { registerModelCommands } from './commands/models.js';
import { registerRoutineCommands } from './commands/routines.js';
import { registerUseCaseCommands } from './commands/use-cases.js';
import { registerWorkspaceViewCommands } from './commands/workspace-views.js';
import { registerGroupManifestCommands } from './commands/group-manifest.js';
import { registerInitCommand } from './commands/init.js';
import { registerFixtureCommands } from './commands/fixture.js';
import { registerTestCommand } from './commands/test.js';
import { registerDryRunCommand } from './commands/dryrun.js';
import { registerBuilderWorkItemCommands } from './commands/builder-work-items.js';
import { registerWorkspacePackageCommands } from './commands/workspace-packages.js';
import { checkForUpdate, printUpdateNotice } from './update-check.js';
const require = createRequire(import.meta.url);
const { version } = require('../package.json');
const PKG_NAME = '@agentled/cli';
// Kick off the update check so its latency overlaps with command work.
// Cache-first (free on hit); hard-capped at 1.2s on miss. Print notice
// on `exit` so every code path is covered without plumbing each command.
let latestVersion = null;
const updatePromise = checkForUpdate(PKG_NAME, version).then((v) => {
latestVersion = v;
});
process.on('exit', () => {
if (latestVersion)
printUpdateNotice(PKG_NAME, version, latestVersion);
});
const program = new Command();
program
.name('agentled')
.description('Agentled CLI — manage workflows, apps, and knowledge. Optimized for AI agents.')
.version(version)
.option('--workspace <workspace>', 'Use a saved workspace by id, alias, or name for this command');
program.hook('preAction', (_thisCommand, actionCommand) => {
const workspace = actionCommand.optsWithGlobals().workspace;
if (workspace) {
process.env.AGENTLED_WORKSPACE = workspace;
}
});
// Register all command groups
registerAuthCommands(program);
registerWorkflowCommands(program);
registerExecutionCommands(program);
registerAppCommands(program);
registerKnowledgeCommands(program);
registerAiCommands(program);
registerWorkspaceCommands(program);
registerDoCommand(program);
registerChatCommands(program);
registerOnboardingCommands(program);
registerSkillsCommands(program);
registerSchemaCommand(program);
registerExamplesCommand(program);
registerToolsCommands(program);
registerAgentCommands(program);
registerBrandingCommands(program);
registerMemoryCommands(program);
registerFeedbackCommands(program);
registerClientsCommands(program);
registerIntentCommands(program);
registerProactiveAgentCommands(program);
registerModelCommands(program);
registerRoutineCommands(program);
registerUseCaseCommands(program);
registerWorkspaceViewCommands(program);
registerGroupManifestCommands(program);
registerInitCommand(program);
registerFixtureCommands(program);
registerTestCommand(program);
registerDryRunCommand(program);
registerBuilderWorkItemCommands(program);
registerWorkspacePackageCommands(program);
await program.parseAsync();
await updatePromise;
//# sourceMappingURL=index.js.map