MCPcopy
hub / github.com/simulot/immich-go

github.com/simulot/immich-go @1.21.3 sqlite

repository ↗ · DeepWiki ↗ · release 1.21.3 ↗
701 symbols 1,985 edges 94 files 111 documented · 16%
README

Immich-Go: Upload Your Photos to Your Immich Server

Immich-Go is an open-source tool designed to streamline uploading large photo collections to your self-hosted Immich server.

screen

You can now support my work on Immich-go:

Key Features:

  • Effortlessly Upload Large Google Photos Takeouts: Immich-Go excels at handling the massive archives you download from Google Photos using Google Takeout. It efficiently processes these archives while preserving valuable metadata like GPS location, date taken, and album information.
  • Flexible Uploads: Immich-Go isn't limited to Google Photos. You can upload photos directly from your computer folders, folders tree and ZIP archives.
  • Simple Installation: Immich-Go doesn't require NodeJS or Docker for installation. This makes it easy to get started, even for those less familiar with technical environments.
  • Prioritize Quality: Immich-Go discards any lower-resolution versions that might be included in Google Photos Takeout, ensuring you have the best possible copies on your Immich server.
  • Stack burst and raw/jpg photos: Group together related photos in Immich.

Google Photos Best Practices:

  • Taking Out Your Photos:
  • Choose the ZIP format when creating your takeout for easier import.
  • Select the largest file size available (50GB) to minimize the number of archive parts.
  • Download all parts on your computer

  • Importing Your Photos:

  • If your takeout is in ZIP format, you can import it directly without needing to unzip the files first.
  • It's important to import all the parts of the takeout together, since some data might be spread across multiple files.

Use /path/to/your/files/takeout-*.zip as file name. * For .tgz files (compressed tar archives), you'll need to decompress all the files into a single folder before importing. When using the import tool, don't forget the -google-photos option. * You can remove any unwanted files or folders from your takeout before importing. * Restarting an interrupted import won't cause any problems and it will resume the work where it was left.

  • Lot of files are not imported: What are the options?
  • Verify if all takeout parts have been included in the processing.
  • Request another takeout, either for an entire year or in smaller increments.
  • Force the import of files despite the missing JSON. Use the option -upload-when-missing-JSON

For insights into the reasoning behind this alternative to immich-cli, please read the motivation here.

⚠️ This an early version, not yet extensively tested

⚠️ Keep a backup copy of your files for safety

Executing immich-go

The immich-go is a command line tool that must be run from a terminal window.
The immich-go program uses the Immich API. Hence it needs the server address and a valid API key.

On linux, MacOS, FreeBSD and linux friends:

./immich-go -server=URL -key=KEY -general_options COMMAND -command_options... {path/to/files}

[!IMPORTANT] MAC OS users have to allow immich-go to run. Open Privacy & Security > Security Settings

On Windows systems:

.\immich-go -server=URL -key=KEY -general_options COMMAND -command_options... {path/to/files}

How boolean options are handled

Boolean options have a default value indicated below. Mentioning any option on the common line changes the option to TRUE. to force an option to FALSE, use the following syntax: -option=FALSE.

Example: Immich-go check the server's SSL certificate. you can disable this behavior by turning on the skip-verify-ssl option. Just add -skip-verify-ssl. -skip-verify-ssl is equivalent to -skip-verify-ssl=TRUE. To turn off the feature (which is the default behavior), use -skip-verify-ssl=FALSE

Shared options with all commands

Parameter Description Default value
-use-configuration=path/to/config/file Specifies the configuration file to use.

Server URL and the API key are stored into the immich-go configuration file. They can be omitted for the next runs. | Linux $HOME/.config/immich-go/immich-go.json

Windows %AppData%\immich-go\immich-go.json

Apple $HOME/Library/Application Support/immich-go/immich-go.json | | -server=URL | URL of the Immich service, example http://:2283 or https://your-domain | | | -api=URL | URL of the Immich api endpoint (http://container_ip:3301) | | | -device-uuid=VALUE | Force the device identification | $HOSTNAME | | -client-timeout=duration | Set the timeout for server calls. The duration is a decimal number with a unit suffix, such as "300ms", "1.5m" or "45m". Valid time units are "ms", "s", "m", "h". | 5m | | -skip-verify-ssl | Skip SSL verification for use with self-signed certificates | false | | -key=KEY | A key generated by the user. Uploaded photos will belong to the key's owner. | | | -log-level=LEVEL | Adjust the log verbosity as follows:

  • ERROR: Display only errors

  • WARNING: Same as previous one plus non-blocking error

  • INFO: Information messages | INFO | | -log-file=/path/to/log/file | Write all messages to a file | Linux $HOME/.cache/immich-go/immich-go_YYYY-MM-DD_HH-MI-SS.log

