@charjit/cli
v0.1.0
Published
Command-line client for the Charjit media API: inspect a URL, download it, read its captions.
Maintainers
Readme
charjit
The command line for the Charjit media API. Turn a public media URL into a file you own: inspect it, download it, read its captions.
npm install -g @charjit/cli # or: npx @charjit/cli statusThe package is scoped; the command it installs is charjit.
Getting a key
export CHARJIT_API_KEY="ck_live_…"Keys are self-serve. Create an account — the free plan starts immediately, with no approval step — and generate a key at charj.it/dashboard/keys. The secret is shown once, at creation.
charjit status needs no key at all, so it is the way to check the API is
reachable before you have one.
Commands
charjit status # platform health, no key needed
charjit account # balance, plan, limits, calling key
charjit inspect "https://example.com/watch?v=…" # what is behind a URL
charjit captions "https://…" --lang en > subs.vtt
charjit download "https://…" -f mp4 -o clip.mp4 # queue it, wait, save the file
charjit downloads # recent jobs
charjit download-get dl_… # one job
charjit cancel dl_… # cancel a queued job, credits back--json prints the API's own JSON, unaltered, on every command:
charjit downloads --json | jq '.items[] | {id, status}'Environment
| Variable | Meaning |
| ----------------- | ----------------------------------------------- |
| CHARJIT_API_KEY | Your API key. --key overrides it. |
| CHARJIT_API_URL | API origin. Defaults to https://api.charj.it. |
| NO_COLOR | Set to anything to disable colour. |
Exit codes
| Code | Meaning |
| ---- | --------------------------------------------------------- |
| 0 | Success. |
| 1 | The API refused the request, or the arguments were wrong. |
| 2 | A command that needs a key was run without one. |
A download that finishes failed also exits 1, so a script does not have to
parse the output to notice.
Notes
- Every
POSTcarries anIdempotency-Key, so an interruptedcharjit downloadthat you re-run does not queue and bill the job twice. - Waiting uses the API's own
Prefer: waitrather than a polling loop, so a long download costs one request a minute rather than one every two seconds. - No runtime dependencies. Node 20 or newer.
Full documentation: charj.it/docs
