@devries-cameron20 / composio Mirror · read-only / commits / c9a43db6c
Fork 0

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

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 02:00 UTC

feat(cli): add parallel execute support and help examples (#3033)

## Summary - add `--parallel` / `-p` support for `composio execute` - show per-tool success and failure output for parallel runs - document parallel execute in command help and root help ## Notes - this branch already merges the latest `origin/next` - `ts/packages/cli` currently has an unrelated `origin/next` typecheck issue in `src/services/run-subagent-acp.ts`

Rahul Tarak committed Mar 26, 2026 at 18:44 UTC c9a43db6ca946087400d8290019d8770bab0a38a
3 files changed +19 -33
ts/packages/cli/src/commands/root-help.ts
+8 -1
@@ -177,7 +177,7 @@ const SUBCOMMAND_HELP: Record<string, SubcommandHelp> = {
177 ],
178 },
179 execute: {
180 - usage: 'composio execute <slug> [-d, --data text] [--dry-run] [--get-schema]',
180 + usage: 'composio execute <slug> [-d, --data text] [--dry-run] [--get-schema] [--parallel]',
181 description:
182 'Execute a tool by slug. Validates inputs against cached schemas and checks connections automatically — just try it and it will tell you what to fix.',
183 args: [{ name: '<slug>', description: 'Tool slug (e.g. "GITHUB_CREATE_ISSUE")' }],
@@ -187,6 +187,10 @@ const SUBCOMMAND_HELP: Record<string, SubcommandHelp> = {
187 description:
188 'JSON or JS-style object arguments, e.g. -d \'{ repo: "foo" }\', @file, or - for stdin',
189 },
190 + {
191 + name: '-p, --parallel',
192 + description: 'Execute repeated TOOL_SLUG -d <text> groups concurrently',
193 + },
194 {
195 name: '--get-schema',
196 description: 'Fetch and print the raw tool schema without executing',
@@ -219,6 +223,9 @@ const SUBCOMMAND_HELP: Record<string, SubcommandHelp> = {
223 '',
224 '# Read arguments from a file',
225 'composio execute GITHUB_CREATE_ISSUE -d @issue.json',
226 + '',
227 + '# Execute multiple tools concurrently',
228 + `composio execute --parallel GMAIL_SEND_EMAIL -d '{ recipient_email: "a@b.com" }' GITHUB_CREATE_AN_ISSUE -d '{ owner: "acme", repo: "app", title: "Bug" }'`,
229 ],
230 seeAlso: [
231 'composio search "<query>" Find tool slugs by use case',
ts/packages/cli/src/commands/tools/commands/tools.execute.cmd.ts
+6 -30
@@ -649,36 +649,6 @@ type ParsedParallelExecuteArgs = SharedRunToolsExecuteParams & {
649 readonly specs: ReadonlyArray<ParallelExecuteSpec>;
650 };
651
652 -type ParallelExecuteResult =
653 - | {
654 - readonly slug: string;
655 - readonly successful: true;
656 - readonly dryRun: true;
657 - readonly arguments: Record<string, unknown>;
658 - readonly userId: string;
659 - readonly schemaPath?: string;
660 - readonly schemaVersion?: string | null;
661 - }
662 - | {
663 - readonly slug: string;
664 - readonly successful: true;
665 - readonly version: string | null;
666 - readonly schemaPath: string;
667 - readonly inputSchema: Record<string, unknown>;
668 - }
669 - | ({
670 - readonly slug: string;
671 - } & ToolExecuteResponse)
672 - | ({
673 - readonly slug: string;
674 - } & StoredExecuteOutputSummary)
675 - | {
676 - readonly slug: string;
677 - readonly successful: false;
678 - readonly error: string;
679 - readonly logId?: string;
680 - };
681 -
652 type ResolvedExecuteContext = {
653 readonly ui: TerminalUI;
654 readonly executor: ToolsExecutor;
@@ -1599,6 +1569,7 @@ export const runParallelToolsExecuteFromArgv = (argv: ReadonlyArray<string>) =>
1569 catch: error => (error instanceof Error ? error : new Error(String(error))),
1570 }).pipe(Effect.flatMap(runParallelToolsExecuteFromParsed));
1571 };
1572 +
1573 export const rootToolsCmd$Execute = Command.make(
1574 'execute',
1575 { slug, data, getSchema, dryRun, skipConnectionCheck, skipToolParamsCheck, skipChecks },
@@ -1624,10 +1595,12 @@ export const rootToolsCmd$Execute = Command.make(
1595 '',
1596 'Examples:',
1597 ' composio execute GMAIL_SEND_EMAIL -d \'{ recipient_email: "a@b.com", body: "Hello" }\'',
1598 + ' composio execute --parallel GMAIL_SEND_EMAIL -d \'{ recipient_email: "a@b.com" }\' GITHUB_CREATE_AN_ISSUE -d \'{ owner: "acme", repo: "app", title: "Bug" }\'',
1599 " composio execute GMAIL_SEND_EMAIL --dry-run -d '{ ... }' Preview without executing",
1600 ' composio execute GMAIL_SEND_EMAIL --get-schema Fetch and print the input schema',
1601 '',
1602 'Flags:',
1603 + ' -p, --parallel Execute repeated TOOL_SLUG -d <json> groups concurrently',
1604 ' --skip-connection-check Skip the connected-account check',
1605 ' --skip-tool-params-check Skip input validation against cached schema',
1606 ' --skip-checks Skip both checks above',
@@ -1688,6 +1661,9 @@ export const devToolsCmd$Execute = Command.make(
1661 ' composio dev playground-execute GMAIL_SEND_EMAIL -d \'{ recipient_email: "a@b.com", body: "Hello" }\'',
1662 ' composio dev playground-execute GMAIL_SEND_EMAIL --dry-run -d \'{ recipient_email: "a@b.com", body: "Hello" }\'',
1663 ' composio dev playground-execute GMAIL_SEND_EMAIL --get-schema',
1664 + '',
1665 + 'Flags:',
1666 + ' -p, --parallel Execute repeated TOOL_SLUG -d <json> groups concurrently',
1667 ].join('\n')
1668 )
1669 );
ts/packages/cli/test/src/commands/tools/tools.execute.cmd.test.ts
+5 -2
@@ -819,9 +819,12 @@ describe('CLI: composio execute', () => {
819 const output = lines.join('\n');
820
821 expect(output).toContain('USAGE');
822 - expect(output).toContain('composio execute <slug> [-d, --data text] [--dry-run]');
822 + expect(output).toContain(
823 + 'composio execute <slug> [-d, --data text] [--dry-run] [--get-schema] [--parallel]'
824 + );
825 expect(output).toContain('composio execute GMAIL_SEND_EMAIL --get-schema');
824 - expect(output).not.toContain('--parallel');
826 + expect(output).toContain('--parallel');
827 + expect(output).toContain('GITHUB_CREATE_AN_ISSUE');
828 })
829 );
830 });