@devries-cameron20 / composio-1 / commits / 1cc2ec6b5
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.

fix: decouple skill build scripts from @composio/core (#3133)

## Summary - Skill build/validate scripts were failing in CI because they transitively imported `@composio/core` via `src/constants.ts`, which isn't built when the binary release workflow runs. - Extracts `CLI_EXPERIMENTAL_FEATURES` (and `CLI_RELEASE_CHANNELS`/`CliReleaseChannel`) into a standalone `src/experimental-features.ts` with zero external dependencies. - Adds `MULTI_ACCOUNT` experimental feature flag that gates `--account` on execute/listen and `--alias` on link. When disabled (default on stable), these flags are silently ignored and hidden from help. Beta builds enable them by default. - Skill builder now includes `--account`/`--alias` documentation only in beta channel builds. ## Test plan - [x] `pnpm run validate:skills` passes - [x] `pnpm turbo typecheck --filter=@composio/cli` passes - [x] Binary build and runtime verified - [x] Stable help hides `--account`/`--alias` flags - [x] Beta skill output includes multi-account flags, stable does not - [ ] CI `Build CLI Binaries` workflow should now pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Rahul Tarak committed Apr 7, 2026 at 03:19 UTC 1cc2ec6b501106e2753fb295e483db849d219bdf
8 files changed +93 -18
ts/packages/cli/skills-src/composio-cli/index.ts
+20 -1
@@ -1,6 +1,6 @@
1 import * as fs from 'node:fs';
2 import * as path from 'node:path';
3 -import { CLI_EXPERIMENTAL_FEATURES } from '../../src/constants';
3 +import { CLI_EXPERIMENTAL_FEATURES } from '../../src/experimental-features';
4 import { composioDevReference } from './references/composio-dev';
5 import { powerUserExamplesReference } from './references/power-user-examples';
6 import { troubleshootingReference } from './references/troubleshooting';
@@ -72,6 +72,12 @@ const commands: SkillCommand[] = [
72 name: '`--parallel`',
73 description: 'Execute multiple independent tool calls in the same invocation.',
74 },
75 + {
76 + name: '`--account`',
77 + description:
78 + 'Select which connected account to use by alias, word_id, or account id when multiple accounts exist for the same toolkit.',
79 + features: [CLI_EXPERIMENTAL_FEATURES.MULTI_ACCOUNT],
80 + },
81 ],
82 examples: [
83 {
@@ -125,6 +131,14 @@ const commands: SkillCommand[] = [
131 code: 'composio link gmail\ncomposio link googlecalendar --no-browser',
132 },
133 ],
134 + flags: [
135 + {
136 + name: '`--alias`',
137 + description:
138 + 'Assign an alias to the connected account. Required when creating an additional account for the same toolkit.',
139 + features: [CLI_EXPERIMENTAL_FEATURES.MULTI_ACCOUNT],
140 + },
141 + ],
142 notes: ['Retry the original `execute` command after linking succeeds.'],
143 },
144 {
@@ -152,6 +166,11 @@ const commands: SkillCommand[] = [
166 name: '`--timeout` and `--max-events`',
167 description: 'Stop long-running listeners cleanly.',
168 },
169 + {
170 + name: '`--account`',
171 + description: 'Select which connected account to use by alias, word_id, or account id.',
172 + features: [CLI_EXPERIMENTAL_FEATURES.MULTI_ACCOUNT],
173 + },
174 ],
175 notes: [
176 '`composio artifacts cwd` shows the current artifact root when saved payloads need inspection.',
ts/packages/cli/skills-src/composio-cli/reference-schema.ts
+2 -1
@@ -1,4 +1,4 @@
1 -import { CLI_EXPERIMENTAL_FEATURES, type CliReleaseChannel } from '../../src/constants';
1 +import { CLI_EXPERIMENTAL_FEATURES, type CliReleaseChannel } from '../../src/experimental-features';
2
3 export type SkillReleaseChannel = CliReleaseChannel;
4
@@ -51,6 +51,7 @@ export const resolveSkillBuildContext = (channel: SkillReleaseChannel): SkillBui
51 channel,
52 experimentalFeatures: {
53 [CLI_EXPERIMENTAL_FEATURES.LISTEN]: channel === 'beta',
54 + [CLI_EXPERIMENTAL_FEATURES.MULTI_ACCOUNT]: channel === 'beta',
55 },
56 });
57
ts/packages/cli/src/commands/connected-accounts/commands/connected-accounts.link.cmd.ts
+12 -3
@@ -23,6 +23,8 @@ import {
23 groupCachedConnectedAccountsByToolkit,
24 resolveDefaultConnectedAccountsByToolkit,
25 } from 'src/services/connected-account-selection';
26 +import { ComposioCliUserConfig } from 'src/services/cli-user-config';
27 +import { CLI_EXPERIMENTAL_FEATURES } from 'src/constants';
28
29 const toolkit = Args.text({ name: 'toolkit' }).pipe(
30 Args.withDescription('Toolkit slug to link (e.g. "github", "gmail")'),
@@ -619,6 +621,13 @@ const runConnectedAccountsLink = (params: {
621 Effect.gen(function* () {
622 if (!(yield* requireAuth)) return;
623
624 + const cliConfig = yield* ComposioCliUserConfig;
625 + const aliasOption = cliConfig.isExperimentalFeatureEnabled(
626 + CLI_EXPERIMENTAL_FEATURES.MULTI_ACCOUNT
627 + )
628 + ? params.alias
629 + : Option.none<string>();
630 +
631 const ui = yield* TerminalUI;
632 const clientSingleton = yield* ComposioClientSingleton;
633 const projectContext = yield* ProjectContext;
@@ -675,7 +684,7 @@ const runConnectedAccountsLink = (params: {
684 requestedUserId: params.userId,
685 projectName: params.projectName,
686 noWait: params.noWait,
678 - alias: params.alias,
687 + alias: aliasOption,
688 ui,
689 clientSingleton,
690 projectContext,
@@ -758,7 +767,7 @@ const runConnectedAccountsLink = (params: {
767 const { connectedAccountId: connAccountId, redirectUrl } = validatedLink.value;
768 const canContinue = yield* ensureAliasForAdditionalAccount({
769 ui,
761 - alias: params.alias,
770 + alias: aliasOption,
771 connectedAccountId: connAccountId,
772 existingAccounts,
773 scopeDescription: `user "${resolvedUserId.value}" in toolkit "${toolkitSlug}"`,
@@ -769,7 +778,7 @@ const runConnectedAccountsLink = (params: {
778 ui,
779 client,
780 connectedAccountId: connAccountId,
772 - alias: params.alias,
781 + alias: aliasOption,
782 });
783
784 if (params.noWait) {
ts/packages/cli/src/commands/listen.cmd.ts
+9 -1
@@ -22,6 +22,8 @@ import {
22 } from 'src/services/connected-account-selection';
23 import { parseJsonIsh } from 'src/utils/parse-json-ish';
24 import { toolkitFromToolSlug } from 'src/utils/toolkit-from-tool-slug';
25 +import { ComposioCliUserConfig } from 'src/services/cli-user-config';
26 +import { CLI_EXPERIMENTAL_FEATURES } from 'src/constants';
27 import { matchesTriggerListenFilters } from './triggers/filter';
28 import { parseTriggerListenEvent } from './triggers/parse';
29
@@ -396,6 +398,12 @@ export const listenCmd = Command.make(
398 orgId: resolvedProject.orgId,
399 projectId: resolvedProject.projectId,
400 });
401 + const cliConfig = yield* ComposioCliUserConfig;
402 + const accountSelector = cliConfig.isExperimentalFeatureEnabled(
403 + CLI_EXPERIMENTAL_FEATURES.MULTI_ACCOUNT
404 + )
405 + ? account
406 + : Option.none<string>();
407 const {
408 listeningToProjectEvent,
409 createParams,
@@ -410,7 +418,7 @@ export const listenCmd = Command.make(
418 timeout,
419 stream,
420 maxEvents,
413 - account,
421 + account: accountSelector,
422 client,
423 resolvedProject,
424 });
ts/packages/cli/src/commands/tools/commands/tools.execute.cmd.ts
+9 -1
@@ -60,6 +60,8 @@ import {
60 normalizeCliError,
61 } from 'src/services/composio-error-overrides';
62 import * as constants from 'src/constants';
63 +import { ComposioCliUserConfig } from 'src/services/cli-user-config';
64 +import { CLI_EXPERIMENTAL_FEATURES } from 'src/constants';
65
66 const slug = Args.text({ name: 'slug' }).pipe(
67 Args.withDescription('Tool slug (e.g. "GITHUB_CREATE_ISSUE")')
@@ -1009,12 +1011,18 @@ const resolveExecuteContext = (params: RunToolsExecuteParams) =>
1011 orgId: resolvedProject.orgId,
1012 projectId: resolvedProject.projectId,
1013 });
1014 + const cliConfig = yield* ComposioCliUserConfig;
1015 + const accountSelector = cliConfig.isExperimentalFeatureEnabled(
1016 + CLI_EXPERIMENTAL_FEATURES.MULTI_ACCOUNT
1017 + )
1018 + ? params.account
1019 + : Option.none<string>();
1020 const toolkitSlug = toolkitFromToolSlug(params.slug);
1021 const selectedConnectedAccountId = yield* resolveExplicitConnectedAccount({
1022 client,
1023 toolkitSlug,
1024 userId: resolvedUserId.value,
1017 - selector: params.account,
1025 + selector: accountSelector,
1026 });
1027 const args = Option.isSome(params.file)
1028 ? yield* getOrFetchToolInputDefinition(params.slug, {
ts/packages/cli/src/constants.ts
+5 -7
@@ -86,10 +86,8 @@ export const GITHUB_REPO = {
86 API_BASE_URL: 'https://api.github.com',
87 } as const;
88
89 -export const CLI_EXPERIMENTAL_FEATURES = {
90 - LISTEN: 'listen',
91 -} as const;
92 -
93 -export const CLI_RELEASE_CHANNELS = ['stable', 'beta'] as const;
94 -
95 -export type CliReleaseChannel = (typeof CLI_RELEASE_CHANNELS)[number];
89 +export {
90 + CLI_EXPERIMENTAL_FEATURES,
91 + CLI_RELEASE_CHANNELS,
92 + type CliReleaseChannel,
93 +} from './experimental-features';
ts/packages/cli/src/experimental-features.ts new
+15
@@ -0,0 +1,15 @@
1 +/**
2 + * Map of experimental feature flags used to gate CLI commands and skill output.
3 + *
4 + * Extracted into its own module so that the skill build/validate scripts
5 + * (`skills-src/`) can import it without pulling in `@composio/core` (which
6 + * requires a prior build step).
7 + */
8 +export const CLI_EXPERIMENTAL_FEATURES = {
9 + LISTEN: 'listen',
10 + MULTI_ACCOUNT: 'multi_account',
11 +} as const;
12 +
13 +export const CLI_RELEASE_CHANNELS = ['stable', 'beta'] as const;
14 +
15 +export type CliReleaseChannel = (typeof CLI_RELEASE_CHANNELS)[number];
ts/packages/cli/test/__utils__/services/test-layer.ts
+21 -4
@@ -11,6 +11,7 @@ import {
11 Layer,
12 Logger,
13 LogLevel,
14 + Option,
15 Schedule,
16 String,
17 } from 'effect';
@@ -39,7 +40,8 @@ import type { TriggerInstanceItem } from 'src/models/triggers';
40 import type { AuthConfigCreateResponse, LinkCreateResponse } from 'src/services/composio-clients';
41 import type { ToolkitVersionSpec } from 'src/effects/toolkit-version-overrides';
42 import { ComposioUserContextLive } from 'src/services/user-context';
42 -import { ComposioCliUserConfigLive } from 'src/services/cli-user-config';
43 +import { ComposioCliUserConfig } from 'src/services/cli-user-config';
44 +import { CliUserConfig } from 'src/models/cli-user-config';
45 import { UpgradeBinary } from 'src/services/upgrade-binary';
46 import { NodeOs } from 'src/services/node-os';
47 import { TriggersRealtime } from 'src/services/triggers-realtime';
@@ -800,9 +802,24 @@ export const TestLayer = (input?: TestLiveInput) =>
802 Layer.merge(BunFileSystem.layer, NodeOsTest)
803 );
804
803 - const ComposioCliUserConfigTest = Layer.provideMerge(
804 - ComposioCliUserConfigLive,
805 - Layer.mergeAll(BunFileSystem.layer, NodeOsTest)
805 + const ComposioCliUserConfigTest = Layer.succeed(
806 + ComposioCliUserConfig,
807 + ComposioCliUserConfig.of({
808 + data: {
809 + channel: 'beta',
810 + experimentalFeatures: {},
811 + artifactDirectory: undefined,
812 + experimentalSubagentTarget: 'auto',
813 + },
814 + raw: CliUserConfig.make({
815 + experimentalFeatures: {},
816 + artifactDirectory: Option.none(),
817 + experimentalSubagent: Option.none(),
818 + }),
819 + channel: 'beta',
820 + isExperimentalFeatureEnabled: () => true,
821 + update: () => Effect.void,
822 + })
823 );
824
825 const UpgradeBinaryTest = Layer.provide(