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): preserve explicit setup PATH errors

Kshitij Jhunjhunwala692dec45e767
diff --git a/ts/packages/cli/src/commands/setup.cmd.ts b/ts/packages/cli/src/commands/setup.cmd.ts
index 2c7979500..782c0a79d 100644
--- a/ts/packages/cli/src/commands/setup.cmd.ts
+++ b/ts/packages/cli/src/commands/setup.cmd.ts
@@ -71,6 +71,13 @@ const setupBaseCmd = Command.make(
);
}
if (detected.length === 0) {
+ if (target === 'claude' || target === 'codex') {
+ return yield* Effect.fail(
+ new Error(
+ `${target} is not installed or not available on PATH. Install it and rerun \`composio setup${uninstall ? ' --uninstall' : ''} --target ${target}\`.`
+ )
+ );
+ }
if (!ifPresent || target !== 'auto') {
return yield* Effect.fail(
new Error(
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 2d0469047..d6d49162f 100644
--- a/ts/packages/cli/test/src/commands/setup.cmd.test.ts
+++ b/ts/packages/cli/test/src/commands/setup.cmd.test.ts
@@ -669,6 +669,11 @@ describe('CLI: composio setup', () => {
cli(['setup', '--target', 'claude', '--yes', '--if-present'])
);
expect(Exit.isFailure(exit)).toBe(true);
+ if (Exit.isFailure(exit)) {
+ expect(Cause.pretty(exit.cause)).toContain(
+ 'claude is not installed or not available on PATH'
+ );
+ }
})
);
});