Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

test(ts/e2e): add e2e tests for composio toolkits list, info, and search

jkomyno5704e27ca760
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ecf8122da..5d8660360 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -173,6 +173,24 @@ importers:
specifier: 'catalog:'
version: 5.9.3
+ ts/e2e-tests/cli/toolkits/info:
+ devDependencies:
+ '@e2e-tests/utils':
+ specifier: workspace:*
+ version: link:../../../_utils
+
+ ts/e2e-tests/cli/toolkits/list:
+ devDependencies:
+ '@e2e-tests/utils':
+ specifier: workspace:*
+ version: link:../../../_utils
+
+ ts/e2e-tests/cli/toolkits/search:
+ devDependencies:
+ '@e2e-tests/utils':
+ specifier: workspace:*
+ version: link:../../../_utils
+
ts/e2e-tests/cli/version:
devDependencies:
'@e2e-tests/utils':
@@ -662,16 +680,16 @@ importers:
version: link:../../packages/providers/llamaindex
'@llamaindex/openai':
specifier: ^0.4.20
- version: 0.4.22(@llamaindex/[email protected])(@llamaindex/[email protected])([email protected])([email protected])
+ version: 0.4.22(@llamaindex/[email protected])(@llamaindex/[email protected])([email protected])([email protected])
'@llamaindex/workflow':
specifier: ^1.1.24
- version: 1.1.24(@llamaindex/[email protected])(@llamaindex/[email protected])(@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected]))([email protected])([email protected])
+ version: 1.1.24(@llamaindex/[email protected])(@llamaindex/[email protected])(@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected]))([email protected])([email protected])
dotenv:
specifier: ^16.4.1
version: 16.6.1
llamaindex:
specifier: ^0.12.0
devDependencies:
'@types/bun':
specifier: ^1.2.9
@@ -1268,7 +1286,7 @@ importers:
dependencies:
llamaindex:
specifier: ^0.12.0
devDependencies:
'@composio/core':
specifier: workspace:*
@@ -7530,43 +7548,26 @@ snapshots:
tree-sitter: 0.22.4
web-tree-sitter: 0.24.7
dependencies:
'@llamaindex/core': 0.6.22
'@llamaindex/env': 0.1.30
transitivePeerDependencies:
- ws
- zod
optionalDependencies:
- '@modelcontextprotocol/sdk': 1.26.0(@cfworker/[email protected])([email protected])
+ '@modelcontextprotocol/sdk': 1.26.0(@cfworker/[email protected])([email protected])
hono: 4.11.9
- zod: 3.25.76
-
- optionalDependencies:
zod: 4.3.6
- dependencies:
- '@llamaindex/core': 0.6.22
- '@llamaindex/env': 0.1.30
- '@llamaindex/workflow-core': 1.3.3(@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected]))([email protected])([email protected])
- transitivePeerDependencies:
- - '@modelcontextprotocol/sdk'
- - hono
- - next
- - p-retry
- - rxjs
- - zod
-
dependencies:
'@llamaindex/core': 0.6.22
'@llamaindex/env': 0.1.30
- '@llamaindex/workflow-core': 1.3.3([email protected])
+ '@llamaindex/workflow-core': 1.3.3(@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected]))([email protected])([email protected])
transitivePeerDependencies:
- '@modelcontextprotocol/sdk'
- hono
@@ -9947,34 +9948,12 @@ snapshots:
rfdc: 1.4.1
wrap-ansi: 9.0.2
- dependencies:
- '@llamaindex/core': 0.6.22
- '@llamaindex/env': 0.1.30
- '@llamaindex/node-parser': 2.0.22(@llamaindex/[email protected])(@llamaindex/[email protected])([email protected])([email protected])
- '@llamaindex/workflow': 1.1.24(@llamaindex/[email protected])(@llamaindex/[email protected])(@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected]))([email protected])([email protected])
- '@types/lodash': 4.17.23
- '@types/node': 24.10.13
- lodash: 4.17.23
- magic-bytes.js: 1.13.0
- transitivePeerDependencies:
- - '@huggingface/transformers'
- - '@modelcontextprotocol/sdk'
- - gpt-tokenizer
- - hono
- - next
- - p-retry
- - rxjs
- - tree-sitter
- - web-tree-sitter
- - zod
-
dependencies:
'@llamaindex/core': 0.6.22
'@llamaindex/env': 0.1.30
'@llamaindex/node-parser': 2.0.22(@llamaindex/[email protected])(@llamaindex/[email protected])([email protected])([email protected])
- '@llamaindex/workflow': 1.1.24(@llamaindex/[email protected])(@llamaindex/[email protected])([email protected])
+ '@llamaindex/workflow': 1.1.24(@llamaindex/[email protected])(@llamaindex/[email protected])(@modelcontextprotocol/[email protected](@cfworker/[email protected])([email protected]))([email protected])([email protected])
'@types/lodash': 4.17.23
'@types/node': 24.10.13
lodash: 4.17.23
@@ -10254,11 +10233,6 @@ snapshots:
is-inside-container: 1.0.0
wsl-utils: 0.1.0
- optionalDependencies:
- ws: 8.19.0
- zod: 3.25.76
-
optionalDependencies:
ws: 8.19.0
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 7c507964e..fba1ca9db 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -1,6 +1,7 @@
packages:
- ts/e2e-tests/_utils
- ts/e2e-tests/cli/*
+ - ts/e2e-tests/cli/**/*
- ts/e2e-tests/runtimes/node/*
- ts/e2e-tests/runtimes/deno/*
- ts/e2e-tests/runtimes/cloudflare/*
diff --git a/ts/e2e-tests/README.md b/ts/e2e-tests/README.md
index 359c901de..618a0a1fc 100644
--- a/ts/e2e-tests/README.md
+++ b/ts/e2e-tests/README.md
@@ -42,7 +42,11 @@ ts/e2e-tests/
└── cf-workers-tool-router-ai/ # Cloudflare Workers AI SDK tool router tests
└── cli/ # CLI runtime tests (scratch)
├── version/ # composio version command tests
- └── whoami/ # composio whoami command tests
+ ├── whoami/ # composio whoami command tests
+ └── toolkits/ # composio toolkits command tests
+ ├── list/ # composio toolkits list tests
+ ├── info/ # composio toolkits info tests
+ └── search/ # composio toolkits search tests
```
## Running Tests
diff --git a/ts/e2e-tests/cli/toolkits/info/README.md b/ts/e2e-tests/cli/toolkits/info/README.md
new file mode 100644
index 000000000..33ea796cb
--- /dev/null
+++ b/ts/e2e-tests/cli/toolkits/info/README.md
@@ -0,0 +1,22 @@
+# CLI `composio toolkits info` Test
+
+Verifies that `composio toolkits info <slug>` returns detailed toolkit JSON in piped mode, handles invalid slugs gracefully, and supports stdout redirection.
+
+## What It Tests
+
+| Test | Description |
+| --- | --- |
+| Valid slug | `info gmail` returns JSON object with name, slug, meta, auth_config_details |
+| Stdout redirection | `info gmail > out.json` captures the JSON in the file |
+| Invalid slug | `info nonexistent_toolkit_xyz12345` exits 0, empty stdout |
+| Missing slug | `info` (no arg) exits 0, empty stdout |
+
+## Requirements
+
+- `COMPOSIO_API_KEY` (**required**) — Composio API key passed to the container
+
+## Running
+
+```bash
+pnpm test:e2e:cli
+```
diff --git a/ts/e2e-tests/cli/toolkits/info/e2e.test.ts b/ts/e2e-tests/cli/toolkits/info/e2e.test.ts
new file mode 100644
index 000000000..2be892585
--- /dev/null
+++ b/ts/e2e-tests/cli/toolkits/info/e2e.test.ts
@@ -0,0 +1,146 @@
+/**
+ * CLI `composio toolkits info` e2e test
+ *
+ * Verifies that the info subcommand returns detailed toolkit JSON in piped mode,
+ * handles invalid slugs gracefully, and supports stdout redirection.
+ */
+
+import {
+ e2e,
+ sanitizeOutput,
+ type E2ETestResult,
+ type E2ETestResultWithFiles,
+} from '@e2e-tests/utils';
+import { TIMEOUTS } from '@e2e-tests/utils/const';
+import { describe, it, expect, beforeAll } from 'bun:test';
+
+declare module 'bun' {
+ interface Env {
+ COMPOSIO_API_KEY: string;
+ }
+}
+
+e2e(import.meta.url, {
+ versions: {
+ cli: ['current'],
+ },
+ env: {
+ COMPOSIO_API_KEY: Bun.env.COMPOSIO_API_KEY,
+ },
+ defineTests: ({ runCmd }) => {
+ let validResult: E2ETestResult;
+ let redirectResult: E2ETestResultWithFiles<'out.json'>;
+ let invalidResult: E2ETestResult;
+ let missingSlugResult: E2ETestResult;
+
+ beforeAll(async () => {
+ validResult = await runCmd('composio toolkits info gmail');
+ redirectResult = await runCmd({
+ command: 'composio toolkits info gmail > out.json',
+ files: ['out.json'],
+ });
+ invalidResult = await runCmd('composio toolkits info nonexistent_toolkit_xyz12345');
+ missingSlugResult = await runCmd('composio toolkits info');
+ }, TIMEOUTS.FIXTURE);
+
+ describe('composio toolkits info gmail (valid slug)', () => {
+ it('exits successfully', () => {
+ expect(validResult.exitCode).toBe(0);
+ });
+
+ it('stderr is empty', () => {
+ expect(validResult.stderr).toBe('');
+ });
+
+ it('stdout is a valid JSON object', () => {
+ const obj = JSON.parse(sanitizeOutput(validResult.stdout));
+ expect(typeof obj).toBe('object');
+ expect(Array.isArray(obj)).toBe(false);
+ });
+
+ it('has the correct name and slug', () => {
+ const obj = JSON.parse(sanitizeOutput(validResult.stdout));
+ expect(obj.name).toBe('Gmail');
+ expect(obj.slug).toBe('gmail');
+ });
+
+ it('has meta with description, tools_count, and triggers_count', () => {
+ const obj = JSON.parse(sanitizeOutput(validResult.stdout));
+ expect(obj.meta).toHaveProperty('description');
+ expect(typeof obj.meta.tools_count).toBe('number');
+ expect(typeof obj.meta.triggers_count).toBe('number');
+ });
+
+ it('has auth_config_details array', () => {
+ const obj = JSON.parse(sanitizeOutput(validResult.stdout));
+ expect(Array.isArray(obj.auth_config_details)).toBe(true);
+ expect(obj.auth_config_details.length).toBeGreaterThan(0);
+ });
+
+ it('each auth_config_detail has mode, name, and fields', () => {
+ const obj = JSON.parse(sanitizeOutput(validResult.stdout));
+ for (const detail of obj.auth_config_details) {
+ expect(detail).toHaveProperty('mode');
+ expect(detail).toHaveProperty('name');
+ expect(detail).toHaveProperty('fields');
+ expect(detail.fields).toHaveProperty('auth_config_creation');
+ expect(detail.fields).toHaveProperty('connected_account_initiation');
+ }
+ });
+
+ it('has composio_managed_auth_schemes, no_auth, and is_local_toolkit', () => {
+ const obj = JSON.parse(sanitizeOutput(validResult.stdout));
+ expect(Array.isArray(obj.composio_managed_auth_schemes)).toBe(true);
+ expect(typeof obj.no_auth).toBe('boolean');
+ expect(typeof obj.is_local_toolkit).toBe('boolean');
+ });
+ });
+
+ describe('composio toolkits info gmail > out.json (stdout redirection)', () => {
+ it('exits successfully', () => {
+ expect(redirectResult.exitCode).toBe(0);
+ });
+
+ it('stdout is empty', () => {
+ expect(redirectResult.stdout).toBe('');
+ });
+
+ it('stderr is empty', () => {
+ expect(redirectResult.stderr).toBe('');
+ });
+
+ it('out.json contains valid JSON with slug "gmail"', () => {
+ const obj = JSON.parse(sanitizeOutput(redirectResult.files['out.json']));
+ expect(obj.slug).toBe('gmail');
+ });
+ });
+
+ describe('composio toolkits info nonexistent_toolkit_xyz12345 (invalid slug)', () => {
+ it('exits successfully (graceful error handling)', () => {
+ expect(invalidResult.exitCode).toBe(0);
+ });
+
+ it('stdout is empty (no data on error)', () => {
+ expect(sanitizeOutput(invalidResult.stdout)).toBe('');
+ });
+
+ it('stderr is empty (piped mode suppresses decoration)', () => {
+ expect(invalidResult.stderr).toBe('');
+ });
+ });
+
+ describe('composio toolkits info (missing slug)', () => {
+ it('exits successfully (optional arg, handler guards)', () => {
+ expect(missingSlugResult.exitCode).toBe(0);
+ });
+
+ it('stdout is empty', () => {
+ expect(sanitizeOutput(missingSlugResult.stdout)).toBe('');
+ });
+
+ it('stderr is empty', () => {
+ expect(missingSlugResult.stderr).toBe('');
+ });
+ });
+ },
+});
diff --git a/ts/e2e-tests/cli/toolkits/info/package.json b/ts/e2e-tests/cli/toolkits/info/package.json
new file mode 100644
index 000000000..bf36a463c
--- /dev/null
+++ b/ts/e2e-tests/cli/toolkits/info/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "@e2e-tests/cli-toolkits-info",
+ "version": "0.0.0",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "typecheck": "tsc --noEmit",
+ "test:e2e": "bun test e2e.test.ts",
+ "test:e2e:cli": "bun test e2e.test.ts"
+ },
+ "devDependencies": {
+ "@e2e-tests/utils": "workspace:*"
+ }
+}
diff --git a/ts/e2e-tests/cli/toolkits/list/README.md b/ts/e2e-tests/cli/toolkits/list/README.md
new file mode 100644
index 000000000..2fcd7ebda
--- /dev/null
+++ b/ts/e2e-tests/cli/toolkits/list/README.md
@@ -0,0 +1,21 @@
+# CLI `composio toolkits list` Test
+
+Verifies that `composio toolkits list` returns toolkits as JSON in piped mode with correct `--query` filtering behavior.
+
+## What It Tests
+
+| Test | Description |
+| --- | --- |
+| Exact slug match | `--query gmail --limit 1` returns 1 item with slug "gmail" |
+| Prefix search | `--query gmai --limit 1` returns 1 item (API supports prefix matching) |
+| No fuzzy search | `--query gmal --limit 1` returns empty (backend doesn't support fuzzy search) |
+
+## Requirements
+
+- `COMPOSIO_API_KEY` (**required**) — Composio API key passed to the container
+
+## Running
+
+```bash
+pnpm test:e2e:cli
+```
diff --git a/ts/e2e-tests/cli/toolkits/list/e2e.test.ts b/ts/e2e-tests/cli/toolkits/list/e2e.test.ts
new file mode 100644
index 000000000..8d31a6c63
--- /dev/null
+++ b/ts/e2e-tests/cli/toolkits/list/e2e.test.ts
@@ -0,0 +1,101 @@
+/**
+ * CLI `composio toolkits list` e2e test
+ *
+ * Verifies that the list subcommand returns toolkits as JSON in piped mode,
+ * supports --query filtering (exact, prefix, no fuzzy), and respects --limit.
+ */
+
+import { e2e, sanitizeOutput, type E2ETestResult } from '@e2e-tests/utils';
+import { TIMEOUTS } from '@e2e-tests/utils/const';
+import { describe, it, expect, beforeAll } from 'bun:test';
+
+declare module 'bun' {
+ interface Env {
+ COMPOSIO_API_KEY: string;
+ }
+}
+
+e2e(import.meta.url, {
+ versions: {
+ cli: ['current'],
+ },
+ env: {
+ COMPOSIO_API_KEY: Bun.env.COMPOSIO_API_KEY,
+ },
+ defineTests: ({ runCmd }) => {
+ let exactResult: E2ETestResult;
+ let prefixResult: E2ETestResult;
+ let noFuzzyResult: E2ETestResult;
+
+ beforeAll(async () => {
+ exactResult = await runCmd('composio toolkits list --query gmail --limit 1');
+ prefixResult = await runCmd('composio toolkits list --query gmai --limit 1');
+ noFuzzyResult = await runCmd('composio toolkits list --query gmal --limit 1');
+ }, TIMEOUTS.FIXTURE);
+
+ describe('composio toolkits list --query gmail --limit 1 (exact slug)', () => {
+ it('exits successfully', () => {
+ expect(exactResult.exitCode).toBe(0);
+ });
+
+ it('stderr is empty', () => {
+ expect(exactResult.stderr).toBe('');
+ });
+
+ it('stdout is a JSON array with 1 element', () => {
+ const items = JSON.parse(sanitizeOutput(exactResult.stdout));
+ expect(Array.isArray(items)).toBe(true);
+ expect(items).toHaveLength(1);
+ });
+
+ it('the element has slug "gmail"', () => {
+ const items = JSON.parse(sanitizeOutput(exactResult.stdout));
+ expect(items[0].slug).toBe('gmail');
+ });
+
+ it('the element has the expected shape', () => {
+ const item = JSON.parse(sanitizeOutput(exactResult.stdout))[0];
+ expect(item).toHaveProperty('name');
+ expect(item).toHaveProperty('slug');
+ expect(item).toHaveProperty('tools_count');
+ expect(item).toHaveProperty('triggers_count');
+ expect(item).toHaveProperty('description');
+ });
+ });
+
+ describe('composio toolkits list --query gmai --limit 1 (prefix search)', () => {
+ it('exits successfully', () => {
+ expect(prefixResult.exitCode).toBe(0);
+ });
+
+ it('stderr is empty', () => {
+ expect(prefixResult.stderr).toBe('');
+ });
+
+ it('stdout is a JSON array with 1 element', () => {
+ const items = JSON.parse(sanitizeOutput(prefixResult.stdout));
+ expect(Array.isArray(items)).toBe(true);
+ expect(items).toHaveLength(1);
+ });
+
+ it('the element has slug "gmail"', () => {
+ const items = JSON.parse(sanitizeOutput(prefixResult.stdout));
+ expect(items[0].slug).toBe('gmail');
+ });
+ });
+
+ describe('composio toolkits list --query gmal --limit 1 (no fuzzy search)', () => {
+ it('exits successfully', () => {
+ expect(noFuzzyResult.exitCode).toBe(0);
+ });
+
+ it('stderr is empty', () => {
+ expect(noFuzzyResult.stderr).toBe('');
+ });
+
+ it('stdout is empty (no results)', () => {
+ expect(sanitizeOutput(noFuzzyResult.stdout)).toBe('');
+ });
+ });
+ },
+});
diff --git a/ts/e2e-tests/cli/toolkits/list/package.json b/ts/e2e-tests/cli/toolkits/list/package.json
new file mode 100644
index 000000000..af251ebc3
--- /dev/null
+++ b/ts/e2e-tests/cli/toolkits/list/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "@e2e-tests/cli-toolkits-list",
+ "version": "0.0.0",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "typecheck": "tsc --noEmit",
+ "test:e2e": "bun test e2e.test.ts",
+ "test:e2e:cli": "bun test e2e.test.ts"
+ },
+ "devDependencies": {
+ "@e2e-tests/utils": "workspace:*"
+ }
+}
diff --git a/ts/e2e-tests/cli/toolkits/search/README.md b/ts/e2e-tests/cli/toolkits/search/README.md
new file mode 100644
index 000000000..d84df3c8e
--- /dev/null
+++ b/ts/e2e-tests/cli/toolkits/search/README.md
@@ -0,0 +1,22 @@
+# CLI `composio toolkits search` Test
+
+Verifies that `composio toolkits search <query>` returns matching toolkits as JSON in piped mode, respects `--limit`, supports stdout redirection, and handles queries with no results.
+
+## What It Tests
+
+| Test | Description |
+| --- | --- |
+| Known query | `search gmail` returns JSON array with "gmail" as first result |
+| With limit | `search gmail --limit 1` returns exactly 1 element |
+| Stdout redirection | `search gmail --limit 1 > out.json` captures JSON in the file |
+| No results | `search xyznonexistent_abc_12345` returns empty stdout |
+
+## Requirements
+
+- `COMPOSIO_API_KEY` (**required**) — Composio API key passed to the container
+
+## Running
+
+```bash
+pnpm test:e2e:cli
+```
diff --git a/ts/e2e-tests/cli/toolkits/search/e2e.test.ts b/ts/e2e-tests/cli/toolkits/search/e2e.test.ts
new file mode 100644
index 000000000..7d728bff9
--- /dev/null
+++ b/ts/e2e-tests/cli/toolkits/search/e2e.test.ts
@@ -0,0 +1,134 @@
+/**
+ * CLI `composio toolkits search` e2e test
+ *
+ * Verifies that the search subcommand returns matching toolkits as JSON in piped mode,
+ * respects --limit, supports stdout redirection, and handles no-result queries.
+ */
+
+import {
+ e2e,
+ sanitizeOutput,
+ type E2ETestResult,
+ type E2ETestResultWithFiles,
+} from '@e2e-tests/utils';
+import { TIMEOUTS } from '@e2e-tests/utils/const';
+import { describe, it, expect, beforeAll } from 'bun:test';
+
+declare module 'bun' {
+ interface Env {
+ COMPOSIO_API_KEY: string;
+ }
+}
+
+e2e(import.meta.url, {
+ versions: {
+ cli: ['current'],
+ },
+ env: {
+ COMPOSIO_API_KEY: Bun.env.COMPOSIO_API_KEY,
+ },
+ defineTests: ({ runCmd }) => {
+ let validResult: E2ETestResult;
+ let limitResult: E2ETestResult;
+ let redirectResult: E2ETestResultWithFiles<'out.json'>;
+ let noResultsResult: E2ETestResult;
+
+ beforeAll(async () => {
+ validResult = await runCmd('composio toolkits search gmail');
+ limitResult = await runCmd('composio toolkits search gmail --limit 1');
+ redirectResult = await runCmd({
+ command: 'composio toolkits search gmail --limit 1 > out.json',
+ files: ['out.json'],
+ });
+ noResultsResult = await runCmd('composio toolkits search xyznonexistent_abc_12345');
+ }, TIMEOUTS.FIXTURE);
+
+ describe('composio toolkits search gmail (known query)', () => {
+ it('exits successfully', () => {
+ expect(validResult.exitCode).toBe(0);
+ });
+
+ it('stderr is empty', () => {
+ expect(validResult.stderr).toBe('');
+ });
+
+ it('stdout is a JSON array with at least 1 element', () => {
+ const items = JSON.parse(sanitizeOutput(validResult.stdout));
+ expect(Array.isArray(items)).toBe(true);
+ expect(items.length).toBeGreaterThanOrEqual(1);
+ });
+
+ it('first element has slug "gmail"', () => {
+ const items = JSON.parse(sanitizeOutput(validResult.stdout));
+ expect(items[0].slug).toBe('gmail');
+ });
+
+ it('each element has the expected shape', () => {
+ const items = JSON.parse(sanitizeOutput(validResult.stdout));
+ for (const item of items) {
+ expect(item).toHaveProperty('name');
+ expect(item).toHaveProperty('slug');
+ expect(item).toHaveProperty('tools_count');
+ expect(item).toHaveProperty('triggers_count');
+ expect(item).toHaveProperty('description');
+ }
+ });
+ });
+
+ describe('composio toolkits search gmail --limit 1 (with limit)', () => {
+ it('exits successfully', () => {
+ expect(limitResult.exitCode).toBe(0);
+ });
+
+ it('stderr is empty', () => {
+ expect(limitResult.stderr).toBe('');
+ });
+
+ it('stdout is a JSON array with exactly 1 element', () => {
+ const items = JSON.parse(sanitizeOutput(limitResult.stdout));
+ expect(Array.isArray(items)).toBe(true);
+ expect(items).toHaveLength(1);
+ });
+
+ it('the element has slug "gmail"', () => {
+ const items = JSON.parse(sanitizeOutput(limitResult.stdout));
+ expect(items[0].slug).toBe('gmail');
+ });
+ });
+
+ describe('composio toolkits search gmail --limit 1 > out.json (stdout redirection)', () => {
+ it('exits successfully', () => {
+ expect(redirectResult.exitCode).toBe(0);
+ });
+
+ it('stdout is empty', () => {
+ expect(redirectResult.stdout).toBe('');
+ });
+
+ it('stderr is empty', () => {
+ expect(redirectResult.stderr).toBe('');
+ });
+
+ it('out.json contains a JSON array with slug "gmail"', () => {
+ const items = JSON.parse(sanitizeOutput(redirectResult.files['out.json']));
+ expect(Array.isArray(items)).toBe(true);
+ expect(items).toHaveLength(1);
+ expect(items[0].slug).toBe('gmail');
+ });
+ });
+
+ describe('composio toolkits search xyznonexistent_abc_12345 (no results)', () => {
+ it('exits successfully', () => {
+ expect(noResultsResult.exitCode).toBe(0);
+ });
+
+ it('stderr is empty', () => {
+ expect(noResultsResult.stderr).toBe('');
+ });
+
+ it('stdout is empty (no results)', () => {
+ expect(sanitizeOutput(noResultsResult.stdout)).toBe('');
+ });
+ });
+ },
+});
diff --git a/ts/e2e-tests/cli/toolkits/search/package.json b/ts/e2e-tests/cli/toolkits/search/package.json
new file mode 100644
index 000000000..8e369cad2
--- /dev/null
+++ b/ts/e2e-tests/cli/toolkits/search/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "@e2e-tests/cli-toolkits-search",
+ "version": "0.0.0",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "typecheck": "tsc --noEmit",
+ "test:e2e": "bun test e2e.test.ts",
+ "test:e2e:cli": "bun test e2e.test.ts"
+ },
+ "devDependencies": {
+ "@e2e-tests/utils": "workspace:*"
+ }
+}