@facelessad/cli 1.1.0 → 1.1.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.
Files changed (3) hide show
  1. package/README.md +18 -0
  2. package/index.js +13 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -27,6 +27,24 @@ stops on it immediately instead of polling forever. For long-running
27
27
  builds a webhook is still the better tool — a stuck shell is a stuck CI
28
28
  job. See https://facelessad.com/developers → Webhooks.
29
29
 
30
+ ## Getting the finished video
31
+
32
+ `--wait` tells you when the video is done, but it never prints the video URL.
33
+ Three ways to get the file:
34
+
35
+ ```bash
36
+ facelessad download 103 --out ad.mp4 # saves into the CURRENT directory
37
+ facelessad status 103 --json | jq -r .url # the raw link, valid ~1 hour
38
+ ```
39
+
40
+ The third is the browser: every video made through the CLI also appears in My
41
+ Files at facelessad.com.
42
+
43
+ Since 1.1.1 `download` prints the full path and the file size, and fails
44
+ loudly on an empty file instead of reporting success. The link is signed and
45
+ expires in about an hour — the video itself does not, so ask for the status
46
+ again to get a fresh one.
47
+
30
48
  ## Custom style (1.1.0)
31
49
 
32
50
  Most tools accept a look of your own instead of one of the built-in styles.
package/index.js CHANGED
@@ -382,8 +382,18 @@ const commands = {
382
382
  const file = String(flags.out || ('facelessad-' + id + '.mp4'));
383
383
  const res = await fetch(d.url);
384
384
  if (!res.ok) die('Download failed: HTTP ' + res.status, 'download_failed');
385
- fs.writeFileSync(file, Buffer.from(await res.arrayBuffer()));
386
- out({ ok: true, file }, 'Saved ' + file);
385
+ const buf = Buffer.from(await res.arrayBuffer());
386
+ // 1.1.1: tyhjä tiedosto tulosti ennen saman "Saved" kuin onnistunut lataus.
387
+ if (!buf.length) die('Download produced an empty file — the link may have expired. Run `facelessad status ' + id + '` and try again.', 'empty_download');
388
+ fs.writeFileSync(file, buf);
389
+ // 1.1.1: pelkkä tiedostonimi ei kertonut MIHIN tallennettiin. Tiedosto
390
+ // menee työhakemistoon, ei Downloadsiin, ja käyttäjä jäi etsimään sitä
391
+ // (omistajan raportti 12.8.2026). Absoluuttinen polku ja koko ääneen.
392
+ const full = path.resolve(file);
393
+ const mb = buf.length / (1024 * 1024);
394
+ const size = mb >= 1 ? mb.toFixed(1) + ' MB' : Math.max(1, Math.round(buf.length / 1024)) + ' kB';
395
+ out({ ok: true, file, path: full, bytes: buf.length },
396
+ 'Saved ' + full + dim(' (' + size + ')'));
387
397
  },
388
398
 
389
399
  async help() {
@@ -399,7 +409,7 @@ Commands:
399
409
  create --tool <id> ... Create a video (returns an id immediately)
400
410
  status <id> [--wait] Status; --wait polls until done
401
411
  list [--limit --offset] Your videos, newest first
402
- download <id> [--out file] Save the finished mp4
412
+ download <id> [--out file] Save the finished mp4 into the current directory
403
413
 
404
414
  Create flags:
405
415
  --tool --url --text --duration --aspect --language --style --style-hint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@facelessad/cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Create faceless video ads from your terminal or build scripts — the FacelessAd command line.",
5
5
  "license": "MIT",
6
6
  "type": "module",