Windows %LocalAppData%\immich-go\immich-go_YYYY-MM-DD_HH-MI-SS.log

Apple $HOME/Library/Caches/immich-go/immich-go_YYYY-MM-DD_HH-MI-SS.log | | -log-json | Output the log as line-delimited JSON file | false | | -time-zone=time_zone_name | Set the time zone for dates without time zone information | the system's time zone | | -no-ui | Disable the user interface | false | | -debug-counters | Enable the generation a CSV beside the log file | false | | -api-trace | Enable trace of API calls | false |

Command upload

Use this command for uploading photos and videos from a local directory, a zipped folder or all zip files that google photo takeout procedure has generated.

Switches and options:

Parameter Description Default value
-album="ALBUM NAME" Import assets into the Immich album ALBUM NAME.
-dry-run Preview all actions as they would be done. FALSE
-create-album-folder Generate immich albums after folder names. FALSE
-use-full-path-album-name Use the full path to the file to determine the album name. FALSE
-album-name-path-separator Determines how multiple (sub) folders, if any, will be joined
-create-stacks Stack jpg/raw or bursts. FALSE
-stack-jpg-raw Control the stacking of jpg/raw photos. FALSE
-stack-burst Control the stacking bursts. FALSE
-select-types=".ext,.ext,.ext..." List of accepted extensions.
-exclude-types=".ext,.ext,.ext..." List of excluded extensions.

Extension points exported contracts — how you extend this code

NameFS (Interface)
(no doc) [5 implementers]
helpers/fshelper/globwalkfs.go
NameFS (Interface)
(no doc) [5 implementers]
internal/fakefs/ziplist_test.go
ImmichInterface (Interface)
ImmichInterface is an interface that implements the minimal immich client set of features for uploading interface used t [3 …
immich/immich.go
DebugObject (Interface)
(no doc) [3 implementers]
logger/log.go
Browser (Interface)
(no doc) [2 implementers]
browser/browser.go
Logger (Interface)
(no doc) [2 implementers]
logger/logger.go
Remover (Interface)
* Some helps with file systems */ [2 implementers]
helpers/fshelper/removefs.go

Core symbols most depended-on inside this repo

Error
called by 62
logger/logger.go
Record
called by 55
helpers/fileevent/fileevents.go
TakeTimeFromName
called by 48
immich/metadata/namesdate.go
Run
called by 29
helpers/docker/docker.go
BoolFlagFn
called by 25
helpers/myflag/boolfn.go
OK
called by 21
logger/logger.go
newServerCall
called by 21
immich/call.go
do
called by 21
immich/call.go

Shape

Method 352
Function 223
Struct 95
TypeAlias 12
FuncType 10
Interface 9

Languages

Go100%

Modules by API surface

immich/immich.go40 symbols
cmd/upload/upload_test.go30 symbols
cmd/upload/e2e_upload_folder_test.go30 symbols
browser/gp/testgp_samples_test.go30 symbols
cmd/upload/upload.go29 symbols
immich/call.go26 symbols
immich/client.go24 symbols
logger/log.go23 symbols
internal/fakeImmich/immich.go23 symbols
helpers/docker/docker.go21 symbols
internal/fakefs/fakefs.go20 symbols
browser/gp/googlephotos.go20 symbols

Dependencies from manifests, versioned

github.com/gdamore/encodingv1.0.0 · 1×
github.com/kr/fsv0.1.0 · 1×
github.com/kr/prettyv0.3.1 · 1×
github.com/kr/textv0.2.0 · 1×
github.com/lucasb-eyer/go-colorfulv1.2.0 · 1×
github.com/mattn/go-runewidthv0.0.15 · 1×
github.com/navidys/tvxwidgetsv0.7.0 · 1×

For agents

$ claude mcp add immich-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact