Skip to content

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.

Install

bash
npm install -g medialocker
# or run without installing
npx medialocker --help

Quickstart

bash
# 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 video

Uploads 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:

bash
medialocker --json media list --bucket marketing | jq -r '.items[].key'

What's here

PageCovers
InstallationInstall, upgrade, and verify the CLI
Configuration & Authlogin, profiles, env vars, the config file
Command ReferenceEvery command group, global flags, exit codes
Uploading & Downloadingmedia upload/download, multipart, presigned URLs
MCP ServerRun the CLI as a local MCP server for AI agents

See also

Released under the AGPL-3.0 License.