Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
ts 24 lines 934 Bytes
Raw
1 import * as fs from 'node:fs';
2 import * as path from 'node:path';
3 import { buildComposioCliSkill, type SkillReleaseChannel } from '../skills-src/composio-cli/index';
4
5 const args = process.argv.slice(2);
6
7 const readArg = (name: string) => {
8 const index = args.indexOf(name);
9 return index >= 0 ? args[index + 1] : undefined;
10 };
11
12 const channelArg = readArg('--channel') ?? 'stable';
13 if (channelArg !== 'stable' && channelArg !== 'beta') {
14 throw new Error(`Invalid --channel value "${channelArg}". Expected "stable" or "beta".`);
15 }
16
17 const outputDirArg = readArg('--output-dir') ?? path.resolve(process.cwd(), 'dist/skills');
18 const outputDir = path.resolve(process.cwd(), outputDirArg);
19 const channel = channelArg as SkillReleaseChannel;
20
21 fs.mkdirSync(outputDir, { recursive: true });
22 const skillDir = buildComposioCliSkill({ channel, outputRoot: outputDir });
23
24 console.log(`Built composio-cli skill for ${channel} at ${skillDir}`);