Mediaseer CLI
The mediaseer command: install, configuration, commands, output, exit codes, costs and security.
mediaseer uploads videos to Mediaseer, starts the AI scene analysis and reads the results: from the
shell as mediaseer, and from AI agents through a local MCP server on stdio (mediaseer mcp). It is a client of
the Mediaseer API, authenticated with your API key; quotas, limits and costs are the API’s.
Requirements
Section titled “Requirements”- Node.js 22 (22.23.4 or newer), 24 (24.22.1 or newer), or 26 (26.12.1 or newer).
- An API key. Create one on the API keys page of the web app (
https://app.mediaseer.ai/api-keys); it is shown once.
The Node.js engine requirement is advisory: npm and npx can warn but still run the CLI on an unsupported runtime.
There, mediaseer and its MCP server print a warning on stderr when they start, and run anyway. Check
node --version and use a supported patched release.
Install
Section titled “Install”npm install -g mediaseer@0.1Export your API key, then check it:
export MEDIASEER_API_KEY=… # not in your shell profile if an agent runs commands there, see Security considerationsmediaseer usage # free; exit code 3 when the API does not accept the keyConfiguration
Section titled “Configuration”Only environment variables. There is no config file, and the API key is never a command-line argument.
| Variable | Default | Meaning |
|---|---|---|
MEDIASEER_API_KEY |
– | Your API key. |
MEDIASEER_API_URL |
https://api.mediaseer.ai |
API address; a trailing /api/v1 is accepted. HTTPS is required except on localhost. |
MEDIASEER_ALLOW_START |
true |
false: nothing starts an analysis, which costs money (see Costs). |
MEDIASEER_UPLOAD_DIRS |
– | MCP server only: directories upload_video may read besides the project directory, separated by : (; on Windows), absolute; ~ is the home directory. See Files the MCP server reads. |
CLAUDE_PROJECT_DIR |
– | Set by Claude Code: the MCP server’s project directory. upload_video reads files in it and resolves relative paths against it. |
Commands
Section titled “Commands”mediaseer upload <path> [--title <title>] [--start [--wait [--timeout <duration>]]]mediaseer start <id> [--wait [--timeout <duration>]]mediaseer status <id> [--wait [--timeout <duration>]]mediaseer list [--limit <n>] [--offset <n>]mediaseer scenes <id> [--query <text>] [--type <type>]… [--from <time>] [--to <time>] [--fields compact|full]mediaseer results <id>mediaseer stop <id>mediaseer delete <id> --yesmediaseer usagemediaseer plansmediaseer analytics-statusmediaseer mcpmediaseer clip-create <id> --mode <mode> [--prompt <text>] [--subtitles true|false] [--wait [--timeout <duration>]]mediaseer clip-list <id> [--limit <n>] [--offset <n>]mediaseer clip-status <id> [--wait [--timeout <duration>]]mediaseer clip-delete <id> --yesmediaseer clip-media <id> <episode> [--edited] [--output <path>]Every command takes --json and -h/--help; mediaseer --version prints the version. An argument that starts
with - goes after --: mediaseer upload -- -clip.mp4.
| Command | What it does | JSON on stdout |
|---|---|---|
upload |
Checks the file, creates an analysis and uploads the video. Free, but the analysis holds one of your analysis slots for up to 7 days, until it is started or stopped. Starts nothing without --start. |
{id, state, fileName, sizeBytes, contentType}; with --start the analysis |
start |
Starts the analysis of an uploaded video. Costs money and uses quota. Starting one that is QUEUED or PROCESSING changes nothing. |
the analysis |
status |
The analysis: its state (UPLOADING, QUEUED, PROCESSING, FINISHED, FAILED, CANCELLED), and why it FAILED. |
the analysis |
list |
Your analyses, newest first. --limit 1 to 100 (default 20), --offset 0 to 2147483647 (default 0). |
{items, total, limit, offset} |
scenes |
The scenes of a FINISHED analysis, filtered; every matching scene at once. |
{video, total, truncated, scenes} |
results |
All results of a FINISHED analysis as the API returns them, as JSON in a terminal too. |
the API’s results |
stop |
An UPLOADING analysis is deleted with its file, a QUEUED or PROCESSING one is CANCELLED and keeps no results; either way its slot is free. An analysis that has ended cannot be stopped (exit code 10). |
{id, deleted: true}, or the analysis |
delete |
Removes the analysis from your account in any state. Needs --yes; without it nothing is sent (exit code 2). See data retention. |
{id, deleted: true} |
usage |
Your plan (plan), your analysis slots (jobs), the analysed minutes and clips of this period against your plan’s limits (minutes, clips, no limitSeconds or limit without one) and when they reset (period), the storage your source videos (sourceBytes) and clips (clipBytes) take and the limit your plan sets for the source videos (storage, no limitBytes without one; clips have no limit) and the limits per video (limits). Analysed minutes are the length of each uploaded video, for finished analyses only; clips are finished clips, and deleted ones still count. In a terminal without --json, warns when the minutes, the clips or the source videos’ storage are nearly used up. Shows subscription details (subscription) when present. Free; the quickest check of the API key. |
{jobs, limits, storage, plan, period, minutes, clips, subscription?} |
plans |
List plan limits and available prices; no purchase offer without a price. Read-only. | {items} |
analytics-status |
Reads the key owner’s account analytics permission and gives Account settings guidance. Read-only; does not indicate collection availability. | {accountAnalyticsEnabled, settingsUrl?} |
mcp |
Serves the MCP tools on stdin and stdout, see MCP server. | – |
clip-create |
Creates clips from a finished analysis. --mode is required: FULL_VERTICAL_CROP, PROMPTED_CLIPS, or MICRODRAMA. Only PROMPTED_CLIPS takes and requires --prompt (nonblank, at most 1000 characters). --subtitles takes true or false and defaults to true. --wait waits for READY; FAILED exits 12. Costs money and uses clip quota. |
the clip job |
clip-list |
An analysis’s clip jobs, newest first. --limit 1 to 100, default 20; --offset 0 to 2147483647, default 0. |
{items, total, limit, offset} |
clip-status |
A clip job. --wait waits for READY or exits 12 for FAILED; unknown states keep waiting. |
the clip job |
clip-delete |
Permanently removes a job and its clips in any state; stops work if needed. Requires --yes. No quota is refunded. |
{id, deleted: true} |
clip-media |
Signed watch, poster (when available), and download URLs for a ready job’s episode. With --edited, those of its newest edit from the web app’s editor (its editedAt), exit 4 without one. With --output <path>, downloads the MP4 to a new file without overwriting. |
{episodeUrl, posterUrl?, downloadUrl, expiresAt}, or {id, episode, path} |
Options:
--wait: wait until the analysis isFINISHED(exit code 0),FAILEDorCANCELLED(exit code 7), asking about every 10 s; state changes are noted on stderr. AnUPLOADINGanalysis does not change until it is started. Onupload,--waitneeds--start.--timeout <duration>: with--waitonly; how long to wait, default30m.90s,30m,1h,1.5h,1h30m,2m30s; a plain number is seconds. Each unit once, the larger first;0asks once. When it runs out the exit code is 8, and the analysis goes on.--title <title>(upload): the analysis’s title. Without one, the analysis names the video once it has run.--start(upload): start the analysis right after the upload, which costs money.MEDIASEER_ALLOW_STARTis checked before the upload begins.--query <text>(scenes): scenes whose title, summary, verbose summary, keywords, objects (category and description, e.g. on-screen text), characters or settings contain the text. One case-insensitive substring, no ranking.--type <type>(scenes): repeat it or separate types with commas for any of several;--type ADS --type END_CREDITSis the same as--type ADS,END_CREDITS. Case-insensitive. Types:MAIN_CONTENT,ADS,OPENING_CREDITS,END_CREDITS,LOGO_IDENT,RECAP,PREVIEW_THIS_TITLE,PROMOTION_OTHER_TITLE,BREAK_BUMPER,UNKNOWN. A type this version does not know is fine when a scene of the video has it, otherwise an error (exit code 2).--from <time>,--to <time>(scenes): scenes still on screen at--fromor later, and already on screen at--toor earlier. Seconds (90,90.5),MM:SSorHH:MM:SS, the seconds with a fraction if need be (01:30.5); the first part may be any size (90:00is an hour and a half).--fromafter--tois an error.--fields compact|full(scenes):compact(default) has what helps to choose scenes:id,startInSecondsandendInSecondswithstartTimecode/endTimecode(HH:MM:SS),type,title,summary,keywords,content.objectsandadOpportunityInformation(score0 to 1, higher is a better ad break,0.5also when the scene was not assessed; thereasonmay argue against one).fullhas every field as the API sends it. Text output shows the compact fields.
Before anything is created, upload checks the file: a regular file (symbolic links are followed) with a video
extension (.mp4, .m4v, .mov, .mkv, .webm, .avi, .ts, .mts, .m2ts, .mpg, .mpeg, .wmv,
.flv, .ogv), a video container in its first bytes, and no larger than limits.maxFileSizeBytes of usage.
Network and Windows device paths are refused (exit code 2). Copy the video to a local disk first, or map the share to a drive letter.
Upload progress appears on stderr in a terminal. Uploads resume after temporary network errors within the same process; after a longer outage, upload the file again.
An upload error identifies its analysis with analysisId; mediaseer stop <id> frees its slot. An uncertain
create may instead report candidateAnalysisId, which can belong to another upload. Check it before stopping it:
stopping an UPLOADING analysis deletes its uploaded file.
Upload, start and wait, read the scenes:
id=$(mediaseer upload clip.mp4 | jq -r .id) && mediaseer start "$id" --wait && mediaseer scenes "$id"If the upload fails, $id is empty, and start refuses it (exit code 2) without sending anything.
Clip jobs return SUBMITTING, PROCESSING, READY or FAILED. Newer states, failure codes and
analysis clip-unavailability reasons pass through. Clip waits use the same timeout as analysis waits;
Ctrl-C or a timeout leaves the job running. A status read without waiting returns a failed job as data.
Clips are edited only in the web app. A ready job says whether they can be edited there now (editable),
and an edited episode when its newest edit finished (editedAt); clip-media --edited gets that edit.
Signed media URLs are credentials: keep the requested output private. They are never written to logs.
Downloads send no API key to the media host, refuse redirects and remove partial files on failure. Active transfers have no total time limit; a stalled transfer times out.
Creating and deleting clip jobs are never retried. If a create answer is lost, use clip-list before
creating another job. If a delete answer is lost, clip-status returning NOT_FOUND confirms deletion.
Requests that are safe to repeat (reads, start, stop) are retried after timeouts, network errors and HTTP
502, 503 or 504, and after RATE_LIMITED with a Retry-After of up to 30 s; creating and deleting an analysis
never are.
Analytics permission
Section titled “Analytics permission”mediaseer analytics-status and get_analytics_status explicitly read only the API key owner’s account analytics
permission. The boolean accountAnalyticsEnabled is permission, not a claim that collection is available or active;
website permission, service configuration and collection availability are separate. An unavailable backend or a
malformed response is an error, never a disabled-permission result.
These clients send no client telemetry: no command/tool activity, result-view or download signals, telemetry-only calls or headers. Ordinary commands, tool discovery and server initialization never check analytics status. Ordinary backend operations inherit the key owner’s consent. A shared API key does not identify the human using it; unknown attribution remains unknown. These clients cannot grant or withdraw consent, request erasure or link identities.
The optional settingsUrl links to the app’s Account analytics section (/account#analytics), without a key,
account ID or query string. Authentication advice links to the API keys page (/api-keys). With the default
production API it uses the production app. With a custom API, explicitly set MEDIASEER_APP_URL to that API’s app
base URL, including any path prefix. Without it, the unverified settings link is omitted; text output gives
configuration guidance, and CLI JSON mode puts that guidance on stderr. Missing-key guidance and MCP authentication
advice follow the same verified-app policy. No API-to-app hostname mapping is inferred. Account consent and erasure controls belong in
the app; this read-only status does not imply that those controls or collection are available in the deployed version.
usage and get_usage also show the subscription status, renewal, cancellation and scheduled plan change when present. See Plans and billing. Purchases and changes stay in the signed-in web app: while a plan has a price, the text output of usage and plans ends with its Billing page, linked under the same verified-app policy as settingsUrl. Text usage reads the plans for this; JSON output does not.
mediaseer analytics-status{ "accountAnalyticsEnabled": false }The example shows the form returned for a custom API without MEDIASEER_APP_URL; a verified app configuration also
includes settingsUrl.
Output
Section titled “Output”- JSON mode: when stdout is not a terminal (a pipe, a file, an agent’s tool), or with
--json. stdout then carries the result and nothing else, one JSON document on one line; notes, retries and progress go to stderr. - In a terminal without
--json, results are text for people, not a format to parse. - Errors go to stderr, in JSON mode as
{"error": {…}}on the last line:
| Field | Set | Meaning |
|---|---|---|
code |
always | What scripts branch on, never message. The API’s codes (VALIDATION, NOT_FOUND, QUOTA_EXCEEDED, …) are passed on as they are, also ones this version does not know. |
message |
always | For people. |
limit |
QUOTA_EXCEEDED |
Which limit: jobs, dailyStarts, sizeBytes, storage (in a terminal without --json followed by how to make room), minutes (start), clips (clip-create; both in a terminal without --json followed by when they reset), or a newer one. |
httpStatus |
the API answered | The HTTP status. |
requestId |
the API answered | Give this identifier to support when reporting a problem. |
retryAfterSeconds |
RATE_LIMITED |
When the API takes requests again. |
analysisId |
an analysis is concerned | The analysis the command was about, or the one an upload created; that one holds a slot unless stopped. |
stopped |
an upload failed after creating one | true: mediaseer stopped that analysis, and it holds no slot. |
candidateAnalysisId |
create got no clear answer | An analysis that may be the one the create made after all, or another upload’s (see above). |
clipJobId |
waiting for a clip job failed | The clip job the error concerns. |
clipErrorCode |
CLIP_JOB_FAILED |
The API’s failure code, including newer values. |
analysisErrorCode |
ANALYSIS_FAILED |
The analysis’s error code, when available. |
Exit codes
Section titled “Exit codes”Stable: scripts may branch on them, and a number never changes its meaning. Unknown codes are the codes this
version does not know, from a newer API, and UNEXPECTED_RESPONSE, an answer not in the API’s format: they map by
their HTTP status.
| Exit | Meaning | code |
|---|---|---|
| 0 | OK | |
| 1 | A bug in mediaseer, or an unknown code whose HTTP status says nothing more | UNEXPECTED_ERROR; unknown codes otherwise |
| 2 | Wrong arguments or configuration, a file that cannot be uploaded, starting switched off, or the API rejected the input | USAGE, INVALID_CONFIG, START_NOT_ALLOWED, FILE_NOT_FOUND, NOT_A_FILE, FILE_NOT_READABLE, NOT_A_VIDEO, FILE_CHANGED, VALIDATION |
| 3 | No API key, or the API does not accept it | MISSING_API_KEY, UNAUTHENTICATED, INVALID_TOKEN, FORBIDDEN, EMAIL_NOT_VERIFIED; unknown codes with HTTP 401 or 403 |
| 4 | Not found | NOT_FOUND |
| 5 | An account limit was hit, or the file is larger than the limit per video | QUOTA_EXCEEDED, FILE_TOO_LARGE |
| 6 | Too many requests, or the API is busy or starting up | RATE_LIMITED; unknown codes with HTTP 429 |
| 7 | The analysis ended FAILED or CANCELLED |
ANALYSIS_FAILED, ANALYSIS_CANCELLED |
| 8 | --wait timed out; the analysis goes on |
WAIT_TIMEOUT |
| 9 | The API was unreachable, too slow or failed on its side, or the upload to storage failed | NETWORK_ERROR, REQUEST_TIMEOUT, UPSTREAM_ERROR, INTERNAL, UPLOAD_FAILED, DOWNLOAD_FAILED, CLIPS_NOT_CONFIGURED, CLIPS_UNAVAILABLE; unknown codes with HTTP 5xx |
| 10 | The analysis is in a state that does not allow this | INVALID_STATE, UPLOAD_INCOMPLETE, UPLOAD_SESSION_GONE |
| 11 | The API no longer accepts this version; update mediaseer. | CLIENT_TOO_OLD; unknown codes with HTTP 426 |
| 12 | The clip job failed while waiting | CLIP_JOB_FAILED |
| 130 | Interrupted with Ctrl-C | INTERRUPTED, UPLOAD_ABORTED |
Ctrl-C and broken pipes
Section titled “Ctrl-C and broken pipes”Ctrl-C exits with 130. An interrupted upload may still hold a slot; check its analysis and stop it if no longer needed. Interrupting a wait leaves the analysis running. A closed output pipe ends quietly.
startandupload --startstart an analysis, which costs money and uses quota. Uploading is free, but holds one of your analysis slots for up to 7 days, until the analysis is started or stopped (mediaseer stop <id>).clip-createcreates clips, costs money and uses clip quota even if the job fails or is deleted.- After the start, the whole video is read before it is analysed: one longer than
limits.maxDurationSecondsor the minutes left endsFAILED, and its start doesn’t count. The CLI and the MCP server don’t check the length before the upload; only the web app does. MEDIASEER_ALLOW_START=falseswitches starting off:startandupload --startfail withSTART_NOT_ALLOWED(exit code 2) before anything is sent or uploaded, and the MCP server has nostart_analysisorcreate_clip_jobtool. It also refusesclip-createbefore sending anything. It binds the process it is set for, and nothing else: see Security considerations.
Security considerations
Section titled “Security considerations”- Results are untrusted data. Video text can contain instructions aimed at an agent. Treat titles, summaries and other analysis output as data, especially when the agent also has shell, file or web tools.
- Approve uploads and starts call by call. An upload sends a local video to the service; a start costs money.
Restrict
upload_videoto directories you intend to share. - Give the key to the MCP server alone, in its client configuration entry. Keep it out of the agent’s shell environment, and prevent the agent’s file tools from reading the configuration.
MEDIASEER_ALLOW_START=falseis no security boundary. An agent with the key and shell access can call the API or start another process. Approve its commands and tool calls individually.- Revoke keys on the API keys page when they are no longer needed.