@octen.ai/cli 0.5.0 → 0.5.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/README.md +1 -1
- package/dist/api/extract.d.ts +4 -1
- package/dist/api/extract.js +0 -1
- package/dist/commands/extract.js +1 -2
- package/dist/output/pretty/extract.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ Extract content from one or more URLs (1–20).
|
|
|
97
97
|
octen extract https://example.com --query "pricing" --max-age 3600 --images
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
Options: `--query` (relevance hint), `--max-age <sec>` (cache age, 300–31536000), `--images
|
|
100
|
+
Options: `--query` (relevance hint), `--max-age <sec>` (cache age, 300–31536000), `--images` (also returns `cover_image` when present), `--videos`, `--audio`, `--format` (markdown|text), `--fetch-timeout <sec>` (1–60), `--full` (print full page content). The page favicon is returned by default when available.
|
|
101
101
|
|
|
102
102
|
Pretty output truncates page content to ~500 chars for readability; pass `--full` to print the whole thing (or `--json` for the raw response).
|
|
103
103
|
|
package/dist/api/extract.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export interface ExtractItem {
|
|
|
14
14
|
time_published?: string;
|
|
15
15
|
full_content?: string;
|
|
16
16
|
highlights?: string[];
|
|
17
|
+
favicon?: string;
|
|
18
|
+
cover_image?: {
|
|
19
|
+
url?: string;
|
|
20
|
+
};
|
|
17
21
|
error_message?: string;
|
|
18
22
|
}
|
|
19
23
|
/** Response shape for the /extract endpoint. */
|
|
@@ -29,7 +33,6 @@ export interface ExtractOpts {
|
|
|
29
33
|
images?: boolean;
|
|
30
34
|
videos?: boolean;
|
|
31
35
|
audio?: boolean;
|
|
32
|
-
favicon?: boolean;
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* Auto-prefix bare hosts with https:// and reject inputs that are not plausible
|
package/dist/api/extract.js
CHANGED
package/dist/commands/extract.js
CHANGED
|
@@ -12,10 +12,9 @@ export function registerExtract(program) {
|
|
|
12
12
|
.option("--max-age <sec>", "max cache age in seconds", parseIntOpt("--max-age"))
|
|
13
13
|
.option("--format <f>", "markdown|text")
|
|
14
14
|
.option("--fetch-timeout <sec>", "per-URL fetch timeout (1-60)", parseIntOpt("--fetch-timeout"))
|
|
15
|
-
.option("--images", "include images")
|
|
15
|
+
.option("--images", "include images (also returns cover_image when present)")
|
|
16
16
|
.option("--videos", "include videos")
|
|
17
17
|
.option("--audio", "include audio")
|
|
18
|
-
.option("--favicon", "include favicon")
|
|
19
18
|
.option("--full", "print full page content untruncated (pretty mode)")
|
|
20
19
|
.action(async (urls, opts, command) => {
|
|
21
20
|
const g = command.optsWithGlobals();
|
|
@@ -39,6 +39,11 @@ export function renderExtract(data, full = false) {
|
|
|
39
39
|
// Title
|
|
40
40
|
if (item.title)
|
|
41
41
|
lines.push(` ${item.title}`);
|
|
42
|
+
// Media identity: favicon (default) + cover image (with --images)
|
|
43
|
+
if (item.favicon)
|
|
44
|
+
lines.push(pc.dim(` favicon: ${item.favicon}`));
|
|
45
|
+
if (item.cover_image?.url)
|
|
46
|
+
lines.push(pc.dim(` cover: ${item.cover_image.url}`));
|
|
42
47
|
// Snippet: prefer joined highlights, else truncated full_content
|
|
43
48
|
if (item.highlights && item.highlights.length > 0) {
|
|
44
49
|
lines.push(` ${item.highlights.join(" ")}`);
|