Skip to content

feat(cli): add composio init --install-skills for skill installation#2940

Open
CryogenicPlanet wants to merge 2 commits intonextfrom
cli/init-install-skills
Open

feat(cli): add composio init --install-skills for skill installation#2940
CryogenicPlanet wants to merge 2 commits intonextfrom
cli/init-install-skills

Conversation

@CryogenicPlanet
Copy link
Contributor

@CryogenicPlanet CryogenicPlanet commented Mar 17, 2026

Summary

Adds a --install-skills flag to composio init that installs Composio agent skills (for Claude Code, etc.) as part of project initialization. Users can choose to install skills locally (in the repo's .claude/skills/) or globally (~/.claude/skills/).

Changes

  • Added --install-skills boolean flag to init.cmd.ts
  • Implemented installSkillsFlow() that:
    • Prompts the user to choose between local (repo) and global installation
    • Runs npx skills add composiohq/skills --path <target> via the CommandRunner service
    • Reports success/failure via TerminalUI
  • The flow only runs when --install-skills is explicitly passed; default composio init behavior is unchanged

Type of change

  • New feature

How Has This Been Tested?

  • Tested composio init --install-skills with both local and global installation targets
  • Verified composio init without the flag behaves identically to before

Checklist

  • I have read the Code of Conduct and this PR adheres to it
  • I ran linters/tests locally and they passed
  • I updated documentation as needed
  • I added tests or explain why not applicable
  • I added a changeset if this change affects published packages

@vercel
Copy link

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 18, 2026 2:59am

Request Review

Copy link
Contributor Author

CryogenicPlanet commented Mar 17, 2026

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Skills installation proceeds after failed project initialization
    • Modified initInteractiveFlow to return boolean indicating success; installSkillsFlow now only runs when initialization actually completed.

Create PR

Or push these changes by commenting:

@cursor push fdbe98112e
Preview (fdbe98112e)
diff --git a/ts/packages/cli/src/commands/init.cmd.ts b/ts/packages/cli/src/commands/init.cmd.ts
--- a/ts/packages/cli/src/commands/init.cmd.ts
+++ b/ts/packages/cli/src/commands/init.cmd.ts
@@ -285,9 +285,9 @@
 
       const composioDir = path.join(proc.cwd, constants.PROJECT_COMPOSIO_DIR);
 
-      yield* initInteractiveFlow({ composioDir, noBrowser, yes });
+      const initialized = yield* initInteractiveFlow({ composioDir, noBrowser, yes });
 
-      if (installSkills) {
+      if (initialized && installSkills) {
         yield* installSkillsFlow();
       }
     })
@@ -296,6 +296,7 @@
 /**
  * Interactive init flow — handles login, project selection, wizard, install.
  * Extracted to keep the main command handler under the line limit.
+ * Returns true if initialization succeeded, false if it was skipped due to missing credentials or projects.
  */
 const initInteractiveFlow = (params: { composioDir: string; noBrowser: boolean; yes: boolean }) =>
   Effect.gen(function* () {
@@ -318,7 +319,7 @@
     if (!globalApiKey || !orgIdValue) {
       yield* ui.log.warn('No global API key or org ID found. Please try `composio login` first.');
       yield* ui.outro('');
-      return;
+      return false;
     }
 
     const orgProjects = yield* listOrgProjects({
@@ -356,7 +357,7 @@
         'Create a project at https://platform.composio.dev, then run `composio init` again.'
       );
       yield* ui.outro('');
-      return;
+      return false;
     }
 
     // 3. Select a project
@@ -407,4 +408,5 @@
     );
     yield* ui.output(makeOutputJson(selected, composioDir));
     yield* ui.outro('');
+    return true;
   });

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.


if (installSkills) {
yield* installSkillsFlow();
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills installation proceeds after failed project initialization

Medium Severity

installSkillsFlow() runs unconditionally after initInteractiveFlow succeeds, but initInteractiveFlow has early-return paths (no credentials, no projects) that call ui.outro('') and return without error. This causes the skills selection prompt and logging to appear after the @clack/prompts closing marker, producing a broken UI. More importantly, it offers skill installation even when no project was actually initialized.

Additional Locations (2)
Fix in Cursor Fix in Web

@CryogenicPlanet CryogenicPlanet force-pushed the cli/update-docs-skills branch from 2865f5b to 46d6bc6 Compare March 18, 2026 02:58
@CryogenicPlanet CryogenicPlanet force-pushed the cli/init-install-skills branch from 48ca40e to f241d3e Compare March 18, 2026 02:58
Base automatically changed from cli/update-docs-skills to next March 19, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant