Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 04:30 UTC
fix(cli): output empty JSON array on toolkits search with no results
Align toolkits search with toolkits list: both now emit '[]' to stdout when no results are found, so piped consumers always get valid JSON.
jkomyno committed
Mar 9, 2026 at 16:03 UTC
13e48d6354dc87f41822fa82dbe2bc2bab805b42
2 files changed
+4
-2
ts/e2e-tests/cli/toolkits/search/e2e.test.ts
+2
-2
@@ -127,8 +127,8 @@ e2e(import.meta.url, {
127
expect(noResultsResult.stderr).toBe('');
128
});
129
130
- it('stdout is empty (no results)', () => {
131
- expect(sanitizeOutput(noResultsResult.stdout)).toBe('');
130
+ it('stdout is an empty JSON array (no results)', () => {
131
+ expect(sanitizeOutput(noResultsResult.stdout)).toBe('[]');
132
});
133
});
134
},
ts/packages/cli/src/commands/toolkits/commands/toolkits.search.cmd.ts
+2
@@ -44,6 +44,7 @@ export const toolkitsCmd$Search = Command.make('search', { query, limit }, ({ qu
44
45
if (result.items.length === 0) {
46
yield* ui.log.warn(`No toolkits found matching "${query}". Try broadening your search.`);
47
+ yield* ui.output('[]');
48
return;
49
}
50
@@ -66,6 +67,7 @@ export const toolkitsCmd$Search = Command.make('search', { query, limit }, ({ qu
67
Effect.gen(function* () {
68
const ui = yield* TerminalUI;
69
yield* ui.log.error(extractMessage(error) ?? 'An error occurred while searching toolkits.');
70
+ yield* ui.output('[]');
71
})
72
)
73
)