Skip to content

Command Reference

Every command maps to one or more REST API endpoints. Run medialocker <group> --help for the full, authoritative option list of any group. Uploads and the MCP server have their own pages — Uploading & Downloading and MCP Server.

Global flags

These work in any position (medialocker media list --json or medialocker --json media list):

FlagEffect
--jsonMachine-readable JSON on stdout; logs/spinners go to stderr
--profile <name>Use a specific config profile
--url <url>Override the API base URL
--api-key <key>Override the API key secret
--no-colorDisable colored output
--verboseExtra diagnostics on stderr

Exit codes

Failures map to script-friendly exit codes:

CodeMeaning
0Success
2Usage error (bad flags/arguments)
3Authentication error
4Network error
5Not found
1Generic error

Authentication

bash
medialocker login        # store an API key (interactive or --api-key)
medialocker whoami       # show the principal behind the current key
medialocker logout       # clear the active profile's key

See Configuration & Auth.

Buckets

CommandDoes
buckets listList buckets in the organization
buckets create <name>Create a bucket
buckets info <id>Show a bucket and its usage
buckets rm <id>Delete an empty bucket (--yes to skip confirm)

Media

CommandDoes
media listList objects (--bucket --kind --search --tag --category --sort --order --limit --offset)
media upload <file...>Upload files to a bucket — see Uploading
media download <id>Download an object to a file
media info <id>Show full object metadata
media rm <id>Delete an object (--yes)
media metadata <id> --set k=vSet object metadata key/values
media url <id>Print a presigned download URL
media thumbnail <id>Print a presigned thumbnail/poster URL
bash
medialocker search "drone shot" --kind video --tag launch --limit 20

Full-text and facet search across media — accepts the same filters as media list.

Tags

CommandDoes
tags listList tags
tags create <name>Create a tag
tags rm <id>Delete a tag (--yes)
tags set <objectId> --tags <ids>Replace an object's tags (by tag id)

Categories

CommandDoes
categories listList categories as a tree
categories create <name> [--parent <id>]Create a (nested) category
categories rm <id>Delete a category (--yes)
categories set <objectId> --categories <ids>Replace an object's categories

Sets

CommandDoes
sets listList sets
sets create <name> [--base <objectId>]Create a set
sets info <id>Show a set and its items
sets add-item <id> --object <objectId>Add an object to a set
sets rm-item <id> <itemId>Remove an item
sets generate <id>Generate derivative variants
sets rm <id>Delete a set (--yes)

Storyboards

CommandDoes
storyboards listList storyboards
storyboards create <name>Create a storyboard
storyboards info <id>Show a storyboard and its clips
storyboards add-clip <id> --object <objectId>Append a clip
storyboards reorder <id> --clips <ids>Reorder clips
storyboards update-clip <id> <clipId>Update a clip's position/note
storyboards rm-clip <id> <clipId>Remove a clip
storyboards rm <id>Delete a storyboard (--yes)

Usage

CommandDoes
usage showCurrent storage/request usage snapshot
usage history --days <n>Usage over time
usage eventsRecent usage events

Billing

CommandDoes
billing subscriptionShow the current subscription
billing portalGet a Stripe billing-portal URL
billing invoicesList recent invoices
billing plansList available plans (public)

API keys

CommandDoes
apikeys listList API keys (secrets are never shown)
apikeys create <name>Create a key (--scopes --bucket --expires-in) — the secret is shown once
apikeys revoke <id>Revoke a key (--yes)
apikeys rotate <id>Rotate a key's secret (shown once)

MCP

bash
medialocker mcp serve      # run as a local stdio MCP server
medialocker mcp install    # print/merge a client config block

See MCP Server.

Scripting with --json

bash
# Total bytes across a bucket
medialocker --json media list --bucket marketing --limit 1000 \
  | jq '[.items[].size | tonumber] | add'

# IDs of every video
medialocker --json search "" --kind video | jq -r '.items[].id'

Released under the AGPL-3.0 License.