@certivu/cli 2.0.0 → 2.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/README.md +9 -6
- package/dist/index.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,10 +18,11 @@ certivu --version
|
|
|
18
18
|
# Save your API key
|
|
19
19
|
certivu config set api-key ctv_key_...
|
|
20
20
|
certivu config set generator-id your-generator-id
|
|
21
|
-
certivu config set private-key BASE64_PRIVATE_KEY
|
|
22
21
|
|
|
23
|
-
# Sign a file
|
|
22
|
+
# Sign a file — images, audio, or text; format auto-detected
|
|
24
23
|
certivu sign ./output.jpg --model stable-diffusion-xl
|
|
24
|
+
certivu sign ./podcast.wav --model whisper-v3
|
|
25
|
+
certivu sign ./report.pdf --model gpt-4o --format text
|
|
25
26
|
|
|
26
27
|
# Verify a file
|
|
27
28
|
certivu verify ./output.jpg
|
|
@@ -34,20 +35,23 @@ certivu status ctv_7f3kx9mq2...
|
|
|
34
35
|
|
|
35
36
|
### `certivu sign <file>`
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
Sign AI-generated content. Signing, watermarking, and ML-DSA are all server-side — no private key required locally. Accepts images (JPEG/PNG/WebP), audio (MP3/FLAC/WAV), and text (PDF/HTML/plain text). Format is auto-detected from magic bytes; use `--format` to override.
|
|
38
39
|
|
|
39
40
|
```
|
|
40
41
|
certivu sign ./output.jpg --model stable-diffusion-xl
|
|
41
42
|
✓ Signed
|
|
42
43
|
Token ctv_7f3kx9mq2...
|
|
43
44
|
Record ID rec-00000000-...
|
|
45
|
+
Format image
|
|
46
|
+
Output ./output.signed.jpg
|
|
44
47
|
```
|
|
45
48
|
|
|
46
49
|
| Flag | Description |
|
|
47
50
|
|------|-------------|
|
|
48
51
|
| `--model <name>` | AI model name — required |
|
|
52
|
+
| `--format <type>` | `image`, `audio`, or `text` — auto-detected if omitted |
|
|
49
53
|
| `--generator-id <id>` | Override generator ID |
|
|
50
|
-
| `--
|
|
54
|
+
| `--output <path>` | Output file path (default: `<input>.signed.<ext>`) |
|
|
51
55
|
| `--api-key <key>` | Override API key |
|
|
52
56
|
|
|
53
57
|
### `certivu verify <file>`
|
|
@@ -78,11 +82,10 @@ Look up a token without re-uploading the file.
|
|
|
78
82
|
```bash
|
|
79
83
|
certivu config set api-key ctv_key_abc123
|
|
80
84
|
certivu config set generator-id <uuid>
|
|
81
|
-
certivu config set private-key <base64>
|
|
82
85
|
certivu config get
|
|
83
86
|
```
|
|
84
87
|
|
|
85
|
-
Config is stored at `~/.config/certivu/config.json`. Environment variables (`CERTIVU_API_KEY`, `CERTIVU_GENERATOR_ID`, `
|
|
88
|
+
Config is stored at `~/.config/certivu/config.json`. Environment variables (`CERTIVU_API_KEY`, `CERTIVU_GENERATOR_ID`, `CERTIVU_BASE_URL`) override the config file.
|
|
86
89
|
|
|
87
90
|
## Requirements
|
|
88
91
|
|
package/dist/index.js
CHANGED
|
@@ -304,10 +304,11 @@ function inferFormat(filePath) {
|
|
|
304
304
|
if ([".jpg", ".jpeg", ".png", ".webp"].includes(ext)) return "image";
|
|
305
305
|
if ([".mp3", ".flac", ".wav", ".ogg", ".aac", ".m4a", ".aiff"].includes(ext)) return "audio";
|
|
306
306
|
if ([".pdf", ".docx", ".html", ".htm", ".txt", ".md"].includes(ext)) return "text";
|
|
307
|
+
if ([".mp4", ".mov", ".mkv", ".webm"].includes(ext)) return "video";
|
|
307
308
|
return void 0;
|
|
308
309
|
}
|
|
309
310
|
async function signCommand(filePath, flags) {
|
|
310
|
-
if (!filePath) die("Usage: certivu sign <file> --model <model> [--format image|audio|text]");
|
|
311
|
+
if (!filePath) die("Usage: certivu sign <file> --model <model> [--format image|audio|text|video]");
|
|
311
312
|
const config = await loadConfig();
|
|
312
313
|
const apiKey = flags.apiKey ?? config.apiKey;
|
|
313
314
|
const generatorId = flags.generatorId ?? config.generatorId;
|
|
@@ -328,7 +329,7 @@ async function signCommand(filePath, flags) {
|
|
|
328
329
|
const client = new CertivuClient(clientConfig);
|
|
329
330
|
let result;
|
|
330
331
|
try {
|
|
331
|
-
result = await client.sign({ content, model: flags.model, generatorId, format });
|
|
332
|
+
result = await client.sign({ content, model: flags.model, generatorId, ...format ? { format } : {} });
|
|
332
333
|
} catch (e) {
|
|
333
334
|
const msg = e instanceof Error ? e.message : String(e);
|
|
334
335
|
die(`Sign failed: ${msg}`);
|
|
@@ -445,7 +446,7 @@ ${bold("Commands:")}
|
|
|
445
446
|
|
|
446
447
|
${bold("Sign flags:")}
|
|
447
448
|
--model <name> AI model name, e.g. stable-diffusion-xl ${dim("(required)")}
|
|
448
|
-
--format <fmt> Content format: image | audio | text ${dim("(auto-detected if omitted)")}
|
|
449
|
+
--format <fmt> Content format: image | audio | text | video ${dim("(auto-detected if omitted)")}
|
|
449
450
|
--generator-id <id> Override generator ID
|
|
450
451
|
--private-key <key> Override ML-DSA private key (base64)
|
|
451
452
|
--api-key <key> Override API key
|