emby-cli
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 download:
emby-cli search --item "matrix"
emby-cli download --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 S01E05Show 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-runbefore a large library or file-list download. - Content totals in
infocan count multiple versions of the same title separately.
For contributors
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -q
python -m build && twine check dist/*
Releases: tag vX.Y.Z and push. CI publishes to PyPI via Trusted Publisher.
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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| emby_cli-0.5.2.tar.gz | 56.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| emby_cli-0.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 103.8 kB
Release files / emby_cli-0.5.2.tar.gz
| Download URL | emby_cli-0.5.2.tar.gz |
|---|---|
| Size | 56.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54c3e9ba35b90e4fd866190f5ad8e31465846c44a749926f36559849aeb421fb
|
|
BLAKE2b-256 checksum How to use checksums |
c9eec6e003e29fae5e7133a49d3c7d3b030da8f9561e47476dcc14889c696b31
|
| 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 7, 2026.
Transparency logRelease files / emby_cli-0.5.2-py3-none-any.whl
| Download URL | emby_cli-0.5.2-py3-none-any.whl |
|---|---|
| Size | 47.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03b68de82f63e91076df89cef549707409f43bba1a68dd4a2a8eb35491010a69
|
|
BLAKE2b-256 checksum How to use checksums |
d283b991971727aa851c34dee4192534775245ff9839a4c11ead5a54dd61b73f
|
| 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 7, 2026.
Transparency log