Command Line (CLI)
medialocker is the official command-line client for MediaLocker. It drives the same REST API documented here — buckets, media, search, tags, categories, sets, storyboards, usage, billing, and API keys — with the same organization-scoped credentials, and ships a local MCP server for AI agents.
- Package:
medialockeron npm - Source: github.com/medialocker/medialocker-cli (AGPL-3.0)
- Requires: Node.js ≥ 22
Install
npm install -g medialocker
# or run without installing
npx medialocker --helpQuickstart
# 1. Point at your MediaLocker (defaults to https://api.medialocker.io)
medialocker config set url https://api.medialocker.io
# 2. Authenticate with an API key secret — verifies against /me and saves it
medialocker login
# 3. Use it
medialocker buckets list
medialocker media upload ./hero.mp4 --bucket marketing --tag launch
medialocker media list --bucket marketing --kind videoUploads and downloads stream directly to and from object storage over presigned URLs — the API never touches your bytes, exactly like the presign → PUT → confirm flow. The CLI authenticates with an API key's Secret Access Key and honors its scopes, so a read-only key can list and download but not upload or delete.
Built for scripting
Add --json to any command for clean, pipeable output. Banners, spinners, and status notes go to stderr, so stdout stays pure JSON:
medialocker --json media list --bucket marketing | jq -r '.items[].key'What's here
| Page | Covers |
|---|---|
| Installation | Install, upgrade, and verify the CLI |
| Configuration & Auth | login, profiles, env vars, the config file |
| Command Reference | Every command group, global flags, exit codes |
| Uploading & Downloading | media upload/download, multipart, presigned URLs |
| MCP Server | Run the CLI as a local MCP server for AI agents |
See also
- API Reference — the REST endpoints each command calls
- Authentication — API keys, scopes, and bucket scope
- Presigned Uploads — the upload/download flow the CLI wraps