emby-cli
CLI to search, play, and download/backup original media files from an Emby server via its REST API. Only HTTP access is required (default port 8096) — no SSH or rsync.
Install
pip install emby-cli
Development (from a clone of this repo):
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
Configuration
Set environment variables (or pass CLI flags):
| Variable | Description |
|---|---|
EMBY_SERVER |
Server URL (required for most commands) |
EMBY_API_KEY |
API key (or use username/password) |
EMBY_USERNAME / EMBY_PASSWORD |
Name/password auth |
EMBY_OUTPUT |
Download directory (default ./downloads) |
EMBY_METHOD |
download, stream, or hls |
EMBY_PLAYER |
External player for play |
EMBY_ITEM_ID |
Default for --id (item mode / play) |
EMBY_CACHE_DIR |
Credentials directory (default ~/.cache/emby-cli; file auth.json) |
EMBY_NO_AUTH_CACHE |
Set to 1 to disable reading/writing the AccessToken cache |
See .env.example. The app does not load .env itself — source it or export vars.
With username/password, sessions are stored in a single kubeconfig-style auth.json (contexts + current_context). emby-cli login saves a server entry and makes it active. Without --server, commands use the active server. Manage entries with emby-cli config (current-server, get-servers, use-server, view). API keys are not stored.
Usage
emby-cli help
emby-cli login
emby-cli logout
emby-cli config get-servers
emby-cli config use-server 'user@http://emby:8096'
emby-cli config current-server
emby-cli config view
emby-cli version
emby-cli info
emby-cli search --item "Title"
emby-cli search --item "Title" --count 50
emby-cli search --item --id 123456
emby-cli search --item --all
emby-cli search --library --all
emby-cli search --library --id 614156
emby-cli search --library "PELICULAS"
emby-cli show --item "Title"
emby-cli show --item --id 123456
emby-cli show --library "PELICULAS"
emby-cli show --library --id 614156
emby-cli download --item --id 123456
emby-cli download --item "californication S01E01" --pick-best-item
emby-cli download --library --id 12345
emby-cli download --library "PELICULAS 4K"
emby-cli download --from-file titles.txt --dry-run
emby-cli play --id 123456
emby-cli play --search "Pelicula (1980)" --pick-best-item
info reports libraries and totals from GET /Items/Counts (totals may include multiple versions of the same title).
Title resolution (play --search, download --item with a query, download --from-file) is strict by default (year mismatch or multiple matches fail). Pass --pick-best-item to auto-select the best ≤1080p version. With --from-file or --item + query, a season line like Show S01 downloads the whole season (same pick-best rule per episode version). Library query requires an exact name match (case-insensitive); no pick-best.
--dry-run / -n works for all download modes (no files written).
Download methods (-m / EMBY_METHOD):
download—GET /Items/{id}/Downloadstream— DirectStreamUrl /original.*(Emby Web style)hls— HLS segments remuxed to.mkv(needsstatic-ffmpeg)
Development
pip install -e ".[dev]"
pytest -q
python -m build && twine check dist/*
To publish a release, tag vX.Y.Z and push it (or create a GitHub Release). CI builds the package and publishes to PyPI via Trusted Publisher.
License
Release files for emby-cli 0.4.0
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.4.0.tar.gz | 43.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| emby_cli-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 125.4 kB
Release files / emby_cli-0.4.0.tar.gz
| Download URL | emby_cli-0.4.0.tar.gz |
|---|---|
| Size | 43.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43e630acd1cab5d1badbee062876162faaff02115eeb675c09ff414d2aad9845
|
|
BLAKE2b-256 checksum How to use checksums |
f6a14dbfcc950e89a5a21dc033690784310111e5ee722e67c40eceb7bbec5be3
|
| 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.4.0-py3-none-any.whl
| Download URL | emby_cli-0.4.0-py3-none-any.whl |
|---|---|
| Size | 81.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1fccf01820c09229d939223d41d1e7e4742452f5a648de1f7177f0ba9bc5a1c2
|
|
BLAKE2b-256 checksum How to use checksums |
4a92290534cfa0120904bac2e91228d1f9601b26fd8cd06aac42e5326c6a7a9a
|
| 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