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

refactor(cli): polish triggers info field layout

Adjust trigger field metadata labels to plain aligned text and add section dividers before config/payload blocks for cleaner readability. Co-authored-by: Cursor <cursoragent@cursor.com>

haxzie committed Feb 23, 2026 at 18:59 UTC ac25bdaaceb529cac13cab4e3eebe40f379243de
2 files changed +12 -5
ts/packages/cli/src/commands/triggers/format.ts
+10 -4
@@ -119,18 +119,22 @@ function formatSchemaProperties(schema: Record<string, unknown>): string {
119
120 const typeWidth = Math.max(...entries.map(e => e.type.length));
121 const labelWidth = Math.max(...entries.map(e => e.label.length));
122 + const metadataLabels = ['description:', 'type:', 'required:', 'default:'] as const;
123 + const metadataLabelWidth = Math.max(...metadataLabels.map(label => label.length));
124
125 return entries
126 .map(e => {
127 const lines: string[] = [];
128 lines.push(` ${bold(e.name)}`);
129 lines.push(
128 - ` ${bold('description:')} ${e.description ? gray(truncate(e.description, 70)) : '-'}`
130 + ` ${'description:'.padEnd(metadataLabelWidth)} ${e.description ? gray(truncate(e.description, 70)) : '-'}`
131 );
130 - lines.push(` ${bold('type:')} ${e.type.padEnd(typeWidth)}`);
131 - lines.push(` ${bold('required:')} ${e.label.padEnd(labelWidth)}`);
132 + lines.push(` ${'type:'.padEnd(metadataLabelWidth)} ${e.type.padEnd(typeWidth)}`);
133 + lines.push(` ${'required:'.padEnd(metadataLabelWidth)} ${e.label.padEnd(labelWidth)}`);
134 if (e.hasDefault) {
133 - lines.push(` ${bold('default:')} ${gray(truncate(JSON.stringify(e.defaultValue), 40))}`);
135 + lines.push(
136 + ` ${'default:'.padEnd(metadataLabelWidth)} ${gray(truncate(JSON.stringify(e.defaultValue), 40))}`
137 + );
138 }
139 return lines.join('\n');
140 })
@@ -147,10 +151,12 @@ export const formatTriggerTypeInfo = (triggerType: TriggerType): string => {
151 lines.push(`${bold('Instructions:')} ${triggerType.instructions}`);
152
153 lines.push('');
154 + lines.push(gray('------------------------------'));
155 lines.push(bold('Config Fields:'));
156 lines.push(formatSchemaProperties(triggerType.config));
157
158 lines.push('');
159 + lines.push(gray('------------------------------'));
160 lines.push(bold('Payload Fields:'));
161 lines.push(formatSchemaProperties(triggerType.payload));
162
ts/packages/cli/test/src/commands/triggers/triggers.info.cmd.test.ts
+2 -1
@@ -69,7 +69,8 @@ describe('CLI: composio triggers info', () => {
69 expect(output).toContain('required');
70 expect(output).toContain('Payload Fields');
71 expect(output).toContain('subject');
72 - expect(output).toContain('default: false');
72 + expect(output).toContain('default:');
73 + expect(output).toContain('false');
74 expect(output).toContain('composio triggers list --toolkits "gmail"');
75 })
76 );