@knowledgesdk/cli 0.1.0
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 +263 -0
- package/dist/commands/classify.d.ts +3 -0
- package/dist/commands/classify.d.ts.map +1 -0
- package/dist/commands/classify.js +45 -0
- package/dist/commands/classify.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +63 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/extract.d.ts +3 -0
- package/dist/commands/extract.d.ts.map +1 -0
- package/dist/commands/extract.js +136 -0
- package/dist/commands/extract.js.map +1 -0
- package/dist/commands/jobs.d.ts +3 -0
- package/dist/commands/jobs.d.ts.map +1 -0
- package/dist/commands/jobs.js +121 -0
- package/dist/commands/jobs.js.map +1 -0
- package/dist/commands/scrape.d.ts +3 -0
- package/dist/commands/scrape.d.ts.map +1 -0
- package/dist/commands/scrape.js +48 -0
- package/dist/commands/scrape.js.map +1 -0
- package/dist/commands/screenshot.d.ts +3 -0
- package/dist/commands/screenshot.d.ts.map +1 -0
- package/dist/commands/screenshot.js +58 -0
- package/dist/commands/screenshot.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +51 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/sitemap.d.ts +3 -0
- package/dist/commands/sitemap.d.ts.map +1 -0
- package/dist/commands/sitemap.js +45 -0
- package/dist/commands/sitemap.js.map +1 -0
- package/dist/commands/webhooks.d.ts +3 -0
- package/dist/commands/webhooks.d.ts.map +1 -0
- package/dist/commands/webhooks.js +118 -0
- package/dist/commands/webhooks.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +71 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +212 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/config.d.ts +23 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +59 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/output.d.ts +73 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +149 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/types.d.ts +127 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 KnowledgeSDK
|
|
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,263 @@
|
|
|
1
|
+
# KnowledgeSDK CLI
|
|
2
|
+
|
|
3
|
+
A beautiful, fully-featured command-line interface for [KnowledgeSDK](https://knowledgesdk.com) — extract, scrape, classify, search, and manage knowledge from any website.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @knowledgesdk/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or use without installing:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @knowledgesdk/cli <command>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# 1. Set your API key
|
|
21
|
+
npx knowledgesdk config --key sk_ks_your_key
|
|
22
|
+
|
|
23
|
+
# 2. Extract knowledge from a website
|
|
24
|
+
npx knowledgesdk extract https://competitor.com
|
|
25
|
+
|
|
26
|
+
# 3. Search your knowledge base
|
|
27
|
+
npx knowledgesdk search "pricing plans"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Configuration
|
|
31
|
+
|
|
32
|
+
API keys are stored in `~/.knowledgesdk/config.json`.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Set API key
|
|
36
|
+
npx knowledgesdk config --key sk_ks_your_key
|
|
37
|
+
|
|
38
|
+
# Set a custom API base URL
|
|
39
|
+
npx knowledgesdk config --url https://api.myinstance.com
|
|
40
|
+
|
|
41
|
+
# View current config
|
|
42
|
+
npx knowledgesdk config
|
|
43
|
+
|
|
44
|
+
# Clear stored config
|
|
45
|
+
npx knowledgesdk config --clear
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
You can also use environment variables instead of the config file:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
export KNOWLEDGESDK_API_KEY=sk_ks_your_key
|
|
52
|
+
export KNOWLEDGESDK_BASE_URL=https://api.knowledgesdk.com # optional
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Commands
|
|
56
|
+
|
|
57
|
+
### `extract` — Extract knowledge from a website
|
|
58
|
+
|
|
59
|
+
Crawls a website and extracts structured knowledge from its pages.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Basic extraction (synchronous)
|
|
63
|
+
npx knowledgesdk extract https://competitor.com
|
|
64
|
+
|
|
65
|
+
# Run asynchronously and get a job ID back
|
|
66
|
+
npx knowledgesdk extract https://competitor.com --async
|
|
67
|
+
|
|
68
|
+
# Run asynchronously with a webhook callback
|
|
69
|
+
npx knowledgesdk extract https://competitor.com --async --callback-url https://myapp.com/hook
|
|
70
|
+
|
|
71
|
+
# Limit crawl depth
|
|
72
|
+
npx knowledgesdk extract https://competitor.com --max-pages 20
|
|
73
|
+
|
|
74
|
+
# Save result to a file
|
|
75
|
+
npx knowledgesdk extract https://competitor.com --output result.json
|
|
76
|
+
|
|
77
|
+
# Output raw JSON
|
|
78
|
+
npx knowledgesdk extract https://competitor.com --json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
| Flag | Description |
|
|
82
|
+
|------|-------------|
|
|
83
|
+
| `--async` | Run asynchronously; returns a job ID |
|
|
84
|
+
| `--callback-url <url>` | Webhook URL to notify when done |
|
|
85
|
+
| `--max-pages <n>` | Maximum pages to crawl |
|
|
86
|
+
| `--output <file>` | Save JSON result to file |
|
|
87
|
+
| `--json` | Output raw JSON |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
### `scrape` — Scrape a URL to Markdown
|
|
92
|
+
|
|
93
|
+
Fetches a single page and returns its content as clean Markdown.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx knowledgesdk scrape https://docs.example.com
|
|
97
|
+
npx knowledgesdk scrape https://docs.example.com --output content.md
|
|
98
|
+
npx knowledgesdk scrape https://docs.example.com --json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
| Flag | Description |
|
|
102
|
+
|------|-------------|
|
|
103
|
+
| `--output <file>` | Save markdown to file |
|
|
104
|
+
| `--json` | Output raw JSON including metadata |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### `classify` — Classify a business
|
|
109
|
+
|
|
110
|
+
Uses AI to classify a website into an industry/category.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npx knowledgesdk classify https://example.com
|
|
114
|
+
npx knowledgesdk classify https://example.com --json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
| Flag | Description |
|
|
118
|
+
|------|-------------|
|
|
119
|
+
| `--json` | Output raw JSON |
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### `sitemap` — Get a website's sitemap
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npx knowledgesdk sitemap https://example.com
|
|
127
|
+
|
|
128
|
+
# Limit the number of URLs shown
|
|
129
|
+
npx knowledgesdk sitemap https://example.com --limit 50
|
|
130
|
+
|
|
131
|
+
# Output raw JSON
|
|
132
|
+
npx knowledgesdk sitemap https://example.com --json
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
| Flag | Description |
|
|
136
|
+
|------|-------------|
|
|
137
|
+
| `--limit <n>` | Limit number of URLs shown |
|
|
138
|
+
| `--json` | Output raw JSON |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### `screenshot` — Take a screenshot
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npx knowledgesdk screenshot https://example.com
|
|
146
|
+
npx knowledgesdk screenshot https://example.com --output screenshot.png
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
| Flag | Description |
|
|
150
|
+
|------|-------------|
|
|
151
|
+
| `--output <file>` | Save PNG to file |
|
|
152
|
+
| `--json` | Output raw JSON (includes base64 image) |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### `search` — Search your knowledge base
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
npx knowledgesdk search "pricing plans"
|
|
160
|
+
npx knowledgesdk search "integration options" --limit 5
|
|
161
|
+
npx knowledgesdk search "API documentation" --json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
| Flag | Description |
|
|
165
|
+
|------|-------------|
|
|
166
|
+
| `--limit <n>` | Maximum results to return |
|
|
167
|
+
| `--json` | Output raw JSON |
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### `webhooks` — Manage webhooks
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# List all webhooks
|
|
175
|
+
npx knowledgesdk webhooks list
|
|
176
|
+
|
|
177
|
+
# Create a webhook
|
|
178
|
+
npx knowledgesdk webhooks create \
|
|
179
|
+
--url https://myapp.com/hook \
|
|
180
|
+
--events EXTRACTION_COMPLETED,PAGE_SCRAPED
|
|
181
|
+
|
|
182
|
+
# Delete a webhook
|
|
183
|
+
npx knowledgesdk webhooks delete weh_xxx
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Available events:**
|
|
187
|
+
|
|
188
|
+
| Event | Description |
|
|
189
|
+
|-------|-------------|
|
|
190
|
+
| `EXTRACTION_COMPLETED` | Full extraction job finished |
|
|
191
|
+
| `EXTRACTION_FAILED` | Full extraction job failed |
|
|
192
|
+
| `PAGE_SCRAPED` | Individual page scraped |
|
|
193
|
+
| `JOB_STARTED` | Async job started |
|
|
194
|
+
| `JOB_FAILED` | Async job failed |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
### `jobs` — Monitor async jobs
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
# Check job status once
|
|
202
|
+
npx knowledgesdk jobs get job_xxx
|
|
203
|
+
|
|
204
|
+
# Poll until the job completes
|
|
205
|
+
npx knowledgesdk jobs poll job_xxx
|
|
206
|
+
|
|
207
|
+
# Poll with a custom interval (in ms)
|
|
208
|
+
npx knowledgesdk jobs poll job_xxx --interval 5000
|
|
209
|
+
|
|
210
|
+
# Output final result as JSON
|
|
211
|
+
npx knowledgesdk jobs poll job_xxx --json
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Global Flags
|
|
217
|
+
|
|
218
|
+
| Flag | Description |
|
|
219
|
+
|------|-------------|
|
|
220
|
+
| `--help` / `-h` | Show help for any command |
|
|
221
|
+
| `--version` / `-v` | Show CLI version |
|
|
222
|
+
|
|
223
|
+
## Output Formats
|
|
224
|
+
|
|
225
|
+
By default the CLI renders human-readable, colored output. Use `--json` on any command to get raw JSON, or `--output <file>` to save results to disk.
|
|
226
|
+
|
|
227
|
+
## Error Handling
|
|
228
|
+
|
|
229
|
+
The CLI provides friendly error messages for common issues:
|
|
230
|
+
|
|
231
|
+
| HTTP Status | Message |
|
|
232
|
+
|-------------|---------|
|
|
233
|
+
| `401` | Invalid API key — prompts you to run `config` |
|
|
234
|
+
| `403` | Access forbidden |
|
|
235
|
+
| `429` | Rate limit exceeded — suggests retrying |
|
|
236
|
+
| `500/502/503` | Server error — suggests retrying |
|
|
237
|
+
|
|
238
|
+
If no API key is found at all, the CLI will tell you exactly how to set one.
|
|
239
|
+
|
|
240
|
+
## Requirements
|
|
241
|
+
|
|
242
|
+
- Node.js >= 18 (uses native `fetch`)
|
|
243
|
+
- A KnowledgeSDK API key from [knowledgesdk.com](https://knowledgesdk.com)
|
|
244
|
+
|
|
245
|
+
## Development
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Install dependencies
|
|
249
|
+
npm install
|
|
250
|
+
|
|
251
|
+
# Build TypeScript
|
|
252
|
+
npm run build
|
|
253
|
+
|
|
254
|
+
# Watch mode
|
|
255
|
+
npm run dev
|
|
256
|
+
|
|
257
|
+
# Run locally
|
|
258
|
+
node dist/index.js --help
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## License
|
|
262
|
+
|
|
263
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/commands/classify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6C9D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import ora from 'ora';
|
|
2
|
+
import { classifyUrl } from '../lib/api.js';
|
|
3
|
+
import { colorizeConfidence, handleApiError, printField, printHeader, printJson, theme, } from '../lib/output.js';
|
|
4
|
+
export function registerClassifyCommand(program) {
|
|
5
|
+
program
|
|
6
|
+
.command('classify <url>')
|
|
7
|
+
.description('Classify a business/website into a category')
|
|
8
|
+
.option('--json', 'Output raw JSON')
|
|
9
|
+
.action(async (url, opts) => {
|
|
10
|
+
const spinner = ora({
|
|
11
|
+
text: `Classifying ${theme.url(url)}…`,
|
|
12
|
+
color: 'cyan',
|
|
13
|
+
}).start();
|
|
14
|
+
try {
|
|
15
|
+
const result = await classifyUrl(url);
|
|
16
|
+
spinner.stop();
|
|
17
|
+
if (opts.json) {
|
|
18
|
+
printJson(result);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
printHeader('Classification result');
|
|
22
|
+
printField('URL', result.url);
|
|
23
|
+
printField('Category', theme.highlight(result.category));
|
|
24
|
+
if (result.subcategory) {
|
|
25
|
+
printField('Subcategory', result.subcategory);
|
|
26
|
+
}
|
|
27
|
+
printField('Confidence', colorizeConfidence(result.confidence));
|
|
28
|
+
if (result.description) {
|
|
29
|
+
console.log('');
|
|
30
|
+
console.log(` ${theme.label('Description')}`);
|
|
31
|
+
console.log(` ${theme.dim(result.description)}`);
|
|
32
|
+
}
|
|
33
|
+
if (result.tags && result.tags.length > 0) {
|
|
34
|
+
console.log('');
|
|
35
|
+
console.log(` ${theme.label('Tags')} ${result.tags.map((t) => theme.info(`#${t}`)).join(' ')}`);
|
|
36
|
+
}
|
|
37
|
+
console.log('');
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
spinner.stop();
|
|
41
|
+
handleApiError(err);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=classify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../../src/commands/classify.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,WAAW,EACX,SAAS,EACT,KAAK,GACN,MAAM,kBAAkB,CAAC;AAG1B,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,OAAO;SACJ,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,6CAA6C,CAAC;SAC1D,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC;SACnC,MAAM,CAAC,KAAK,EAAE,GAAW,EAAE,IAAqB,EAAE,EAAE;QACnD,MAAM,OAAO,GAAG,GAAG,CAAC;YAClB,IAAI,EAAE,eAAe,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG;YACtC,KAAK,EAAE,MAAM;SACd,CAAC,CAAC,KAAK,EAAE,CAAC;QAEX,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,CAAC;YAEtC,OAAO,CAAC,IAAI,EAAE,CAAC;YAEf,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,SAAS,CAAC,MAAM,CAAC,CAAC;gBAClB,OAAO;YACT,CAAC;YAED,WAAW,CAAC,uBAAuB,CAAC,CAAC;YACrC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;YAC9B,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,C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AE,MAAM,WAAW,CAAC;AAiBpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2E5D"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getConfigFilePath, resolveApiKey, resolveBaseUrl, writeConfig, } from '../lib/config.js';
|
|
2
|
+
import { printError, printField, printHeader, printInfo, printSuccess, theme, } from '../lib/output.js';
|
|
3
|
+
export function registerConfigCommand(program) {
|
|
4
|
+
const config = program
|
|
5
|
+
.command('config')
|
|
6
|
+
.description('Manage CLI configuration (API key, base URL)');
|
|
7
|
+
// knowledgesdk config --key sk_ks_xxx
|
|
8
|
+
config
|
|
9
|
+
.option('-k, --key <apiKey>', 'Set your KnowledgeSDK API key')
|
|
10
|
+
.option('-u, --url <baseUrl>', 'Set a custom API base URL')
|
|
11
|
+
.option('--show', 'Show current configuration')
|
|
12
|
+
.option('--clear', 'Remove stored configuration')
|
|
13
|
+
.action((opts) => {
|
|
14
|
+
if (opts.clear) {
|
|
15
|
+
writeConfig({ apiKey: undefined, baseUrl: undefined });
|
|
16
|
+
printSuccess('Configuration cleared.');
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (opts.key || opts.url) {
|
|
20
|
+
const updates = {};
|
|
21
|
+
if (opts.key) {
|
|
22
|
+
if (!opts.key.startsWith('sk_')) {
|
|
23
|
+
printError('API key format looks incorrect.', 'Keys typically start with sk_ks_...');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
updates.apiKey = opts.key;
|
|
27
|
+
}
|
|
28
|
+
if (opts.url) {
|
|
29
|
+
updates.baseUrl = opts.url;
|
|
30
|
+
}
|
|
31
|
+
writeConfig(updates);
|
|
32
|
+
printHeader('Configuration saved');
|
|
33
|
+
if (updates.apiKey) {
|
|
34
|
+
const masked = updates.apiKey.slice(0, 8) + '••••••••' + updates.apiKey.slice(-4);
|
|
35
|
+
printField('API Key', masked);
|
|
36
|
+
}
|
|
37
|
+
if (updates.baseUrl) {
|
|
38
|
+
printField('Base URL', updates.baseUrl);
|
|
39
|
+
}
|
|
40
|
+
printField('Config file', getConfigFilePath());
|
|
41
|
+
console.log('');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
// Default: show current config
|
|
45
|
+
const apiKey = resolveApiKey();
|
|
46
|
+
const baseUrl = resolveBaseUrl();
|
|
47
|
+
const filePath = getConfigFilePath();
|
|
48
|
+
printHeader('Current configuration');
|
|
49
|
+
if (apiKey) {
|
|
50
|
+
const masked = apiKey.slice(0, 8) + '••••••••' + apiKey.slice(-4);
|
|
51
|
+
printField('API Key', masked);
|
|
52
|
+
printField('Key source', process.env['KNOWLEDGESDK_API_KEY'] ? 'env var' : 'config file');
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
printField('API Key', theme.error('not set'));
|
|
56
|
+
printInfo('Set your key: knowledgesdk config --key <your-api-key>');
|
|
57
|
+
}
|
|
58
|
+
printField('Base URL', baseUrl);
|
|
59
|
+
printField('Config file', filePath);
|
|
60
|
+
console.log('');
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EAEjB,aAAa,EACb,cAAc,EACd,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,KAAK,GACN,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,8CAA8C,CAAC,CAAC;IAE/D,sCAAsC;IACtC,MAAM;SACH,MAAM,CAAC,oBAAoB,EAAE,+BAA+B,CAAC;SAC7D,MAAM,CAAC,qB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wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkI7D"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import ora from 'ora';
|
|
2
|
+
import { extractUrl, extractUrlStream } from '../lib/api.js';
|
|
3
|
+
import { colorizeStatus, handleApiError, printField, printHeader, printInfo, printJson, saveToFile, theme, } from '../lib/output.js';
|
|
4
|
+
export function registerExtractCommand(program) {
|
|
5
|
+
program
|
|
6
|
+
.command('extract <url>')
|
|
7
|
+
.description('Extract structured knowledge from a website')
|
|
8
|
+
.option('-a, --async', 'Run extraction asynchronously (returns a job ID)')
|
|
9
|
+
.option('-c, --callback-url <url>', 'Webhook URL to call when extraction completes')
|
|
10
|
+
.option('-m, --max-pages <number>', 'Maximum number of pages to crawl', parseInt)
|
|
11
|
+
.option('-o, --output <file>', 'Save result to a file (JSON)')
|
|
12
|
+
.option('--no-stream', 'Disable live streaming and wait synchronously')
|
|
13
|
+
.option('--json', 'Output raw JSON')
|
|
14
|
+
.action(async (url, opts) => {
|
|
15
|
+
// ── Async mode: fire and forget ──────────────────────────────────────
|
|
16
|
+
if (opts.async) {
|
|
17
|
+
const spinner = ora({ text: `Queuing extraction for ${theme.url(url)}…`, color: 'cyan' }).start();
|
|
18
|
+
try {
|
|
19
|
+
const result = await extractUrl(url, {
|
|
20
|
+
async: true,
|
|
21
|
+
callbackUrl: opts.callbackUrl,
|
|
22
|
+
maxPages: opts.maxPages,
|
|
23
|
+
});
|
|
24
|
+
spinner.stop();
|
|
25
|
+
if (opts.json) {
|
|
26
|
+
printJson(result);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
printHeader('Extraction queued');
|
|
30
|
+
printField('Job ID', result.jobId);
|
|
31
|
+
printField('Status', colorizeStatus(result.status));
|
|
32
|
+
printField('URL', result.url);
|
|
33
|
+
console.log('');
|
|
34
|
+
printInfo(`Poll for results: knowledgesdk jobs poll ${result.jobId}`);
|
|
35
|
+
console.log('');
|
|
36
|
+
if (opts.output)
|
|
37
|
+
saveToFile(opts.output, JSON.stringify(result, null, 2));
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
spinner.stop();
|
|
41
|
+
handleApiError(err);
|
|
42
|
+
}
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
// ── Streaming mode (default) ─────────────────────────────────────────
|
|
46
|
+
if (opts.stream !== false) {
|
|
47
|
+
const spinner = ora({ text: `Connecting to ${theme.url(url)}…`, color: 'cyan' }).start();
|
|
48
|
+
const startTime = Date.now();
|
|
49
|
+
let businessName = '';
|
|
50
|
+
let finalResult = null;
|
|
51
|
+
try {
|
|
52
|
+
for await (const event of extractUrlStream(url, { maxPages: opts.maxPages })) {
|
|
53
|
+
switch (event.type) {
|
|
54
|
+
case 'connected':
|
|
55
|
+
spinner.text = `Classifying ${theme.url(url)}…`;
|
|
56
|
+
break;
|
|
57
|
+
case 'business_classified':
|
|
58
|
+
businessName = event.business.businessName;
|
|
59
|
+
spinner.text = `Classified: ${theme.bold(businessName)}`;
|
|
60
|
+
break;
|
|
61
|
+
case 'progress':
|
|
62
|
+
spinner.text = event.message;
|
|
63
|
+
break;
|
|
64
|
+
case 'pages_planned':
|
|
65
|
+
spinner.text = `Planned ${event.pages.length} pages to scrape…`;
|
|
66
|
+
break;
|
|
67
|
+
case 'page_scraped':
|
|
68
|
+
spinner.text = `Scraping page ${event.index + 1}/${event.total}: ${theme.dim(event.url)}`;
|
|
69
|
+
break;
|
|
70
|
+
case 'complete':
|
|
71
|
+
finalResult = event.result;
|
|
72
|
+
break;
|
|
73
|
+
case 'error':
|
|
74
|
+
throw new Error(event.message);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const durationSec = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
78
|
+
const label = businessName || url;
|
|
79
|
+
const pages = finalResult?.pagesScraped ?? 0;
|
|
80
|
+
const items = Array.isArray(finalResult?.knowledgeItems) ? finalResult.knowledgeItems.length : 0;
|
|
81
|
+
spinner.succeed(`${theme.bold(label)} — ${pages} pages · ${items} knowledge items · ${durationSec}s`);
|
|
82
|
+
if (opts.json) {
|
|
83
|
+
printJson(finalResult);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (finalResult) {
|
|
87
|
+
console.log('');
|
|
88
|
+
printHeader('Extraction complete');
|
|
89
|
+
printField('Pages scraped', String(pages));
|
|
90
|
+
printField('Knowledge items', String(items));
|
|
91
|
+
printField('Duration', `${durationSec}s`);
|
|
92
|
+
}
|
|
93
|
+
console.log('');
|
|
94
|
+
if (opts.output && finalResult)
|
|
95
|
+
saveToFile(opts.output, JSON.stringify(finalResult, null, 2));
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
spinner.fail();
|
|
99
|
+
handleApiError(err);
|
|
100
|
+
}
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
// ── Sync fallback (--no-stream) ──────────────────────────────────────
|
|
104
|
+
const spinner = ora({ text: `Extracting knowledge from ${theme.url(url)}…`, color: 'cyan' }).start();
|
|
105
|
+
try {
|
|
106
|
+
const result = await extractUrl(url, {
|
|
107
|
+
async: false,
|
|
108
|
+
callbackUrl: opts.callbackUrl,
|
|
109
|
+
maxPages: opts.maxPages,
|
|
110
|
+
});
|
|
111
|
+
spinner.stop();
|
|
112
|
+
if (opts.json) {
|
|
113
|
+
printJson(result);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
printHeader('Extraction result');
|
|
117
|
+
printField('Job ID', result.jobId);
|
|
118
|
+
printField('Status', colorizeStatus(result.status));
|
|
119
|
+
printField('URL', result.url);
|
|
120
|
+
printField('Created', result.createdAt);
|
|
121
|
+
if (result.status === 'COMPLETED' && result.result) {
|
|
122
|
+
printField('Total pages', result.result.totalPages);
|
|
123
|
+
}
|
|
124
|
+
if (result.completedAt)
|
|
125
|
+
printField('Completed', result.completedAt);
|
|
126
|
+
console.log('');
|
|
127
|
+
if (opts.output)
|
|
128
|
+
saveToFile(opts.output, JSON.stringify(result, null, 2));
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
spinner.stop();
|
|
132
|
+
handleApiError(err);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=extract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/commands/extract.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,cAAc,EACd,UAAU,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,KAAK,GACN,MAAM,kBAAkB,CAAC;AAG1B,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,6CAA6C,CAAC;SAC1D,MAAM,CAAC,aAAa,EAAE,kDAAkD,CAAC;SACzE,MAAM,CACL,0BAA0B,EAC1B,+CAA+C,CAChD;SACA,MAAM,CAAC,0BAA0B,EAAE,kCAAkC,EAAE,QAAQ,CAAC;SAChF,MAAM,CAAC,qBAAqB,EAAE,8BAA8B,CAAC;SAC7D,MAAM,CAAC,aAAa,EAAE,+CAA+C,CAAC;SACtE,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC;SACnC,MAAM,CACL,KAAK,EACH,GAAW,EACX,IAA2D,EAC3D,EAAE;QACF,wEAAwE;QACxE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,0BAA0B,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;YAClG,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG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