Skip to main content

emby-cli

PyPI · License: CC BY-NC 4.0

Search, browse, play, and download media from your Emby server — from the terminal. Only HTTP access to the server is needed (typically port 8096). No SSH, no shared folders, no rsync.

pip install emby-cli

Quick start

1. Log in once (username + password, or an API key):

emby-cli login --server http://emby:8096 --username you
# prompted for password if not set

Your session is saved locally. Later commands reuse it, so you usually do not need to pass --server again.

2. Check the connection:

emby-cli info

3. Search and play:

emby-cli search --item "matrix"
emby-cli play --item "matrix (1999)" --pick-best-item

Use emby-cli help for the command list, and emby-cli <command> -h for options.


Everyday use

Server info

emby-cli version    # CLI version (and Emby version when connected)
emby-cli info       # user, server, library count, content totals

Search

Find movies, episodes, and other media — or list libraries:

emby-cli search --item "fast and furious"
emby-cli search --item "fast and furious" --count 5
emby-cli search --item --id 123456
emby-cli search --library "peliculas"
emby-cli search --library --all

--item and --library accept the search text directly. You can also pass --id when you already know the Emby ID.

Show details

Inspect one title or one library by Emby ID (use search first if you need to find the ID):

emby-cli show --item --id 123456
emby-cli show --library --id 614156

Play

Open a title in an external player (VLC, mpv, IINA, …):

emby-cli play --item "matrix (1999)" --pick-best-item
emby-cli play --id 123456
emby-cli play --id 111,222,333
emby-cli play --id 123456 --player vlc --wait

Set EMBY_PLAYER if the player is not found automatically. A comma-separated list of IDs works for play --id and download --item --id (not for show / search).

Download

Download a single title, a whole library, or a list of titles from a file:

emby-cli download --item --id 123456
emby-cli download --item --id 111,222,333
emby-cli download --item "breaking bad S01E01" --pick-best-item
emby-cli download --library "peliculas 4k"
emby-cli download --from-file titles.txt

A comma-separated list of IDs (a,b,c) is supported for download --item --id and play --id. show and search accept a single --id each.

Useful options:

Option Meaning
-n / --dry-run Resolve titles only — do not write files
-o / --output Output folder (default ./downloads)
-f / --force Re-download even if a matching local file exists
--pick-best-item When several versions match, pick the best ≤1080p
-m download|stream|hls How to fetch the file (see below)

Title lines in --item / --from-file can look like:

  • Movie (2010)
  • Show S01E05
  • Show S01 — whole season

By default, matching is strict: a wrong year or several ambiguous results stops with a table of candidates. Add --pick-best-item to choose automatically (best quality up to 1080p).

Library downloads match the library name (case-insensitive, unique match required).


Logging in and switching servers

Approach When to use
emby-cli login Recommended — saves a session and remembers the server
API key --api-key / EMBY_API_KEY (keys are not stored by login)
Flags / env --server, --username, --password or EMBY_* for one-off use

Manage saved servers:

emby-cli config get-servers
emby-cli config current-server
emby-cli config use-server 'you@http://emby:8096'
emby-cli config view          # tokens redacted
emby-cli logout               # revoke and forget the current session

Sessions live under ~/.cache/emby-cli/auth.json (override with EMBY_CACHE_DIR). Set EMBY_NO_AUTH_CACHE=1 to never read or write the cache.


Download methods

Choose with -m / EMBY_METHOD:

Method Best for
download (default) Normal file download from Emby
stream Direct stream URL (similar to Emby Web)
hls HLS remux to .mkv

Configuration reference

Flags override environment variables. Optional template: .env.example (export the vars yourself — the CLI does not load .env files).

Variable Description
EMBY_SERVER Server URL
EMBY_API_KEY API key
EMBY_USERNAME / EMBY_PASSWORD Username / password
EMBY_OUTPUT Download directory (default ./downloads)
EMBY_METHOD download, stream, or hls
EMBY_PLAYER External player command or path
EMBY_ITEM_ID Default --id for item download / play
EMBY_CACHE_DIR Credentials directory (default ~/.cache/emby-cli)
EMBY_NO_AUTH_CACHE 1 = disable session cache

Tips

  • Prefer search → show → download when you are unsure of the exact title.
  • Prefer IDs (--id) when you already have them — no ambiguity.
  • Use --dry-run before a large library or file-list download.
  • Content totals in info can count multiple versions of the same title separately.

For contributors

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -q
ruff check .
python -m build && twine check dist/*

Architecture, CLI contracts, testing rules, and release process: see AGENTS.md (for humans and AI agents). Releases: tag vX.Y.Z and push — CI publishes to PyPI only (no GitHub Releases).


Responsible use

This tool talks to Emby over its normal HTTP API. Whether download or playback is allowed depends on how that server is configured and on the terms set by whoever runs it.

Use emby-cli only on servers you are authorized to access, and only in ways that comply with that server’s terms of use, policies, and applicable law. The authors provide the software as-is and are not responsible for misuse, for downloads from servers that disallow them, or for any consequences of using the tool.


License

CC BY-NC 4.0 — free for non-commercial use.

Release files for emby-cli 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emby-cli 0.5.4
File Size Uploaded
emby_cli-0.5.4.tar.gz 63.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for emby-cli 0.5.4
File Interpreter ABI Platform
emby_cli-0.5.4-py3-none-any.whl Python 3 none any Details

Total release size: 111.3 kB

Release files / emby_cli-0.5.4.tar.gz

Download URL emby_cli-0.5.4.tar.gz
Size 63.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b6c6a9e78a9a3fd82a10de674d3dd2f3f5530160a0b33aa3c08a455e67e76237
BLAKE2b-256 checksum
How to use checksums
be800bd3f6be231c60186766789ef79a772f7c82389252cec49db111551aad42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

Release files / emby_cli-0.5.4-py3-none-any.whl

Download URL emby_cli-0.5.4-py3-none-any.whl
Size 47.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2330a0e21de6f7067e435e69708a7c0bee9309f156c1ffbee8e31dbe0d61c4e1
BLAKE2b-256 checksum
How to use checksums
bbb8f65fc6b6e3ba64e01d663b8e16ac03aadfb240947bdf1ae147a1a018049e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page