Configuration¶
pymmich is configured entirely through environment variables so the same binary can be safely invoked from shells, scripts and CI jobs.
Required¶
| Variable | Description |
|---|---|
PYMMICH_URL |
Base URL of the Immich server, e.g. https://immich.me. |
PYMMICH_API_KEY |
API key created in the Immich web UI. |
If either of the two is missing, pymmich exits with a clear message
and exit code 2.
Optional¶
| Variable | Default | Description |
|---|---|---|
PYMMICH_VERIFY_TLS |
1 |
Set to 0 / false / no to disable TLS certificate verification (dev only). |
PYMMICH_API_VARIANT |
autodetect | Pin the Immich API variant to v2 (Immich 2.x) or v3 (Immich 3.x) instead of detecting it from the server version. |
TLS verification
Only disable TLS verification for local development. For any
production server, leave PYMMICH_VERIFY_TLS at its default value.
Only pin the API variant if you have to
By default pymmich asks the server which version it runs and picks
the matching API variant itself. PYMMICH_API_VARIANT is an escape
hatch for setups where that version request is unreachable, e.g.
behind a restrictive reverse proxy. Any value other than v2 or
v3 is rejected with a configuration error. See
Server compatibility.
Creating an API key¶
- Open the Immich web UI.
- Click your avatar → Account Settings → API Keys.
- Click New API Key, give it a descriptive name, and either select All permissions or tick only the permissions pymmich actually needs (see API key permissions).
- Copy the value that is shown once.
- Store the value in a secret manager or a shell profile file with restrictive permissions.
Example: .envrc for direnv¶
export PYMMICH_URL="https://immich.example.com"
export PYMMICH_API_KEY="abcd1234..."