vellum-cli 0.3.4 → 0.3.5
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 +29 -8
- package/dist/index.js +9 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,14 +8,16 @@ Vellum server.
|
|
|
8
8
|
```bash
|
|
9
9
|
# one-off, no install
|
|
10
10
|
npx vellum-cli push --help
|
|
11
|
+
bunx vellum-cli push --help # or with Bun
|
|
11
12
|
|
|
12
13
|
# or install the `vellum` command globally
|
|
13
|
-
npm i -g vellum-cli
|
|
14
|
+
npm i -g vellum-cli # npm
|
|
15
|
+
bun add -g vellum-cli # Bun
|
|
14
16
|
vellum push --help
|
|
15
17
|
```
|
|
16
18
|
|
|
17
|
-
Requires Node 18
|
|
18
|
-
so it has no runtime dependencies.
|
|
19
|
+
Requires Node 18+ (or Bun). The package is self-contained (`@vellum/core` is
|
|
20
|
+
bundled in), so it has no runtime dependencies.
|
|
19
21
|
|
|
20
22
|
## Authentication
|
|
21
23
|
|
|
@@ -53,7 +55,7 @@ then stores the token. `--no-browser` just prints the URL to open manually.
|
|
|
53
55
|
### `vellum push [file]`
|
|
54
56
|
|
|
55
57
|
Create an artifact from HTML. Reads from `<file>` if given, otherwise from
|
|
56
|
-
stdin. Pass `--page-id <
|
|
58
|
+
stdin. Pass `--page-id <PAGE_ID>` to append a new version to an existing page.
|
|
57
59
|
|
|
58
60
|
```bash
|
|
59
61
|
# new page from a file
|
|
@@ -63,11 +65,19 @@ vellum push artifact.html
|
|
|
63
65
|
echo '<!doctype html><h1>Hello</h1>' | vellum push
|
|
64
66
|
|
|
65
67
|
# add a version to an existing page, print raw JSON
|
|
66
|
-
vellum push artifact.html --page-id
|
|
68
|
+
vellum push artifact.html --page-id <PAGE_ID> --json
|
|
67
69
|
```
|
|
68
70
|
|
|
69
71
|
On success it prints the new version number, the human view URL, and the raw
|
|
70
|
-
URL. With `--json` it prints the server's `CreateVersionResponse` verbatim
|
|
72
|
+
URL. With `--json` it prints the server's `CreateVersionResponse` verbatim;
|
|
73
|
+
that response's `id` is the version id. The page id is the `pg_...` value in
|
|
74
|
+
the view URL (`/p/<PAGE_ID>`) or from `vellum list`.
|
|
75
|
+
|
|
76
|
+
### `vellum list`
|
|
77
|
+
|
|
78
|
+
List the artifacts owned by your logged-in identity. By default only live pages
|
|
79
|
+
are shown; pass `--archived` for archived-only or `--all` for both (archived
|
|
80
|
+
pages are marked `*`). `--json` prints the raw response.
|
|
71
81
|
|
|
72
82
|
### `vellum markup <page-id>`
|
|
73
83
|
|
|
@@ -77,15 +87,22 @@ the highlight. Without `--version`, the page's current version is used.
|
|
|
77
87
|
|
|
78
88
|
```bash
|
|
79
89
|
# anchor a note to a passage
|
|
80
|
-
vellum markup
|
|
90
|
+
vellum markup <PAGE_ID> --quote "Q3 dashboard" --body "tighten this headline"
|
|
81
91
|
|
|
82
92
|
# pipe the note in on stdin instead of --body
|
|
83
|
-
echo "tighten this headline" | vellum markup
|
|
93
|
+
echo "tighten this headline" | vellum markup <PAGE_ID> --quote "Q3 dashboard"
|
|
84
94
|
```
|
|
85
95
|
|
|
86
96
|
The CLI checks the quote is anchorable before posting; pass `--force` to post
|
|
87
97
|
anyway, or `--json` for the raw response.
|
|
88
98
|
|
|
99
|
+
### `vellum archive <page-id>` / `vellum unarchive <page-id>`
|
|
100
|
+
|
|
101
|
+
Archive hides a page from the gallery and makes it read-only; the bytes,
|
|
102
|
+
versions, comments, and URLs stay intact, but new versions and comments are
|
|
103
|
+
paused until you unarchive. Unarchive restores it to live. Page owner only.
|
|
104
|
+
`--json` prints the raw response.
|
|
105
|
+
|
|
89
106
|
### `vellum whoami`
|
|
90
107
|
|
|
91
108
|
Show the identity the CLI is authenticated as for a server.
|
|
@@ -94,6 +111,10 @@ Show the identity the CLI is authenticated as for a server.
|
|
|
94
111
|
|
|
95
112
|
Revoke this machine's stored token server-side and forget it locally.
|
|
96
113
|
|
|
114
|
+
### `vellum version`
|
|
115
|
+
|
|
116
|
+
Print the installed CLI version.
|
|
117
|
+
|
|
97
118
|
## Development
|
|
98
119
|
|
|
99
120
|
From the repo root, Bun runs the TypeScript source directly (no build):
|
package/dist/index.js
CHANGED
|
@@ -108,7 +108,8 @@ class VellumClient {
|
|
|
108
108
|
});
|
|
109
109
|
if (!res.ok)
|
|
110
110
|
await this.fail(res);
|
|
111
|
-
|
|
111
|
+
const body = await res.json();
|
|
112
|
+
return { ...body, created: res.status === 201 };
|
|
112
113
|
}
|
|
113
114
|
async getPage(pageId) {
|
|
114
115
|
const res = await this.fetchImpl(`${this.baseUrl}/v1/pages/${encodeURIComponent(pageId)}`, { headers: this.authHeaders() });
|
|
@@ -584,6 +585,10 @@ async function markupCommand(argv) {
|
|
|
584
585
|
// src/commands/push.ts
|
|
585
586
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
586
587
|
import { parseArgs as parseArgs6 } from "node:util";
|
|
588
|
+
function formatPush(res) {
|
|
589
|
+
const head = res.created ? `✓ v${res.version_number} created` : `↺ identical to v${res.version_number} — no new version`;
|
|
590
|
+
return [head, ` view: ${res.view_url}`, ` raw: ${res.raw_url}`];
|
|
591
|
+
}
|
|
587
592
|
var HELP5 = `vellum push — create a Vellum artifact from HTML
|
|
588
593
|
|
|
589
594
|
Usage:
|
|
@@ -630,16 +635,15 @@ async function pushCommand(argv) {
|
|
|
630
635
|
if (values.json) {
|
|
631
636
|
console.log(JSON.stringify(res, null, 2));
|
|
632
637
|
} else {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
console.log(` raw: ${res.raw_url}`);
|
|
638
|
+
for (const line of formatPush(res))
|
|
639
|
+
console.log(line);
|
|
636
640
|
}
|
|
637
641
|
return 0;
|
|
638
642
|
}
|
|
639
643
|
// package.json
|
|
640
644
|
var package_default = {
|
|
641
645
|
name: "vellum-cli",
|
|
642
|
-
version: "0.3.
|
|
646
|
+
version: "0.3.5",
|
|
643
647
|
description: "The vellum CLI — publish agent-authored HTML artifacts to a Vellum server.",
|
|
644
648
|
type: "module",
|
|
645
649
|
license: "MIT",
|