149
}),
150
];
151
152
-const DEVELOPER_COMMANDS: ReadonlyArray<TaggedValue<CompactCommand>> = [
153
- tagged({
154
- name: 'dev',
155
- description:
156
- 'Developer workflows and management: init, logs, projects, toolkits, accounts, and triggers.',
157
- }),
158
- tagged({
159
- name: 'generate',
160
- description: 'Generate type stubs for toolkits, tools, and triggers (TypeScript | Python).',
161
- }),
162
-];
152
+const GENERATE_COMMAND: TaggedValue<CompactCommand> = tagged({
153
+ name: 'generate',
154
+ description: 'Generate type stubs for toolkits, tools, and triggers (TypeScript | Python).',
155
+});
156
157
// ── Account commands ───────────────────────────────────────────────────
158
189
return commands.map(cmd => ` ${cmd.name.padEnd(maxLen + 2)}${cmd.description}`);
190
}
191
192
+function renderDevHelp(visibility: CommandVisibility): string {
193
+ const lines: string[] = [
194
+ '',
195
+ bold('USAGE'),
196
+ visibility.isDevModeEnabled
197
+ ? ' composio dev [--mode on|off] <command> [options]'
198
+ : ' composio dev [--mode on|off]',
199
+ '',
200
+ bold('DESCRIPTION'),
201
+ visibility.isDevModeEnabled
202
+ ? ' Developer workflows for local project setup, playground execution, logs, and developer-scoped management.'
203
+ : ' Developer mode is off. Only mode switching is available until you turn it back on.',
204
+ '',
205
+ bold('MODE'),
206
+ ' --mode <on|off> Turn developer mode on or off.',
207
+ '',
208
+ ];
209
+
210
+ if (!visibility.isDevModeEnabled) {
211
+ lines.push(bold('EXAMPLES'));
212
+ lines.push(' composio dev --mode on');
213
+ lines.push(' composio dev --mode off');
214
+ lines.push('');
215
+ lines.push(bold('NOTE'));
216
+ lines.push(
217
+ ' Developer mode is for engineers building with the CLI. It unlocks more advanced commands like creating or updating auth configs and connected accounts.'
218
+ );
219
+ lines.push('');
220
+ return lines.join('\n');
221
+ }
222
+
223
+ lines.push(bold('PROJECT'));
224
+ lines.push(' dev init Initialize this directory with a developer project');
225
+ lines.push('');
226
+
227
+ lines.push(bold('EXECUTION'));
228
+ lines.push(' dev playground-execute Execute a tool against a developer playground user');
229
+ lines.push(' dev listen Listen to developer-project trigger events');
230
+ lines.push(' dev logs tools Browse tool logs');
231
+ lines.push(' dev logs triggers Browse trigger logs');
232
+ lines.push('');
233
+
234
+ lines.push(bold('TOOLKITS'));
235
+ lines.push(' dev toolkits list Browse available toolkits');
236
+ lines.push(' dev toolkits info Inspect a toolkit');
237
+ lines.push(' dev toolkits search Search toolkits');
238
+ lines.push(' dev toolkits version Inspect toolkit versions');
239
+ lines.push('');
240
+
241
+ lines.push(bold('AUTH CONFIGS'));
242
+ lines.push(' dev auth-configs list List auth configs');
243
+ lines.push(' dev auth-configs info View one auth config');
244
+ lines.push(' dev auth-configs create Create an auth config');
245
+ lines.push('');
246
+
247
+ lines.push(bold('CONNECTED ACCOUNTS'));
248
+ lines.push(' dev connected-accounts link Link a connected account');
249
+ lines.push(' dev connected-accounts list List connected accounts');
250
+ lines.push(' dev connected-accounts info View one connected account');
251
+ lines.push(' dev connected-accounts whoami Resolve an account identity');
252
+ lines.push('');
253
+
254
+ lines.push(bold('TRIGGERS'));
255
+ lines.push(' dev triggers list List trigger types');
256
+ lines.push(' dev triggers info View one trigger type');
257
+ lines.push(' dev triggers status Inspect trigger instances');
258
+ lines.push(' dev triggers create Create a trigger instance');
259
+ lines.push(' dev triggers enable Enable a trigger instance');
260
+ lines.push(' dev triggers disable Disable a trigger instance [guarded]');
261
+ lines.push('');
262
+
263
+ lines.push(bold('PROJECTS'));
264
+ lines.push(' dev projects list List projects');
265
+ lines.push(' dev projects switch Switch default project');
266
+ lines.push('');
267
+
268
+ lines.push(bold('GUARDED'));
269
+ lines.push(' dev triggers disable Disable a trigger instance');
270
+ lines.push(
271
+ ' This requires `developer.destructive_actions: true` in `~/.composio/config.json` and `--dangerously-allow` on the command line.'
272
+ );
273
+ lines.push('');
274
+ lines.push(bold('EXAMPLES'));
275
+ lines.push(' composio dev --mode off');
276
+ lines.push(' composio dev toolkits list');
277
+ lines.push(
278
+ ' composio dev playground-execute GMAIL_SEND_EMAIL --dangerously-allow -d \'{ recipient_email: "a@b.com" }\''
279
+ );
280
+ lines.push('');
281
+ return lines.join('\n');
282
+}
283
+
284
// ── Subcommand help definitions ────────────────────────────────────────
285
286
type SubcommandHelp = {
913
{ name: '--custom-credentials <text>', description: 'Custom credentials JSON' },
914
],
915
},
831
- 'dev auth-configs delete': {
832
- usage: 'composio dev auth-configs delete [-y, --yes] [<id>]',
833
- description: 'Delete an auth config.',
834
- args: [{ name: '<id>', description: 'Auth config ID' }],
835
- flags: [{ name: '-y, --yes', description: 'Skip confirmation prompt' }],
836
- },
916
'dev connected-accounts list': {
917
usage:
918
'composio dev connected-accounts list [--toolkits text] [--user-id text] [--status text] [--limit integer]',
934
description: 'Show the external account profile for a connected account.',
935
args: [{ name: '<id>', description: 'Connected account ID' }],
936
},
858
- 'dev connected-accounts delete': {
859
- usage: 'composio dev connected-accounts delete [-y, --yes] [<id>]',
860
- description: 'Delete a connected account.',
861
- args: [{ name: '<id>', description: 'Connected account ID' }],
862
- flags: [{ name: '-y, --yes', description: 'Skip confirmation prompt' }],
863
- },
937
'dev triggers list': {
938
usage: 'composio dev triggers list <toolkit> [--limit integer]',
939
description: 'List available trigger types for a toolkit.',
981
description: 'Disable a trigger instance.',
982
args: [{ name: '<id>', description: 'Trigger instance ID' }],
983
},
911
- 'dev triggers delete': {
912
- usage: 'composio dev triggers delete [-y, --yes] [<id>]',
913
- description: 'Delete a trigger instance.',
914
- args: [{ name: '<id>', description: 'Trigger instance ID' }],
915
- flags: [{ name: '-y, --yes', description: 'Skip confirmation prompt' }],
916
- },
917
- 'dev orgs list': {
918
- usage: 'composio dev orgs list [--limit integer]',
919
- description: 'List organizations and show current global selection.',
920
- options: [{ name: '--limit <integer>', description: 'Number of results' }],
921
- },
922
- 'dev orgs switch': {
923
- usage: 'composio dev orgs switch [--org-id text] [--limit integer]',
924
- description: 'Switch default organization context.',
925
- options: [
926
- { name: '--org-id <text>', description: 'Organization ID to switch to' },
927
- { name: '--limit <integer>', description: 'Number of orgs to show in picker' },
928
- ],
929
- },
984
'dev projects list': {
985
usage: 'composio dev projects list [--org-id text] [--limit integer]',
986
description: 'List developer projects for the current organization.',
1048
cmd: string,
1049
visibility: CommandVisibility
1050
): Option.Option<SubcommandHelp> => {
1051
+ if (cmd === 'dev') {
1052
+ return Option.some({
1053
+ usage: 'composio dev [--mode on|off]',
1054
+ description: 'Developer mode and developer-scoped workflows.',
1055
+ });
1056
+ }
1057
+
1058
+ if (cmd.startsWith('dev ') && !visibility.isDevModeEnabled) {
1059
+ return Option.none();
1060
+ }
1061
+
1062
const entry = SUBCOMMAND_HELP[cmd];
1063
if (!entry) {
1064
return Option.none();
1166
cmd: string,
1167
visibility: CommandVisibility
1168
): Effect.Effect<void> {
1169
+ if (cmd === 'dev') return Console.log(renderDevHelp(visibility));
1170
const help = getVisibleSubcommandHelp(cmd, visibility);
1171
if (Option.isNone(help)) return Console.log(`Unknown command: ${cmd}`);
1172
return Console.log(renderSubcommandHelp(help.value));
1193
* Get rendered help text for a command, or undefined if not found.
1194
*/
1195
export function getCommandHelpText(cmd: string, visibility: CommandVisibility): string | undefined {
1196
+ if (cmd === 'dev') return renderDevHelp(visibility);
1197
return Option.match(getVisibleSubcommandHelp(cmd, visibility), {
1198
onNone: () => undefined,
1199
onSome: help => renderSubcommandHelp(help),
1209
*/
1210
export function printRootHelp(visibility: CommandVisibility): Effect.Effect<void> {
1211
const name = 'composio';
1212
+ const developerCommands: ReadonlyArray<CompactCommand> = [
1213
+ {
1214
+ name: 'dev',
1215
+ description: visibility.isDevModeEnabled
1216
+ ? 'Developer workflows and management: init, logs, projects, toolkits, accounts, and triggers.'
1217
+ : 'Developer mode toggle. Use `composio dev --mode on` to enable developer workflows.',
1218
+ },
1219
+ GENERATE_COMMAND.value,
1220
+ ];
1221
1222
const lines: string[] = [
1223
'',
1226
`Try ${bold('execute')} sooner than you'd think — it validates inputs, checks connections, and tells`,
1227
'you what to fix.',
1228
'',
1153
- `Use ${bold('dev')} when you are building an agent with Composio's SDK and want scaffolding,`,
1154
- 'playground execution, logs, and developer-scoped management commands.',
1229
+ visibility.isDevModeEnabled
1230
+ ? `Use ${bold('dev')} when you are building an agent with Composio's SDK and want scaffolding,`
1231
+ : `Use ${bold('dev')} to control access to developer-only workflows.`,
1232
+ visibility.isDevModeEnabled
1233
+ ? 'playground execution, logs, and developer-scoped management commands.'
1234
+ : 'Developer mode is currently off.',
1235
'',
1236
bold('USAGE'),
1237
` ${name} <command> [options]`,
1279
` '`,
1280
'',
1281
bold('DEVELOPER COMMANDS'),
1202
- ...renderCompactCommands(visibleValues(DEVELOPER_COMMANDS, visibility)),
1282
+ ...renderCompactCommands(developerCommands),
1283
'',
1284
bold('ACCOUNT'),
1285
...renderCompactCommands(visibleValues(ACCOUNT_COMMANDS, visibility)),