@bigknoxy/exa-cli 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +250 -0
- package/dist/commands/code.d.ts +23 -0
- package/dist/commands/code.d.ts.map +1 -0
- package/dist/commands/code.js +55 -0
- package/dist/commands/code.js.map +1 -0
- package/dist/commands/company.d.ts +26 -0
- package/dist/commands/company.d.ts.map +1 -0
- package/dist/commands/company.js +58 -0
- package/dist/commands/company.js.map +1 -0
- package/dist/commands/completion.d.ts +13 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +423 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/config.d.ts +23 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +119 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/crawl.d.ts +23 -0
- package/dist/commands/crawl.d.ts.map +1 -0
- package/dist/commands/crawl.js +55 -0
- package/dist/commands/crawl.js.map +1 -0
- package/dist/commands/index.d.ts +10 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +10 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/people.d.ts +26 -0
- package/dist/commands/people.d.ts.map +1 -0
- package/dist/commands/people.js +58 -0
- package/dist/commands/people.js.map +1 -0
- package/dist/commands/research.d.ts +6 -0
- package/dist/commands/research.d.ts.map +1 -0
- package/dist/commands/research.js +191 -0
- package/dist/commands/research.js.map +1 -0
- package/dist/commands/search-advanced.d.ts +64 -0
- package/dist/commands/search-advanced.d.ts.map +1 -0
- package/dist/commands/search-advanced.js +137 -0
- package/dist/commands/search-advanced.js.map +1 -0
- package/dist/commands/search.d.ts +36 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +74 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +23 -0
- package/dist/lib/config.d.ts +29 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +62 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/mcp-client.d.ts +15 -0
- package/dist/lib/mcp-client.d.ts.map +1 -0
- package/dist/lib/mcp-client.js +103 -0
- package/dist/lib/mcp-client.js.map +1 -0
- package/dist/lib/output.d.ts +13 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +167 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/types.d.ts +76 -0
- package/dist/types.js +5 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bigknoxy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# @bigknoxy/exa-cli
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@bigknoxy/exa-cli)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://nodejs.org)
|
|
6
|
+
|
|
7
|
+
A CLI wrapper for the [Exa MCP server](https://github.com/exa-labs/exa-mcp-server). Use Exa's powerful search, crawl, and research capabilities from the command line - optimized for LLM tool usage.
|
|
8
|
+
|
|
9
|
+
## Why exa-cli?
|
|
10
|
+
|
|
11
|
+
- **Free tier support** - Uses Exa's free MCP tier (no API key required)
|
|
12
|
+
- **LLM-optimized** - CLI tools are more efficient for LLMs than MCP protocol
|
|
13
|
+
- **All Exa tools** - Web search, code search, crawling, company research, people search, and deep research
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
### Quick Install (Recommended)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
curl -fsSL https://raw.githubusercontent.com/bigknoxy/exa-cli/main/install.sh | sh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### npm
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g @bigknoxy/exa-cli
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Run directly with npx
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx @bigknoxy/exa-cli search "your query"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Uninstall
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
curl -fsSL https://raw.githubusercontent.com/bigknoxy/exa-cli/main/uninstall.sh | sh
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Or with npm:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm uninstall -g @bigknoxy/exa-cli
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> **Note**: The uninstall script will leave your config file (`~/.exarc`) in place. Remove it manually with `rm ~/.exarc` if desired.
|
|
48
|
+
|
|
49
|
+
## Commands
|
|
50
|
+
|
|
51
|
+
### `exa search <query>`
|
|
52
|
+
|
|
53
|
+
Search the web for any topic.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
exa search "latest AI news 2026" --num 10
|
|
57
|
+
exa search "typescript best practices" --type fast --format json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Options:**
|
|
61
|
+
- `--num` - Number of results (default: 8)
|
|
62
|
+
- `--type` - Search type: `auto` or `fast` (default: auto)
|
|
63
|
+
- `--livecrawl` - Live crawl mode: `fallback` or `preferred` (default: fallback)
|
|
64
|
+
- `--format` - Output format: `text`, `json`, or `markdown` (default: text)
|
|
65
|
+
- `--api-key` - Override API key
|
|
66
|
+
|
|
67
|
+
### `exa code <query>`
|
|
68
|
+
|
|
69
|
+
Search for code examples and documentation.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
exa code "React useState hook TypeScript" --tokens 3000
|
|
73
|
+
exa code "express middleware authentication" --format markdown
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Options:**
|
|
77
|
+
- `--tokens` - Token count 1000-50000 (default: 5000)
|
|
78
|
+
- `--format` - Output format (default: text)
|
|
79
|
+
- `--api-key` - Override API key
|
|
80
|
+
|
|
81
|
+
### `exa crawl <url>`
|
|
82
|
+
|
|
83
|
+
Extract content from a specific URL.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
exa crawl https://docs.exa.ai --max-chars 5000
|
|
87
|
+
exa crawl https://example.com/article --format json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Options:**
|
|
91
|
+
- `--max-chars` - Maximum characters to extract (default: 3000)
|
|
92
|
+
- `--format` - Output format (default: text)
|
|
93
|
+
- `--api-key` - Override API key
|
|
94
|
+
|
|
95
|
+
### `exa company <name>`
|
|
96
|
+
|
|
97
|
+
Research a company.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
exa company Anthropic --num 5
|
|
101
|
+
exa company "OpenAI" --format json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Options:**
|
|
105
|
+
- `--num` - Number of results (default: 3)
|
|
106
|
+
- `--format` - Output format (default: text)
|
|
107
|
+
- `--api-key` - Override API key
|
|
108
|
+
|
|
109
|
+
### `exa people <query>`
|
|
110
|
+
|
|
111
|
+
Search for people and professional profiles.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
exa people "VP Engineering AI startups" --num 10
|
|
115
|
+
exa people "machine learning researcher" --format json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Options:**
|
|
119
|
+
- `--num` - Number of results (default: 5)
|
|
120
|
+
- `--format` - Output format (default: text)
|
|
121
|
+
- `--api-key` - Override API key
|
|
122
|
+
|
|
123
|
+
### `exa search-advanced <query>`
|
|
124
|
+
|
|
125
|
+
Advanced search with full filter control.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
exa search-advanced "AI agents 2026" \
|
|
129
|
+
--category news \
|
|
130
|
+
--include-domains techcrunch.com,wired.com \
|
|
131
|
+
--start-date 2026-01-01 \
|
|
132
|
+
--highlights
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Options:**
|
|
136
|
+
- `--num` - Number of results, max 100 (default: 10)
|
|
137
|
+
- `--type` - Search type: `auto`, `fast`, or `neural`
|
|
138
|
+
- `--category` - Category filter: `company`, `research paper`, `news`, `tweet`, `personal site`, `people`, `financial report`
|
|
139
|
+
- `--include-domains` - Comma-separated domains to include
|
|
140
|
+
- `--exclude-domains` - Comma-separated domains to exclude
|
|
141
|
+
- `--start-date` - Start published date (YYYY-MM-DD)
|
|
142
|
+
- `--end-date` - End published date (YYYY-MM-DD)
|
|
143
|
+
- `--highlights` - Enable highlights
|
|
144
|
+
- `--summary` - Enable summaries
|
|
145
|
+
- `--livecrawl` - Mode: `never`, `fallback`, `preferred`, `always`
|
|
146
|
+
- `--format` - Output format (default: text)
|
|
147
|
+
- `--api-key` - Override API key
|
|
148
|
+
|
|
149
|
+
### `exa research start <instructions>`
|
|
150
|
+
|
|
151
|
+
Start an AI research agent for complex questions.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
exa research start "Compare flagship GPUs from NVIDIA, AMD, and Intel in 2026"
|
|
155
|
+
exa research start "Analyze the electric vehicle market trends" --model exa-research-pro
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Options:**
|
|
159
|
+
- `--model` - Research model: `exa-research-fast`, `exa-research`, `exa-research-pro` (default: exa-research-fast)
|
|
160
|
+
- `--format` - Output format (default: text)
|
|
161
|
+
- `--api-key` - Override API key
|
|
162
|
+
|
|
163
|
+
### `exa research check <id>`
|
|
164
|
+
|
|
165
|
+
Check the status of a research task.
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
exa research check abc123...
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `exa config`
|
|
172
|
+
|
|
173
|
+
Manage configuration stored in `~/.exarc`.
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
exa config list # Show all config
|
|
177
|
+
exa config set apiKey YOUR_KEY # Set API key
|
|
178
|
+
exa config set output json # Set default output format
|
|
179
|
+
exa config get apiKey # Get a config value
|
|
180
|
+
exa config clear # Reset to defaults
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### `exa completion <shell>`
|
|
184
|
+
|
|
185
|
+
Generate shell completion scripts.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Bash
|
|
189
|
+
exa completion bash > /etc/bash_completion.d/exa
|
|
190
|
+
|
|
191
|
+
# Zsh
|
|
192
|
+
exa completion zsh > ~/.zsh/completions/_exa
|
|
193
|
+
|
|
194
|
+
# Fish
|
|
195
|
+
exa completion fish > ~/.config/fish/completions/exa.fish
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Configuration
|
|
199
|
+
|
|
200
|
+
Configuration is stored in `~/.exarc`:
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{
|
|
204
|
+
"apiKey": "your-api-key",
|
|
205
|
+
"output": "text",
|
|
206
|
+
"defaultNum": 8
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### API Key
|
|
211
|
+
|
|
212
|
+
The CLI works with the free MCP tier by default (no API key required). To get higher rate limits:
|
|
213
|
+
|
|
214
|
+
1. Get an API key from https://dashboard.exa.ai/api-keys
|
|
215
|
+
2. Set it via config: `exa config set apiKey YOUR_KEY`
|
|
216
|
+
3. Or use `--api-key` flag per command
|
|
217
|
+
4. Or set `EXA_API_KEY` environment variable
|
|
218
|
+
|
|
219
|
+
## Output Formats
|
|
220
|
+
|
|
221
|
+
- `text` (default) - Human-readable with colors
|
|
222
|
+
- `json` - Raw JSON output for scripting
|
|
223
|
+
- `markdown` - Markdown formatted with links
|
|
224
|
+
|
|
225
|
+
## Development
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Clone and install
|
|
229
|
+
git clone https://github.com/bigknoxy/exa-cli.git
|
|
230
|
+
cd exa-cli
|
|
231
|
+
npm install
|
|
232
|
+
|
|
233
|
+
# Build
|
|
234
|
+
npm run build
|
|
235
|
+
|
|
236
|
+
# Test
|
|
237
|
+
npm test
|
|
238
|
+
|
|
239
|
+
# Development mode
|
|
240
|
+
npm run dev search "test query"
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Requirements
|
|
244
|
+
|
|
245
|
+
- Node.js 18+
|
|
246
|
+
- npm or bun
|
|
247
|
+
|
|
248
|
+
## License
|
|
249
|
+
|
|
250
|
+
MIT
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: import("citty").CommandDef<{
|
|
2
|
+
query: {
|
|
3
|
+
type: "positional";
|
|
4
|
+
required: true;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
tokens: {
|
|
8
|
+
type: "string";
|
|
9
|
+
default: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
format: {
|
|
13
|
+
type: "string";
|
|
14
|
+
default: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
'api-key': {
|
|
18
|
+
type: "string";
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
23
|
+
//# sourceMappingURL=code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/commands/code.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,wBAmDE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineCommand } from 'citty';
|
|
2
|
+
import { consola } from 'consola';
|
|
3
|
+
import { getMcpClient } from '../lib/mcp-client.js';
|
|
4
|
+
import { formatOutput } from '../lib/output.js';
|
|
5
|
+
const VALID_FORMATS = ['text', 'json', 'markdown'];
|
|
6
|
+
export default defineCommand({
|
|
7
|
+
meta: {
|
|
8
|
+
name: 'code',
|
|
9
|
+
description: 'Search for code examples and documentation',
|
|
10
|
+
},
|
|
11
|
+
args: {
|
|
12
|
+
query: {
|
|
13
|
+
type: 'positional',
|
|
14
|
+
required: true,
|
|
15
|
+
description: 'Code search query (include language/framework)',
|
|
16
|
+
},
|
|
17
|
+
tokens: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
default: '5000',
|
|
20
|
+
description: 'Token count (1000-50000)',
|
|
21
|
+
},
|
|
22
|
+
format: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
default: 'text',
|
|
25
|
+
description: `Output format (${VALID_FORMATS.join(', ')})`,
|
|
26
|
+
},
|
|
27
|
+
'api-key': {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'Exa API key',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
async run({ args }) {
|
|
33
|
+
const { query, tokens, format, 'api-key': apiKey } = args;
|
|
34
|
+
const tokensNum = Math.min(Math.max(parseInt(String(tokens), 10) || 5000, 1000), 50000);
|
|
35
|
+
const outputFormat = VALID_FORMATS.includes(format) ? format : 'text';
|
|
36
|
+
const mcpClient = getMcpClient();
|
|
37
|
+
try {
|
|
38
|
+
await mcpClient.connect(apiKey);
|
|
39
|
+
const result = await mcpClient.callTool('get_code_context_exa', {
|
|
40
|
+
query,
|
|
41
|
+
tokensNum,
|
|
42
|
+
});
|
|
43
|
+
const formatted = formatOutput(result, outputFormat);
|
|
44
|
+
console.log(formatted);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
consola.error('Failed to search code:', error instanceof Error ? error.message : 'Unknown error');
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
await mcpClient.close();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../src/commands/code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAG/C,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAU,CAAA;AAE3D,eAAe,aAAa,CAAC;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,4CAA4C;KAC1D;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,IAAI,EAAE,YAAY;YAClB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gDAAgD;SAC9D;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,0BAA0B;SAC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B,CAAC;gBAAS,CAAC;YACT,MAAM,SAAS,CAAC,KAAK,EAAE,CAAA;QACzB,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Company research command - Wraps the MCP company_research_exa tool
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: import("citty").CommandDef<{
|
|
5
|
+
name: {
|
|
6
|
+
type: "positional";
|
|
7
|
+
required: true;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
num: {
|
|
11
|
+
type: "string";
|
|
12
|
+
default: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
format: {
|
|
16
|
+
type: "string";
|
|
17
|
+
default: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
'api-key': {
|
|
21
|
+
type: "string";
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
export default _default;
|
|
26
|
+
//# sourceMappingURL=company.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company.d.ts","sourceRoot":"","sources":["../../src/commands/company.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAUH,wBAmDE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Company research command - Wraps the MCP company_research_exa tool
|
|
3
|
+
*/
|
|
4
|
+
import { defineCommand } from 'citty';
|
|
5
|
+
import { consola } from 'consola';
|
|
6
|
+
import { getMcpClient } from '../lib/mcp-client.js';
|
|
7
|
+
import { formatOutput } from '../lib/output.js';
|
|
8
|
+
const VALID_FORMATS = ['text', 'json', 'markdown'];
|
|
9
|
+
export default defineCommand({
|
|
10
|
+
meta: {
|
|
11
|
+
name: 'company',
|
|
12
|
+
description: 'Research a company',
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
name: {
|
|
16
|
+
type: 'positional',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'Company name to research',
|
|
19
|
+
},
|
|
20
|
+
num: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
default: '3',
|
|
23
|
+
description: 'Number of results',
|
|
24
|
+
},
|
|
25
|
+
format: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: 'text',
|
|
28
|
+
description: `Output format (${VALID_FORMATS.join(', ')})`,
|
|
29
|
+
},
|
|
30
|
+
'api-key': {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Exa API key',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
async run({ args }) {
|
|
36
|
+
const { name, num, format, 'api-key': apiKey } = args;
|
|
37
|
+
const numResults = parseInt(String(num), 10) || 3;
|
|
38
|
+
const outputFormat = VALID_FORMATS.includes(format) ? format : 'text';
|
|
39
|
+
const client = getMcpClient();
|
|
40
|
+
try {
|
|
41
|
+
await client.connect(apiKey);
|
|
42
|
+
const result = await client.callTool('company_research_exa', {
|
|
43
|
+
companyName: name,
|
|
44
|
+
numResults,
|
|
45
|
+
});
|
|
46
|
+
const output = formatOutput(result, outputFormat);
|
|
47
|
+
console.log(output);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
consola.error('Company research failed:', error instanceof Error ? error.message : 'Unknown error');
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
await client.close();
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=company.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company.js","sourceRoot":"","sources":["../../src/commands/company.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,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YAEF,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;YACjD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAA;YACnG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;gBAAS,CAAC;YACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;QACtB,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion command - Generate shell completion scripts
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: import("citty").CommandDef<{
|
|
5
|
+
shell: {
|
|
6
|
+
type: "positional";
|
|
7
|
+
required: true;
|
|
8
|
+
description: string;
|
|
9
|
+
value: (val: string) => string;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;qBAiZgB,MAAM;;;AAVzB,wBAwCE"}
|