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): forward user ID when creating development triggers (#4982)
## Summary Refs #4964: fixes its main report, `dev triggers create` on 2FA projects. The issue stays open for its two related reports (connected accounts landing in the consumer project, and the toolkit CLI docs). A 2FA-enabled project requires `user_id` when validating a trigger's connected-account owner, but `composio dev triggers create` currently rejects the shared `--user-id` flag and sends no user ID. ```text shared --user-id -> resolved directory project test user -> global test user -> omit user_id when none is configured ``` ## Changes - Accept the existing shared `--user-id` before or after the subcommand and forward the selected user to trigger upsert. - Keep `--project-name` rejected until this command supports named-project routing. - Move create into the required cmd/handler directory layout, add its mirrored tests, and remove its command-test exemption. - Update the CLI README and changelog, including the existing process-environment override of directory configuration. The create-command move overlaps #4970, which is currently open. ## Type of change - [x] Bug fix ## Evidence / How Has This Been Tested? - **Before:** 4 failures and 1 pass in the five user-selection regression cases: explicit IDs are rejected and defaults do not reach the request. - **After:** 13 trigger tests pass, covering explicit IDs in both positions, directory/global defaults, absent defaults, creation output, JSON validation, and existing enable/disable behavior. - 30 selected shared-flag guard tests pass, including create's continued rejection of `--project-name`; other surface tests were filtered. - `pnpm typecheck`: 14/14 tasks passed. - `pnpm --filter @composio/cli run lint:effect`: no errors or warnings. - CLI build, changed-file Prettier/Oxlint, `validate:command-tests`, and `git diff --check`: passed. Windows validation limitations: - Focused tests use an untracked Vitest configuration with correct file URL conversion. The standard configuration/global setup currently generate a duplicated drive prefix on Windows. Tracked test configuration is unchanged. - Recorded full-suite comparison using the same path corrections: baseline 1,795 passed / 151 failed / 1 skipped; patched 1,798 passed / 152 failed / 1 skipped. Two patch-only timing failures passed on isolated rerun; one baseline-only analytics race passed in the patched run. The full suite is not green. - The root agent-guidance validator encounters an existing Windows symlink separator mismatch. - No real 2FA project or Trello account was used for hosted API validation. ## Merge Danger **Door:** Two-way; request parameter selection and command wiring. **Blast Radius:** Development trigger creation. User ownership continues to be checked by the API, and the existing project-context resolver supplies any directory default. ## Checklist - [x] Read the contribution policy, Code of Conduct, and complete diff. - [x] Added regression tests and updated README/changelog. - [x] Ran required checks and documented validation limitations. - [x] Confirmed that `@composio/cli` is excluded from Changesets. ## Additional context This addresses the trigger-creation user-ID conflict in #4964. The connected-account project-routing and toolkit-documentation reports in that issue are outside this patch. --------- Co-authored-by: shenmuegit <29520926+shenmuegit@users.noreply.github.com> Co-authored-by: jkomyno <alberto@composio.dev> Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com>