@bigstrider/transcodes-cli 0.9.0 → 0.10.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.
Files changed (3) hide show
  1. package/README.md +32 -4
  2. package/dist/index.js +1143 -308
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -6,6 +6,28 @@ The plugins and their hooks authenticate to the Transcodes backend with a member
6
6
 
7
7
  ## Install
8
8
 
9
+ One line — no need to have `npm` (or even Node) already. The script installs
10
+ an LTS Node if it is missing, then puts `transcodes` on your PATH.
11
+
12
+ ```bash
13
+ # macOS / Linux
14
+ curl -fsSL https://raw.githubusercontent.com/transcodings/transcodes-guard/prod/cli/install.sh | bash && transcodes install
15
+ ```
16
+
17
+ ```powershell
18
+ # Windows (PowerShell)
19
+ irm https://raw.githubusercontent.com/transcodings/transcodes-guard/prod/cli/install.ps1 | iex; transcodes install
20
+ ```
21
+
22
+ > Windows: if script execution is blocked by policy, prefix it once (this only
23
+ > affects the current session):
24
+ >
25
+ > ```powershell
26
+ > Set-ExecutionPolicy Bypass -Scope Process -Force; irm https://raw.githubusercontent.com/transcodings/transcodes-guard/prod/cli/install.ps1 | iex
27
+ > ```
28
+
29
+ Already have Node ≥ 20? The plain npm route still works everywhere:
30
+
9
31
  ```bash
10
32
  # no install needed — opens the dashboard
11
33
  npx @bigstrider/transcodes-cli
@@ -15,13 +37,15 @@ npm install -g @bigstrider/transcodes-cli
15
37
  transcodes
16
38
  ```
17
39
 
18
- Works the same on macOS, Linux, and Windows (Node 20).
40
+ Node 20 is required (the CLI and the guard hooks both run on Node); the
41
+ bootstrap scripts above install it for you if needed.
19
42
 
20
43
  ## Commands
21
44
 
22
45
  | Command | What it does |
23
46
  |---------|--------------|
24
- | `transcodes` | Opens the local dashboard (URL printed in the terminal; default port 3847, increments if busy) to paste, save, switch, label, or delete tokens (accepts `--port N` / `--no-open`). |
47
+ | `transcodes` | Opens the local dashboard in the background (restarts daemon from this CLI binary; default port 3847; `--port N` / `--no-open`). Shell returns immediately. |
48
+ | `transcodes stop` | Stops the background dashboard daemon. |
25
49
  | `transcodes set <token> -l <label>` | Validates the JWT and saves it (label required) to `~/.transcodes/config.json` (dir `0700`, file `0600`), making it active. |
26
50
  | `transcodes tokens` | Lists all saved tokens; the active one is marked with `*`. |
27
51
  | `transcodes status` | Shows the active token source and its expiry. |
@@ -37,13 +61,17 @@ Command descriptions are defined once in `cli/src/commands.ts` (SSOT) and shared
37
61
 
38
62
  ```bash
39
63
  npx @bigstrider/transcodes-cli
64
+ # stop later:
65
+ npx @bigstrider/transcodes-cli stop
40
66
  ```
41
67
 
42
- Starts a small localhost server (127.0.0.1 only), opens your browser, and lets you save, switch, rename, or delete tokens without pasting them on the command line. Multiple tokens are kept in `~/.transcodes/config.json` under `token_list`, each with a label; the active one is stored as `token`.
68
+ Starts a small localhost server (127.0.0.1 only) as a **background daemon**, opens your browser, and returns the shell immediately. Each `transcodes` run restarts the daemon from the CLI binary you just invoked (so a local `npm run build` is picked up). Stop it with `transcodes stop`.
69
+
70
+ Multiple tokens are kept in `~/.transcodes/config.json` under `token_list`, each with a label; the active one is stored as `token`. Pid/log live under `~/.transcodes/state/dashboard.pid` and `dashboard.log`.
43
71
 
44
72
  Options:
45
73
 
46
- - `--port N` — bind to a specific port (default `3847`; increments if busy)
74
+ - `--port N` — prefer a specific port (default `3847`; increments if busy)
47
75
  - `--no-open` — do not open the browser automatically
48
76
 
49
77
  ## Token precedence