Command Line Interface¶
The command line interface is used to perform all the needed actions to import photos from Google Photos to Immich.
Note
You can either run the command with immichporter or short imp.
immichporter¶
Immichporter retrieves metadata not available in google takeout, including shared albums, assets, and shared users. You can use this data to update assets in Immich, re-add users to shared albums, and even move assets to their correct owners.
The command line interface uses subcommands for the various tasks (see below).
This are the steps needed to extract the information from google photos and update immich:
immich-go ... # see https://github.com/simulot/immich-go
immichporter gphotos login
immichporter gphotos albums
immichporter gphotos photos
immichporter db edit-users
export IMMICH_ENDPOINT=http://localhost:2283
export IMMICH_API_KEY=your_api_key
export IMMICH_INSECURE=1
immichporter immich update-users
immichporter immich update-albums
immichporter immich sync-albums
immichporter immich adjust-owners
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--version |
boolean | Show the version and exit. | False |
--help, -h |
boolean | Show this message and exit. | False |
Subcommands
- db: Show and edit metadata in the local database (not in immich!)
- gphotos: Login to Google Photos and export albums and photos metadata
- immich: Update users and albums in immich
immichporter db¶
Show and edit metadata in the local database (not in immich!)
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help, -h |
boolean | Show this message and exit. | False |
Subcommands
- drop: Drop database tables or the entire database.
- edit-users: Interactively edit user information in the database.
- init: Initialize the database.
- show-albums: Show albums in the database.
- show-stats: Show database statistics.
- show-users: Show all users in the database.
immichporter db drop¶
Drop database tables or the entire database.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-n, --name |
text | Name of the table to drop (albums, photos, users, errors) | Sentinel.UNSET |
-a, --all |
boolean | Drop all tables and recreate the database | False |
-f, --force |
boolean | Skip confirmation prompt | False |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter db edit-users¶
Interactively edit user information in the database.
By default, only shows users added to Immich without an email. Use --all to show all users, or --user-id to edit a specific user.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-d, --domain |
text | Domain to use for email generation (e.g., example.com) | None |
-a, --all |
boolean | Show all users, including those with email already set | False |
-u, --user-id |
integer | Edit a specific user by ID | Sentinel.UNSET |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter db init¶
Initialize the database.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter db show-albums¶
Show albums in the database.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
-i, --not-finished |
boolean | Show only albums that are not fully processed | False |
-a, --not-saved |
boolean | Show only albums that are not fully saved | False |
--help, -h |
boolean | Show this message and exit. | False |
immichporter db show-stats¶
Show database statistics.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter db show-users¶
Show all users in the database.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-i, --immich |
boolean | Show only users which are set to be added to immich | False |
-p, --show-password |
boolean | Show inital password | False |
-f, --format |
choice (table | csv | json) |
Output format | table |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter gphotos¶
Login to Google Photos and export albums and photos metadata
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help, -h |
boolean | Show this message and exit. | False |
Subcommands
- albums: List and export albums from Google Photos.
- login: Login to Google Photos and save the session.
- photos: Export photos from Google Photos albums.
immichporter gphotos albums¶
List and export albums from Google Photos.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-f, --start-album-fresh |
boolean | Start processing from the beginning, ignoring existing albums | False |
-s, --start-album |
integer | Start processing from this album position (1-based) | 1 |
-m, --max-albums |
integer | Maximum number of albums to processm, default: all albums | 0 |
-r, --reset-db |
boolean | Reset the database | False |
--db-path |
text | Path to the SQLite database file | immichporter.db |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
-x, --clear-storage |
boolean | Clear browser storage before starting | False |
-p, --profile-dir |
text | Path to store browser profile data | /home/runner/.config/immichporter/playwright_session |
-b, --show-browser |
boolean | Show browser | False |
--help, -h |
boolean | Show this message and exit. | False |
immichporter gphotos login¶
Login to Google Photos and save the session.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
-x, --clear-storage |
boolean | Clear browser storage before starting | False |
-p, --profile-dir |
text | Path to store browser profile data | /home/runner/.config/immichporter/playwright_session |
--help, -h |
boolean | Show this message and exit. | False |
immichporter gphotos photos¶
Export photos from Google Photos albums.
By default, processes all albums. Use --album-id to process specific albums.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-f, --start-album-fresh |
boolean | Start processing from the beginning, ignoring existing albums | False |
-s, --start-album |
integer | Start processing from this album position (1-based) | 1 |
-m, --max-albums |
integer | Maximum number of albums to processm, default: all albums | 0 |
-a, --album-id |
integer | Specific album ID to process (overrides max_albums and start_album) | Sentinel.UNSET |
-n, --not-finished |
boolean | Process only albums that have not been finished yet | False |
-r, --reset-db |
boolean | Reset the database | False |
--db-path |
text | Path to the SQLite database file | immichporter.db |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
-x, --clear-storage |
boolean | Clear browser storage before starting | False |
-p, --profile-dir |
text | Path to store browser profile data | /home/runner/.config/immichporter/playwright_session |
-b, --show-browser |
boolean | Show browser | False |
--help, -h |
boolean | Show this message and exit. | False |
immichporter immich¶
Update users and albums in immich
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help, -h |
boolean | Show this message and exit. | False |
Subcommands
- adjust-owners: Adjust asset ownership in Immich based on SQLite database.
- delete-albums: Delete albums from Immich.
- list-albums: List all albums on the Immich server.
- sync-albums: Sync albums from our database to Immich.
- untag-assets: Untag assets with a specific tag. Children tags will be removed as well.
- update-photos: Update our photos with their Immich IDs by searching for them in Immich.
- update-users: Update our users with their Immich IDs by searching for them in Immich.
immichporter immich adjust-owners¶
Adjust asset ownership in Immich based on SQLite database.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--endpoint |
text | Immich server URL (default: http://localhost:2283) | http://localhost:2283 |
-k, --api-key |
text | Immich API key | Sentinel.UNSET |
--insecure |
boolean | Skip SSL certificate verification | False |
--db-host |
text | PostgreSQL host. Can also be set via DB_HOST environment variable. | database |
--db-port |
integer | PostgreSQL port. Can also be set via DB_PORT environment variable. | 5432 |
--db-username |
text | PostgreSQL username. Can also be set via DB_USERNAME environment variable. | immich |
--db-password |
text | PostgreSQL password. Can also be set via DB_PASSWORD environment variable. | immich |
--db-name |
text | PostgreSQL database name. Can also be set via DB_NAME environment variable. | immich |
--dry-run / --no-dry-run |
boolean | Show what would be changed without making any changes | True |
--batch-size |
integer | Number of assets to process in a batch | 25 |
--storage-migration / --no-storage-migration |
boolean | Run 'storage template migration' job after adjusting owners | True |
--db-backup / --no-db-backup |
boolean | Run 'storage template migration' job after adjusting owners | True |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter immich delete-albums¶
Delete albums from Immich.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--endpoint |
text | Immich server URL (default: http://localhost:2283) | http://localhost:2283 |
-k, --api-key |
text | Immich API key | Sentinel.UNSET |
--insecure |
boolean | Skip SSL certificate verification | False |
-a, --all |
boolean | Delete all albums | False |
-n, --dry-run |
boolean | Run without making any changes | False |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter immich list-albums¶
List all albums on the Immich server.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--endpoint |
text | Immich server URL (default: http://localhost:2283) | http://localhost:2283 |
-k, --api-key |
text | Immich API key | Sentinel.UNSET |
--insecure |
boolean | Skip SSL certificate verification | False |
--limit |
integer | Maximum number of albums to return | 50 |
--shared / --no-shared |
boolean | Filter by shared status | None |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter immich sync-albums¶
Sync albums from our database to Immich.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--endpoint |
text | Immich server URL (default: http://localhost:2283) | http://localhost:2283 |
-k, --api-key |
text | Immich API key | Sentinel.UNSET |
--insecure |
boolean | Skip SSL certificate verification | False |
--limit |
integer | Limit the number of albums to sync | None |
-n, --dry-run |
boolean | Run without making any changes | False |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter immich untag-assets¶
Untag assets with a specific tag. Children tags will be removed as well.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--endpoint |
text | Immich server URL (default: http://localhost:2283) | http://localhost:2283 |
-k, --api-key |
text | Immich API key | Sentinel.UNSET |
--insecure |
boolean | Skip SSL certificate verification | False |
--tag-name |
text | Name of the tag | Sentinel.UNSET |
-m, --remove-tag |
boolean | Remove tag name as well | False |
--all |
boolean | Untag all assets. '--tag-name' will be ignored | False |
-e, --exclude |
text | Name of tags to exclude if '--all' is used. Make sure to include parents as well! | Sentinel.UNSET |
--dry-run / --no-dry-run |
boolean | Run without making any changes | True |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter immich update-photos¶
Update our photos with their Immich IDs by searching for them in Immich.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--endpoint |
text | Immich server URL (default: http://localhost:2283) | http://localhost:2283 |
-k, --api-key |
text | Immich API key | Sentinel.UNSET |
--insecure |
boolean | Skip SSL certificate verification | False |
--dry-run |
boolean | Run without making any changes | False |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |
immichporter immich update-users¶
Update our users with their Immich IDs by searching for them in Immich.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--endpoint |
text | Immich server URL (default: http://localhost:2283) | http://localhost:2283 |
-k, --api-key |
text | Immich API key | Sentinel.UNSET |
--insecure |
boolean | Skip SSL certificate verification | False |
--dry-run |
boolean | Run without making any changes | False |
-l, --log-level |
choice (debug | info | warning | error) |
Set the logging level | warning |
--help, -h |
boolean | Show this message and exit. | False |