Skip to content

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

fix(cli): require all explicit setup targets

Kshitij Jhunjhunwalaf09141455c9f
diff --git a/ts/packages/cli/src/commands/setup.cmd.ts b/ts/packages/cli/src/commands/setup.cmd.ts
index 92de2fb0f..2c7979500 100644
--- a/ts/packages/cli/src/commands/setup.cmd.ts
+++ b/ts/packages/cli/src/commands/setup.cmd.ts
@@ -63,6 +63,13 @@ const setupBaseCmd = Command.make(
if (notDetected.length > 0) {
yield* ui.log.info(`${formatTargets(notDetected)} not detected.`);
}
+ if (target === 'all' && notDetected.length > 0) {
+ return yield* Effect.fail(
+ new Error(
+ `\`--target all\` requires Claude Code and Codex. Missing: ${formatTargets(notDetected)}. Install the missing agent host, or use \`--target auto\` to operate on detected hosts only.`
+ )
+ );
+ }
if (detected.length === 0) {
if (!ifPresent || target !== 'auto') {
return yield* Effect.fail(
diff --git a/ts/packages/cli/test/src/commands/setup.cmd.test.ts b/ts/packages/cli/test/src/commands/setup.cmd.test.ts
index d5ad8ff2c..2d0469047 100644
--- a/ts/packages/cli/test/src/commands/setup.cmd.test.ts
+++ b/ts/packages/cli/test/src/commands/setup.cmd.test.ts
@@ -427,6 +427,29 @@ describe('CLI: composio setup', () => {
);
});
+ const partialAllTargets = makeFakeHosts({ claude: { available: true } });
+ layer(TestLive({ commandRunner: partialAllTargets.runner }))(
+ 'explicit all-host setup with a missing host',
+ it => {
+ it.scoped('fails before mutating the detected host', () =>
+ Effect.gen(function* () {
+ const exit = yield* Effect.exit(cli(['setup', '--target', 'all', '--yes']));
+
+ expect(Exit.isFailure(exit)).toBe(true);
+ expect(partialAllTargets.state.claude).toMatchObject({
+ marketplace: 'missing',
+ plugin: 'missing',
+ });
+ expect(
+ partialAllTargets.commands.some(parts =>
+ ['marketplace', 'install', 'enable'].some(operation => parts.includes(operation))
+ )
+ ).toBe(false);
+ })
+ );
+ }
+ );
+
const uninstallBoth = makeFakeHosts({
claude: { available: true, marketplace: 'canonical', plugin: 'enabled' },
codex: { available: true, marketplace: 'canonical', plugin: 'enabled' },