smartvedit-cli
v0.1.2
Published
kubectl-style CLI for smartvedit — auto-edit your videos (trim pauses, captions, level, remaster, highlights) from the terminal.
Maintainers
Readme
smartvedit-cli
kubectl-style command line interface for smartvedit. Submit auto-editing jobs (trim pauses, captions, level, remaster, highlights), watch them to completion, chain them into pipelines, and manage your video library — all from the terminal.
Install
Global:
npm install -g smartvedit-cli
smartvedit --helpOne-off via npx:
npx smartvedit-cli --helpRequires Node.js >= 18.17.
Quickstart
# 1. sign in (opens https://smartvedit.com/cli-login in your browser)
smartvedit login
# 2. list your jobs
smartvedit get jobs
# 3. submit an action against your most recent analyze job
smartvedit create trim-pauses --source --latest ok --wait
# 4. inspect what got produced
smartvedit get videosHow login works
smartvedit login uses a browser loopback handshake — no Firebase SDK
is shipped inside the CLI, so the published npm tarball stays small and
rotating Firebase keys never requires a new release.
- The CLI spins up a one-shot HTTP server on a random free port on
127.0.0.1, with a fresh per-run CSRFstate. - It opens
https://smartvedit.com/cli-login?port=<p>&state=<s>in your browser. - The page signs you in with Google (via the same Firebase Web SDK
the consumer UI already uses), exchanges the Firebase ID token for
the app JWT, then POSTs
{jwt, state}back to the CLI's loopback. - The CLI verifies the
state, writes the JWT to disk (mode0600), and exits.
Typical round-trip is ~30 seconds. If you're testing against a
non-production UI, set CLI_UI_BASE to point at it (e.g.
CLI_UI_BASE=http://localhost:5173 smartvedit login).
Commands
| Command | Description |
|---|---|
| smartvedit login | Firebase Google sign-in (opens a browser tab). |
| smartvedit login-password [user] [pass] | Username + password fallback. Prompts if missing. |
| smartvedit logout | Forget the cached token. |
| smartvedit whoami | Print the signed-in user (GET /me). |
| smartvedit get jobs [--status <s>] [-o json\|table] | List all jobs. |
| smartvedit get job <id\|--latest [status]> [-o json\|table] | Show one job. |
| smartvedit get videos [-o json\|table] | List rendered videos. |
| smartvedit describe job <id\|--latest> | Full job + result JSON. |
| smartvedit watch job <id\|--latest> | Poll until terminal; prints status transitions. |
| smartvedit delete job\|video <id\|--latest> | Cancel-then-delete (kubectl-style). |
| smartvedit create trim-pauses --source <ref> [--min-pause N] [--wait] | Cut dead air. |
| smartvedit create captions --source <ref> [--font-size N] [--position top\|bottom] [--max-chars N] [--wait] | Auto-transcribe + burn subtitles. |
| smartvedit create level --source <ref> [--target-i N] [--target-tp N] [--target-lra N] [--wait] | Loudness normalise (~-14 LUFS). |
| smartvedit create remaster --source <ref> [--wait] | Real-ESRGAN upscale + face restore. |
| smartvedit create highlights --source <ref> [--preset reel\|quotes] [--wait] | Content-aware highlight reel. |
| smartvedit create pipeline --source <ref> --steps a,b,c [--no-wait-final] | Chain several actions; each step's output feeds the next. |
Referencing jobs
You almost never have to type a job id. Anywhere a job ref is expected,
pass --latest (the most recent job) or --latest <status> (the most
recent job in that status, e.g. --latest ok).
smartvedit watch job --latest
smartvedit create captions --source --latest ok --wait
smartvedit delete job --latest error--wait semantics
--wait blocks until the job reaches a terminal state, printing status
transitions to stderr. Ctrl-C during a wait cancels the in-flight job
(DELETE /me/videos/:id, kubectl-style cancel-by-delete) and exits 130.
Pipelines
Chain actions together with create pipeline. Each step submits a fresh
job against the previous step's output, waits for terminal status, and
moves on. If any step fails, the pipeline halts and exits non-zero.
# trim pauses, then auto-caption the result
smartvedit create pipeline \
--source --latest ok \
--steps trim_pauses,captions
# full polish: trim → level → captions, then build a highlights reel
smartvedit create pipeline \
--source <analyze_id> \
--steps trim_pauses,level,captions,highlights:reelValid steps: trim_pauses, captions, level, remaster,
highlights (alias for highlights:reel), highlights:reel,
highlights:quotes.
By default the last step also waits — pass --no-wait-final to
fire-and-forget the final stage.
Configuration
Environment variables:
| Var | Default | Purpose |
|---|---|---|
| API_BASE | https://api.smartvedit.com | API base URL. |
| CLI_UI_BASE | https://smartvedit.com | UI base URL used by smartvedit login (the loopback handshake opens ${CLI_UI_BASE}/cli-login). Override for staging / local dev. |
| SMARTVEDIT_TOKEN | unset | Override the cached JWT (e.g. in CI). |
| SMARTVEDIT_TOKEN_FILE | $XDG_CONFIG_HOME/smartvedit/token (fallback ~/.config/smartvedit/token) | Token cache path. Legacy ~/.smartvedit-token is auto-migrated on first run. |
Programmatic use
import { apiGet, apiPost, type JobDetail } from "smartvedit-cli";
const detail = await apiGet<JobDetail>(`/jobs/${id}`);Releasing
Releases ship from the publish-cli.yml
GitHub Actions workflow — manually triggered, npm OIDC trusted
publishing (no NPM_TOKEN secret), provenance attestation generated
automatically, paired GitHub Release with auto-generated notes.
One-time setup on npmjs.com (done once for smartvedit-cli):
- Go to https://www.npmjs.com/package/smartvedit-cli/access → "Trusted Publisher" → "Add Trusted Publisher (GitHub Actions)"
- Owner:
deemwar-products, Repository:video-ai, Workflow:publish-cli.yml. Leave Environment blank.
Cut a release:
# patch bump (0.1.0 → 0.1.1)
gh workflow run publish-cli.yml -f bump=patch
# minor / major bumps
gh workflow run publish-cli.yml -f bump=minor
gh workflow run publish-cli.yml -f bump=major
# dry-run rehearsal (no publish, no commit, no release)
gh workflow run publish-cli.yml -f bump=patch -f dry_run=true
# publish the version already in package.json without bumping
gh workflow run publish-cli.yml -f bump=noneThe workflow runs prepublishOnly first (typecheck + lint + test +
build), then bumps package.json + src/version.ts, commits with
[skip ci], tags cli-v<version>, pushes to main, publishes with
--provenance, and creates a GH Release.
License
MIT
