@livewebdata-com/cli 0.0.0-stage → 0.0.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 +75 -2
- package/bin/cli.js +13 -0
- package/brand.json +14 -0
- package/openapi.json +1277 -0
- package/package.json +44 -4
- package/src/commands.js +381 -0
- package/src/config.js +102 -0
- package/src/help.js +127 -0
- package/src/http.js +96 -0
- package/src/main.js +282 -0
- package/src/output.js +57 -0
- package/src/spec.js +109 -0
- package/src/update.js +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Teneo Labs Inc.
|
|
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
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Live Web Data CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
How fresh is the web your AI reads? Live data, explained plainly.
|
|
4
|
+
|
|
5
|
+
`livewebdata` fetches live web pages as clean Markdown, text or HTML, straight from your terminal or your agent's shell.
|
|
6
|
+
It is the command line client for the [Live Web Data API](https://livewebdata.com) by Live Web Data.
|
|
7
|
+
|
|
8
|
+
## Quick start
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx @livewebdata-com/cli login # paste your API key (not echoed)
|
|
12
|
+
npx @livewebdata-com/cli fetch https://example.com -o text # the page as Markdown
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Get a key at [livewebdata.com](https://livewebdata.com). Node.js 18 or later.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g @livewebdata-com/cli
|
|
21
|
+
livewebdata --help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Use
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
livewebdata fetch https://example.com/a https://example.com/b # up to 10 URLs; JSON with results[] and statuses[]
|
|
28
|
+
livewebdata fetch https://example.com -o text # just the content (Markdown, else text, else HTML)
|
|
29
|
+
livewebdata fetch https://example.com -o html --html # the page HTML
|
|
30
|
+
livewebdata fetch https://example.com --country-code de --render # from Germany, rendered in a real browser
|
|
31
|
+
livewebdata fetch --data @request.json # the whole request body from a file (- for stdin)
|
|
32
|
+
livewebdata account # plan, credits and rate limit
|
|
33
|
+
livewebdata fetch --help # every option, with the API's own descriptions
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
A fetch that is still running after about 100 seconds is collected automatically with the same
|
|
37
|
+
`Idempotency-Key`, so it is charged once.
|
|
38
|
+
|
|
39
|
+
## The commands follow the live API
|
|
40
|
+
|
|
41
|
+
`livewebdata` builds its commands and options from the API's OpenAPI document at
|
|
42
|
+
[https://livewebdata.com/openapi.json](https://livewebdata.com/openapi.json), cached for an hour. When the API gains a field or an endpoint, the
|
|
43
|
+
option or command is there on your next run, without updating the CLI. Offline, it uses the last cached
|
|
44
|
+
copy, then the copy bundled with the installed version (`livewebdata spec` shows which one; `--offline` skips the
|
|
45
|
+
download). A daily job here publishes a new version whenever the API spec changed.
|
|
46
|
+
|
|
47
|
+
## Configuration
|
|
48
|
+
|
|
49
|
+
| Setting | Option | Environment | Default |
|
|
50
|
+
|---|---|---|---|
|
|
51
|
+
| API key | `--api-key` | `LIVE_WEB_DATA_API_KEY` | the key saved by `livewebdata login` (`~/.config/livewebdata/config.json`, mode 0600) |
|
|
52
|
+
| API base URL | `--base-url` | `LIVE_WEB_DATA_API_BASE_URL` | `https://livewebdata.com/api` |
|
|
53
|
+
| API spec URL | `--spec-url` | `LIVE_WEB_DATA_SPEC_URL` | `https://livewebdata.com/openapi.json` |
|
|
54
|
+
| Output | `-o json\|text\|<field>` | | `json` |
|
|
55
|
+
| Update notice | | `LIVEWEBDATA_NO_UPDATE_NOTIFIER=1` turns it off | once a day, terminals only |
|
|
56
|
+
|
|
57
|
+
Requests and your key only ever go to the base URL, never to a server named in the spec.
|
|
58
|
+
|
|
59
|
+
## Exit codes
|
|
60
|
+
|
|
61
|
+
| Code | Meaning |
|
|
62
|
+
|---|---|
|
|
63
|
+
| 0 | OK |
|
|
64
|
+
| 1 | The API answered with an error (JSON on stderr, with its `requestId`), every URL failed with `-o text`, or the fetch was still running at `--max-wait` |
|
|
65
|
+
| 2 | Usage: unknown command or option, a value the API does not accept |
|
|
66
|
+
| 3 | Network: no answer. The error carries the `Idempotency-Key` to collect the result without a new charge |
|
|
67
|
+
|
|
68
|
+
## Links
|
|
69
|
+
|
|
70
|
+
- [livewebdata.com](https://livewebdata.com)
|
|
71
|
+
- [Docs](https://livewebdata.com/docs)
|
|
72
|
+
- [API spec](https://livewebdata.com/openapi.json)
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT, © Teneo Labs Inc.
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// @ts-check
|
|
3
|
+
import { main } from "../src/main.js";
|
|
4
|
+
|
|
5
|
+
main(process.argv.slice(2), { env: process.env, stdin: process.stdin, stdout: process.stdout, stderr: process.stderr }).then(
|
|
6
|
+
(code) => {
|
|
7
|
+
process.exitCode = code;
|
|
8
|
+
},
|
|
9
|
+
(e) => {
|
|
10
|
+
process.stderr.write(`${e?.stack ?? e}\n`);
|
|
11
|
+
process.exitCode = 1;
|
|
12
|
+
},
|
|
13
|
+
);
|
package/brand.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Live Web Data",
|
|
3
|
+
"tagline": "How fresh is the web your AI reads? Live data, explained plainly.",
|
|
4
|
+
"domain": "livewebdata.com",
|
|
5
|
+
"bin": "livewebdata",
|
|
6
|
+
"npm": "@livewebdata-com/cli",
|
|
7
|
+
"org": "livewebdata-com",
|
|
8
|
+
"repo": "cli",
|
|
9
|
+
"siteUrl": "https://livewebdata.com",
|
|
10
|
+
"docsUrl": "https://livewebdata.com/docs",
|
|
11
|
+
"apiName": "Live Web Data API",
|
|
12
|
+
"apiBaseUrl": "https://livewebdata.com/api",
|
|
13
|
+
"specUrl": "https://livewebdata.com/openapi.json"
|
|
14
|
+
}
|