### Basic Stacking Examples Source: https://github.com/simulot/immich-go/blob/main/docs/commands/stack.md Examples showing how to stack burst photos and perform a dry-run preview. ```bash # Stack burst photos automatically immich-go stack \ --server=http://localhost:2283 \ --api-key=your-key \ --manage-burst=Stack # Preview stacking without changes immich-go stack \ --server=http://localhost:2283 \ --api-key=your-key \ --manage-burst=Stack \ --dry-run ``` -------------------------------- ### Comprehensive Organization Example Source: https://github.com/simulot/immich-go/blob/main/docs/commands/stack.md Example showing how to apply multiple stacking rules simultaneously for different photo types. ```bash # Handle all photo types immich-go stack \ --server=http://localhost:2283 \ --api-key=your-key \ --manage-burst=Stack \ --manage-raw-jpeg=StackCoverRaw \ --manage-heic-jpeg=StackCoverJPG \ --manage-epson-fastfoto=true ``` -------------------------------- ### Build Immich-Go from Source Source: https://github.com/simulot/immich-go/blob/main/docs/installation.md Clone the repository, navigate to the directory, and build the binary using Go. The 'go install' command is optional for installing to GOPATH/bin. ```bash # Clone the repository git clone https://github.com/simulot/immich-go.git # Change to project directory cd immich-go # Build the binary go build # Install to GOPATH/bin (optional) go install ``` -------------------------------- ### Install and run with Nix Source: https://github.com/simulot/immich-go/blob/main/readme-old.md Use Nix to run immich-go without permanent installation or via flakes. ```bash nix-shell -I "nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable-small.tar.gz" -p immich-go ``` ```bash nix run "github:nixos/nixpkgs?ref=nixos-unstable-small#immich-go" -- --help ``` -------------------------------- ### RAW + JPEG Management Examples Source: https://github.com/simulot/immich-go/blob/main/docs/commands/stack.md Examples demonstrating how to stack RAW+JPEG pairs with specific cover preferences or file retention policies. ```bash # Stack with RAW as cover immich-go stack \ --server=http://localhost:2283 \ --api-key=your-key \ --manage-raw-jpeg=StackCoverRaw # Keep only JPEG files immich-go stack \ --server=http://localhost:2283 \ --api-key=your-key \ --manage-raw-jpeg=KeepJPG ``` -------------------------------- ### iCloud import examples Source: https://github.com/simulot/immich-go/blob/main/docs/commands/upload.md Examples for importing iCloud exports, including an option to import memories as albums. ```bash # Basic iCloud import immich-go upload from-icloud --server=http://localhost:2283 --api-key=your-key /path/to/icloud-export # Include memories as albums immich-go upload from-icloud --memories --server=http://localhost:2283 --api-key=your-key /path/to/icloud-export ``` -------------------------------- ### Google Photos import examples Source: https://github.com/simulot/immich-go/blob/main/docs/commands/upload.md Examples for importing Google Photos archives, including handling unmatched files and specific albums. ```bash # Basic Google Photos import immich-go upload from-google-photos --server=http://localhost:2283 --api-key=your-key /path/to/takeout-*.zip # Import including unmatched files immich-go upload from-google-photos --include-unmatched --server=http://localhost:2283 --api-key=your-key /takeout # Import from specific album only immich-go upload from-google-photos --from-album-name="Vacation 2023" --server=http://localhost:2283 --api-key=your-key /takeout ``` -------------------------------- ### Local Development Workflow Example Source: https://github.com/simulot/immich-go/blob/main/scripts/e2e/README.md Demonstrates the complete workflow for local Immich E2E testing, from provisioning to cleanup. ```bash # 1. Provision Immich ./scripts/e2e/immich-provision.sh ./internal/e2e/testdata/immich-server 2283 # 2. Create users ./scripts/e2e/immich-provision-users.sh http://localhost:2283 ./internal/e2e/testdata/immich-server/e2eusers.yml # 3. Run tests (explicitly setting env vars) E2E_SERVER=http://localhost:2283 \ E2E_USERS=./internal/e2e/testdata/immich-server/e2eusers.yml \ go test -v -tags=e2e ./internal/e2e/client/... # Or simply use defaults (same as above): go test -v -tags=e2e ./internal/e2e/client/... # 4. Reset between test runs ./scripts/e2e/immich-reset.sh ./internal/e2e/testdata/immich-server # 5. Cleanup when done ./scripts/e2e/immich-cleanup.sh ./internal/e2e/testdata/immich-server ``` -------------------------------- ### Verify Immich-Go Installation Source: https://github.com/simulot/immich-go/blob/main/docs/installation.md Run the --version flag to confirm that Immich-Go has been installed correctly and is accessible. ```bash immich-go --version ``` -------------------------------- ### Stack Photos on Server Example Source: https://github.com/simulot/immich-go/blob/main/docs/commands/README.md Provides an example for organizing related photos into stacks on the Immich server. This command can also manage burst photos. ```bash # Stack photos on server immich-go stack --server=http://localhost:2283 --api-key=your-key --manage-burst=Stack ``` -------------------------------- ### Display Version Example Source: https://github.com/simulot/immich-go/blob/main/docs/commands/README.md A simple command to display the current version of the Immich-Go application. ```bash # Show version immich-go version ``` -------------------------------- ### Install Immich-Go with Nix Source: https://github.com/simulot/immich-go/blob/main/docs/installation.md Install Immich-Go using the Nix package manager. You can try it without installing or add it to your NixOS configuration. ```bash # Try without installing nix-shell -I "nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable-small.tar.gz" -p immich-go # Or with flakes enabled nix run "github:nixos/nixpkgs?ref=nixos-unstable-small#immich-go" -- --help ``` ```nix environment.systemPackages = with pkgs; [ immich-go ]; ``` -------------------------------- ### Install dependencies Source: https://github.com/simulot/immich-go/blob/main/CONTRIBUTING.md Downloads the required Go modules. ```sh go mod download ``` -------------------------------- ### Configuration File: TOML Example Source: https://context7.com/simulot/immich-go/llms.txt Example of a TOML configuration file for immich-go. This file allows you to set persistent settings for various commands, including upload and archive options. ```toml # immich-go.toml concurrent-tasks = 12 dry-run = false log-level = 'INFO' log-type = 'text' on-errors = 'stop' [upload] api-key = 'YOUR-API-KEY' server = 'https://immich.example.com' client-timeout = '20m' pause-immich-jobs = true manage-burst = 'Stack' manage-raw-jpeg = 'StackCoverRaw' manage-heic-jpeg = 'StackCoverJPG' session-tag = false [upload.from-folder] recursive = true date-from-name = true folder-as-album = 'FOLDER' folder-as-tags = false [upload.from-google-photos] include-archived = true include-partner = true include-trashed = false sync-albums = true people-tag = true takeout-tag = true [archive] write-to-folder = '/backup/immich' [archive.from-immich] from-api-key = 'YOUR-API-KEY' from-server = 'https://immich.example.com' from-client-timeout = '20m' ``` -------------------------------- ### Install Immich-Go CLI Source: https://context7.com/simulot/immich-go/llms.txt Download the pre-built binary for your platform and move it to your system's PATH. Alternatively, build from source using Go. ```bash # Download from GitHub releases page # Linux/macOS/FreeBSD tar -xzf immich-go_Linux_x86_64.tar.gz sudo mv immich-go /usr/local/bin/ # Verify installation immich-go --version # Build from source (alternative) git clone https://github.com/simulot/immich-go.git cd immich-go go build go install ``` -------------------------------- ### Log file output example Source: https://github.com/simulot/immich-go/blob/main/docs/misc/releases.md When the -log-level=INFO flag is set, immich-go provides detailed logs about file handling actions. This example shows various messages indicating whether files are already on the server, if the server has a better version, or if duplicates are found. ```text ... Server has photo : Takeout/Googles Photos/Photos from 2022/IMG_0135.HEIC: An asset with the same name:"IMG_0135", date:"2022-03-02 21:16:50" and size:3.5 MB exists on the server. No need to upload. Server's asset is better : Takeout/Googles Photos/Photos from 2022/PXL_20220916_140005541.jpg: An asset with the same name:"PXL_20220916_140005541" and date:"2022-09-16 16:00:05" but with bigger size:2.4 MB exists on the server. No need to upload. Server has photo : Takeout/Googles Photos/Photos from 2022/PXL_20220807_181842919.jpg: An asset with the same name:"PXL_20220807_181842919", date:"2022-08-07 20:18:42" and size:881.1 KB exists on the server. No need to upload. Server's asset is better : Takeout/Googles Photos/Photos from 2022/PXL_20220907_081516648.jpg: An asset with the same name:"PXL_20220907_081516648" and date:"2022-09-07 10:15:16" but with bigger size:1.9 MB exists on the server. No need to upload. Server's asset is better : Takeout/Googles Photos/Photos from 2022/PXL_20220620_063743673.jpg: An asset with the same name:"PXL_20220620_063743673" and date:"2022-06-20 08:37:43" but with bigger size:1.8 MB exists on the server. No need to upload. Local duplicate : Takeout/Googles Photos/Cat🐱/PXL_20220428_204810437.jpg: PXL_20220428_204810437.jpg Uploaded : Takeout/Googles Photos/Photos from 2022/PXL_20220428_204810437.jpg: PXL_20220428_204810437.jpg Added to an album : Takeout/Googles Photos/Photos from 2022/PXL_20220428_204810437.jpg: Cat🐱 Server's asset is better : Takeout/Googles Photos/Photos from 2022/PXL_20220526_181202808.jpg: An asset with the same name:"PXL_20220526_181202808" and date:"2022-05-26 20:12:02" but with bigger size:2.5 MB exists on the server. No need to upload. ... ``` -------------------------------- ### Upload from local folder examples Source: https://github.com/simulot/immich-go/blob/main/docs/commands/upload.md Demonstrates basic folder uploads, creating albums from folder structures, stacking RAW+JPEG files, and filtering by date or type. ```bash # Basic folder upload immich-go upload from-folder --server=http://localhost:2283 --api-key=your-key /path/to/photos # Create albums from folder structure immich-go upload from-folder --folder-as-album=FOLDER --server=http://localhost:2283 --api-key=your-key /photos # Stack RAW+JPEG files immich-go upload from-folder --manage-raw-jpeg=StackCoverRaw --server=http://localhost:2283 --api-key=your-key /photos # Filter by date and file type immich-go upload from-folder --date-range=2023 --include-type=IMAGE --server=http://localhost:2283 --api-key=your-key /photos ``` -------------------------------- ### Immich-Go operation examples Source: https://github.com/simulot/immich-go/blob/main/readme-old.md Common tasks for uploading and archiving media files. ```bash immich-go upload from-folder --server=http://your-ip:2283 --api-key=your-api-key /path/to/your/photos ``` ```bash immich-go archive from-immich --from-server=http://your-ip:2283 --from-api-key=your-api-key --write-to-folder=/path/to/archive ``` ```bash immich-go upload from-google-photos --server=http://your-ip:2283 --api-key=your-api-key /path/to/your/takeout-*.zip ``` -------------------------------- ### Upload from Local Folder Example Source: https://github.com/simulot/immich-go/blob/main/docs/commands/README.md Demonstrates how to upload photos and videos from a local directory to the Immich server. Ensure to replace placeholders with your server details and API key. ```bash # Upload from local folder immich-go upload from-folder --server=http://localhost:2283 --api-key=your-key /photos ``` -------------------------------- ### RAW + JPEG Pairing Example Source: https://github.com/simulot/immich-go/blob/main/docs/technical.md Demonstrates how RAW and JPEG files with the same base name and in the same directory are paired for management. ```text Files: - IMG_1234.CR3 (RAW) - IMG_1234.JPG (JPEG) Result: Paired for stacking/management ``` -------------------------------- ### Upload assets from local and Google Photos sources Source: https://github.com/simulot/immich-go/blob/main/readme-old.md Examples of using the upload command to import assets from a local directory or a Google Photos takeout archive. ```bash immich-go upload from-folder --server=http://your-ip:2283 --api-key=your-api-key /path/to/your/photos immich-go upload from-google-photos --server=http://your-ip:2283 --api-key=your-api-key /path/to/your/takeout-*.zip ``` -------------------------------- ### Examples of server-to-server transfers Source: https://github.com/simulot/immich-go/blob/main/docs/commands/upload.md Common patterns for migrating assets between Immich servers, including filtering by rating or date range. ```bash # Transfer all photos between servers immich-go upload from-immich \ --from-server=http://old-server:2283 --from-api-key=old-key \ --server=http://new-server:2283 --api-key=new-key # Transfer images with a rating of 3 or above immich-go upload from-immich \ --from-server=http://old-server:2283 --from-api-key=old-key --from-minimal-rating=3 \ --server=http://new-server:2283 --api-key=new-key # Transfer photos from a specific date range immich-go upload from-immich \ --from-server=http://old-server:2283 --from-api-key=old-key --from-date-range=2023-01-01,2023-06-30 \ --server=http://new-server:2283 --api-key=new-key ``` -------------------------------- ### Archive from Immich Server Example Source: https://github.com/simulot/immich-go/blob/main/docs/commands/README.md Shows how to archive photos from the Immich server to a local folder structure. This command requires server connection details and a destination path. ```bash # Archive from server immich-go archive from-immich --server=http://localhost:2283 --api-key=your-key --write-to-folder=/backup ``` -------------------------------- ### Configure PATH for Go binaries Source: https://github.com/simulot/immich-go/blob/main/readme-old.md Add the Go bin directory to your shell PATH to execute installed binaries directly. ```bash export PATH=$PATH:$(go env GOPATH)/bin ``` ```bash source ~/.bashrc ``` -------------------------------- ### Archive Folder Structure Example Source: https://github.com/simulot/immich-go/blob/main/docs/misc/releases.md Illustrates the YYYY/YYYY-MM/files folder structure created by the archive command. ```sh tree . . β”œβ”€β”€ 2011 β”‚Β Β  └── 2011-04 β”‚Β Β  β”œβ”€β”€ 20110430.CR2 β”‚Β Β  β”œβ”€β”€ 20110430.CR2.xmp β”‚Β Β  β”œβ”€β”€ 20110430.jpg β”‚Β Β  β”œβ”€β”€ 20110430.jpg.xmp β”‚Β Β  β”œβ”€β”€ IMG_2477.CR2 β”‚Β Β  β”œβ”€β”€ IMG_2477.CR2.xmp β”‚Β Β  β”œβ”€β”€ IMG_2478.CR2 β”‚Β Β  β”œβ”€β”€ IMG_2478.CR2.xmp β”‚Β Β  β”œβ”€β”€ IMG_2479.CR2 β”‚Β Β  └── IMG_2479.CR2.xmp └── 2023 β”œβ”€β”€ 2023-06 β”‚Β Β  β”œβ”€β”€ PXL_20230607_063000139.jpg β”‚Β Β  └── PXL_20230607_063000139.jpg.xmp └── 2023-10 β”œβ”€β”€ PXL_20231006_063029647.jpg β”œβ”€β”€ PXL_20231006_063029647.jpg.xmp β”œβ”€β”€ PXL_20231006_063851485.jpg └── PXL_20231006_063851485.jpg.xmp ``` -------------------------------- ### Build Immich-Go in Termux Source: https://github.com/simulot/immich-go/blob/main/docs/installation.md Install necessary dependencies (git, golang) and build Immich-Go from source within the Termux environment. Ensure the binary is added to your PATH. ```bash # Install dependencies pkg install git golang # Build following the standard source instructions above # Add to PATH (if using go install) echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.bashrc source ~/.bashrc ``` -------------------------------- ### Get Immich Version with -version Source: https://github.com/simulot/immich-go/blob/main/docs/misc/releases.md The -version option returns the version of the immich-go executable. ```bash immich-go -version ``` -------------------------------- ### Basic immich-go Upload Command Source: https://github.com/simulot/immich-go/blob/main/GEMINI.md Provides a basic example of how to use the `upload` command to send photos from a local folder to an Immich server. Ensure you replace placeholders with your server details and API key. ```sh ./immich-go upload from-folder --server http://your-immich-server:2283 --api-key YOUR_API_KEY /path/to/photos ``` -------------------------------- ### Provision Immich Instance Script Source: https://github.com/simulot/immich-go/blob/main/scripts/e2e/README.md Provisions a fresh Immich instance for e2e testing. Specify installation directory and port if defaults are not suitable. ```bash ./scripts/e2e/immich-provision.sh [INSTALL_DIR] [PORT] ``` ```bash ./scripts/e2e/immich-provision.sh ./internal/e2e/testdata/immich-server 3000 ``` -------------------------------- ### Building Immich-Go from Source Source: https://github.com/simulot/immich-go/blob/main/readme-old.md Standard procedure to clone and compile the project using the Go toolchain. ```bash # Clone the repository git clone https://github.com/simulot/immich-go.git # Change to the project directory cd immich-go # Build the binary go build # (Optional) Install to GOPATH/bin go install ``` -------------------------------- ### Force Remove Installation Directory Source: https://github.com/simulot/immich-go/blob/main/scripts/e2e/README.md Forcefully removes the Immich installation directory, useful when cleanup scripts fail due to permission issues. ```bash sudo rm -rf ./internal/e2e/testdata/immich-server ``` -------------------------------- ### Example Metadata JSON Source: https://github.com/simulot/immich-go/blob/main/docs/commands/archive.md Structure of the sidecar JSON file generated for each archived photo. ```json { "fileName": "example.jpg", "latitude": 37.7749, "longitude": -122.4194, "dateTaken": "2023-10-01T12:34:56Z", "description": "Golden Gate Bridge view", "albums": [ { "title": "San Francisco Trip", "description": "Photos from my trip" } ], "tags": [ { "value": "USA/California/San Francisco" } ], "rating": 5, "trashed": false, "archived": false, "favorited": true, "fromPartner": false } ``` -------------------------------- ### Basic Upload Command Syntax Source: https://github.com/simulot/immich-go/blob/main/docs/commands/upload.md Use this syntax to initiate an upload to your Immich server. Replace `` with the desired upload source and `` with the location of your files. ```bash immich-go upload [options] ``` -------------------------------- ### Date Range Filtering Source: https://context7.com/simulot/immich-go/llms.txt Examples of using date range flags to filter uploads and archives. ```bash immich-go upload from-folder --date-range=2023 ... ``` ```bash immich-go upload from-folder --date-range=2023-07 ... ``` ```bash immich-go upload from-folder --date-range=2023-07-15 ... ``` ```bash immich-go upload from-folder --date-range=2023-01-15,2023-03-15 ... ``` ```bash immich-go upload from-immich --from-date-range=2024-01-01,2024-06-30 ... ``` -------------------------------- ### Immich Archive Metadata Format Source: https://github.com/simulot/immich-go/blob/main/docs/technical.md Example of the comprehensive JSON metadata generated by Immich-Go for archived photos. ```json { "fileName": "example.jpg", "latitude": 37.7749, "longitude": -122.4194, "dateTaken": "2023-10-01T12:34:56Z", "description": "Golden Gate Bridge view", "albums": [ { "title": "San Francisco Trip", "description": "Photos from my vacation", "start": "2023-10-01T00:00:00Z", "end": "2023-10-05T23:59:59Z" } ], "tags": [ { "value": "Location/USA/California/San Francisco" }, { "value": "Event/Vacation" } ], "rating": 5, "trashed": false, "archived": false, "favorited": true, "fromPartner": false, "motion": false, "livePhoto": false } ``` -------------------------------- ### Organize Library Source: https://github.com/simulot/immich-go/blob/main/docs/examples.md Stack burst photos and RAW+JPEG pairs, or perform a dry run to preview changes. ```bash # Stack burst photos and RAW+JPEG pairs immich-go stack \ --server=http://localhost:2283 \ --api-key=your-api-key \ --manage-burst=Stack \ --manage-raw-jpeg=StackCoverRaw \ --manage-heic-jpeg=StackCoverJPG ``` ```bash # Preview organization changes immich-go stack \ --server=http://localhost:2283 \ --api-key=your-api-key \ --manage-burst=Stack \ --manage-raw-jpeg=StackCoverRaw \ --dry-run ``` -------------------------------- ### Archive Directory Organization Example Source: https://github.com/simulot/immich-go/blob/main/docs/technical.md Illustrates a typical directory structure for archiving photos, organized by year and month. ```tree archive-folder/ β”œβ”€β”€ 2022/ β”‚ β”œβ”€β”€ 2022-01/ β”‚ β”‚ β”œβ”€β”€ IMG_001.jpg β”‚ β”‚ β”œβ”€β”€ IMG_001.jpg.JSON β”‚ β”‚ └── IMG_002.mp4 β”‚ └── 2022-02/ β”‚ └── ... β”œβ”€β”€ 2023/ β”‚ β”œβ”€β”€ 2023-01/ β”‚ └── 2023-02/ └── 2024/ β”œβ”€β”€ 2024-01/ └── 2024-02/ ``` -------------------------------- ### Immich-Go Command Structure Source: https://github.com/simulot/immich-go/blob/main/docs/commands/README.md Illustrates the general syntax for using Immich-Go commands, including global options, commands, sub-commands, and paths. ```bash immich-go [global-options] command sub-command [command-options] [path] ``` -------------------------------- ### Server Backup and Migration Use Cases Source: https://github.com/simulot/immich-go/blob/main/docs/commands/archive.md Commands for creating full server backups or preparing data for migration. ```bash immich-go archive from-immich \ --from-server=http://localhost:2283 \ --from-api-key=your-key \ --write-to-folder=/complete-backup ``` ```bash immich-go archive from-immich \ --from-server=http://localhost:2283 \ --from-api-key=your-key \ --write-to-folder=/migration-ready ``` -------------------------------- ### Clone the repository Source: https://github.com/simulot/immich-go/blob/main/CONTRIBUTING.md Initial step to create a local copy of the project. ```sh git clone https://github.com//immich-go.git cd immich-go ``` -------------------------------- ### Navigate to project directory Source: https://github.com/simulot/immich-go/blob/main/CONTRIBUTING.md Change the current working directory to the project root. ```sh cd immich-go ``` -------------------------------- ### Epson FastFoto Detection Example Source: https://github.com/simulot/immich-go/blob/main/docs/technical.md Shows how Epson FastFoto scanner outputs, including original, corrected, and back scans, are grouped. ```text Files: - photo-name.jpg (Original scan) - photo-name_a.jpg (Corrected scan) - photo-name_b.jpg (Back of photo) Stacking: All grouped with corrected (_a) as cover ``` -------------------------------- ### HEIC + JPEG Pairing Example Source: https://github.com/simulot/immich-go/blob/main/docs/technical.md Illustrates the pairing of HEIC and JPEG files, common with Apple devices, based on matching basenames. ```text Files: - IMG_1234.HEIC (Apple format) - IMG_1234.JPG (Compatible format) Detection: Same basename, different extensions ``` -------------------------------- ### Sync with develop branch Source: https://github.com/simulot/immich-go/blob/main/CONTRIBUTING.md Ensure your local 'develop' branch is up to date with the latest changes from the main repository before starting new work. ```shell git checkout develop git pull upstream develop ``` -------------------------------- ### Implement Backup Workflows Source: https://github.com/simulot/immich-go/blob/main/docs/best-practices.md Execute local archiving and offsite synchronization. ```bash # Local backup (Copy 2) immich-go archive from-immich \ --server=http://localhost:2283 \ --api-key=your-api-key \ --write-to-folder=/local-backup/immich # Offsite backup (Copy 3) - sync local backup to cloud rsync -av /local-backup/immich/ user@remote-server:/backups/immich/ ``` -------------------------------- ### Handling Wildcard Uploads Source: https://github.com/simulot/immich-go/blob/main/docs/misc/releases.md Immich-go now accepts '*.jpg' as a parameter for uploading files matching the pattern. ```bash immich-go "*.jpg" ``` -------------------------------- ### Google Photos JSON Metadata Structure Source: https://github.com/simulot/immich-go/blob/main/docs/technical.md Example of the JSON metadata format used by Google Photos that Immich-Go processes for image details. ```json { "title": "IMG_20230715_143025.jpg", "description": "Family vacation photo", "imageViews": "1", "creationTime": { "timestamp": "1689424225", "formatted": "Jul 15, 2023, 2:30:25 PM UTC" }, "geoData": { "latitude": 37.7749, "longitude": -122.4194, "altitude": 0.0, "latitudeSpan": 0.0, "longitudeSpan": 0.0 }, "people": [ { "name": "John Doe" } ] } ``` -------------------------------- ### Build Production-Ready immich-go Binary Source: https://github.com/simulot/immich-go/blob/main/GEMINI.md Builds a production-ready, statically linked immich-go binary. This is similar to CI builds and has fewer external dependencies. ```sh CGO_ENABLED=0 go build -ldflags="-s -w -extldflags=-static" -o immich-go main.go ``` -------------------------------- ### Handle Bursts Incrementally Source: https://github.com/simulot/immich-go/blob/main/docs/commands/stack.md Apply stacking rules incrementally, starting with burst photo management. This allows for focused testing and easier troubleshooting. ```bash # First, handle bursts immich-go stack --manage-burst=Stack --server=... --api-key=... ``` -------------------------------- ### Initialize Performance Chart with Chart.js Source: https://github.com/simulot/immich-go/blob/main/docs/concurrency/concurrency.html Uses the Chart.js library to render a line chart comparing Real, User, and System time against performance gains based on concurrent process counts. ```javascript document.addEventListener('DOMContentLoaded', () => { const ctx = document.getElementById('performanceChart').getContext('2d'); // Data extracted and converted from the uploaded file. const realTimeData = [135.894, 83.660, 73.339, 59.056, 53.401, 50.978, 52.683, 50.230, 52.204]; const userTimeData = [28.587, 28.489, 33.579, 32.258, 31.836, 31.978, 33.811, 33.574, 32.865]; const systemTimeData = [21.053, 21.773, 29.538, 25.384, 23.953, 24.865, 25.185, 24.492, 25.004]; const baselineRealTime = realTimeData[0]; const performanceGainData = realTimeData.map(time => baselineRealTime / time); const data = { labels: [1, 2, 5, 6, 9, 12, 18, 24, 48], datasets: [ { label: 'Real Time', data: realTimeData, yAxisID: 'yTime', backgroundColor: 'rgba(59, 130, 246, 0.6)', borderColor: 'rgba(59, 130, 246, 1)', borderWidth: 2, pointBackgroundColor: 'rgba(29, 78, 216, 1)', pointBorderColor: '#ffffff', pointRadius: 6, pointHoverRadius: 8, tension: 0.3, fill: false }, { label: 'User Time', data: userTimeData, yAxisID: 'yTime', backgroundColor: 'rgba(16, 185, 129, 0.6)', borderColor: 'rgba(16, 185, 129, 1)', borderWidth: 2, pointBackgroundColor: 'rgba(5, 150, 105, 1)', pointBorderColor: '#ffffff', pointRadius: 6, pointHoverRadius: 8, tension: 0.3, fill: false }, { label: 'System Time', data: systemTimeData, yAxisID: 'yTime', backgroundColor: 'rgba(249, 115, 22, 0.6)', borderColor: 'rgba(249, 115, 22, 1)', borderWidth: 2, pointBackgroundColor: 'rgba(234, 88, 12, 1)', pointBorderColor: '#ffffff', pointRadius: 6, pointHoverRadius: 8, tension: 0.3, fill: false }, { label: 'Performance Gain', data: performanceGainData, yAxisID: 'yGain', backgroundColor: 'rgba(139, 92, 246, 0.6)', borderColor: 'rgba(139, 92, 246, 1)', borderWidth: 2, pointBackgroundColor: 'rgba(109, 40, 217, 1)', pointBorderColor: '#ffffff', pointRadius: 6, pointHoverRadius: 8, tension: 0.3, fill: false } ] }; // Chart configuration const config = { type: 'line', data: data, options: { responsive: true, maintainAspectRatio: false, scales: { x: { title: { display: true, text: 'Number of Concurrent Processes', font: { size: 16, weight: 'bold' }, color: '#4b5563' }, ticks: { color: '#6b7280' } }, yTime: { type: 'linear', position: 'left', beginAtZero: true, title: { display: true, text: 'Time (seconds)', font: { size: 16, weight: 'bold' }, color: '#4b5563' }, ticks: { color: '#6b7280' } }, yGain: { type: 'linear', position: 'right', beginAtZero: true, grid: { drawOnChartArea: false, // only want the grid lines for the left axis }, title: { display: true, text: 'Performance Gain (x)', font: { size: 16, weight: 'bold' }, color: '#4b5563' }, ticks: { color: '#6b7280' } } }, plugins: { legend: { display: true, position: 'top', labels: { color: '#1f2937' } }, tooltip: { mode: 'index', intersect: false, callbacks: { label: function(context) { let label = context.dataset.label || ''; if (label) { label += ': '; } if (context.parsed.y !== null) { if (context.dataset.label === 'Performance Gain') { label += context.parsed.y.toFix ``` -------------------------------- ### Set Concurrent Uploads to 8 Source: https://github.com/simulot/immich-go/blob/main/readme-old.md Use the --concurrent-uploads flag to specify the number of files to upload simultaneously. This example sets it to 8 for faster processing. ```bash immich-go upload from-folder --server=http://your-ip:2283 --api-key=your-api-key --concurrent-uploads=8 /path/to/your/photos ``` -------------------------------- ### Build immich-go Application Source: https://github.com/simulot/immich-go/blob/main/GEMINI.md Builds the immich-go application from source. Use this for general development builds. ```sh go build -o immich-go main.go ``` -------------------------------- ### Define configuration file Source: https://github.com/simulot/immich-go/blob/main/docs/releases/release-notes-v0.29.0.md Manage server settings using a YAML configuration file to simplify command-line execution. ```yaml server: https://immich.example.com api-key: your-api-key concurrency: 10 ``` -------------------------------- ### Add Immich-Go to System PATH Source: https://github.com/simulot/immich-go/blob/main/docs/installation.md Make the immich-go binary accessible from any directory by moving it to a system PATH location. This step is optional. ```bash # Linux/macOS/FreeBSD - Add to system PATH sudo mv immich-go /usr/local/bin/ # Windows - Move immich-go.exe to a directory in your PATH # Or add the current directory to your system PATH ``` -------------------------------- ### Upload Configuration Patterns Source: https://context7.com/simulot/immich-go/llms.txt Various CLI configurations for handling different upload scenarios, including logging, performance tuning, and SSL verification. ```bash immich-go upload from-folder \ --server=http://localhost:2283 \ --api-key=your-api-key \ --log-file=/var/log/immich-go/upload.log \ --no-ui \ --on-errors=continue \ /photos ``` ```bash immich-go upload from-folder \ --server=http://localhost:2283 \ --api-key=your-api-key \ --concurrent-tasks=16 \ --client-timeout=30m \ --pause-immich-jobs=true \ /large/photo/collection ``` ```bash immich-go upload from-folder \ --server=http://localhost:2283 \ --api-key=your-api-key \ --concurrent-tasks=1 \ --client-timeout=120m \ --on-errors=continue \ /photos ``` ```bash immich-go upload from-folder \ --server=https://immich.local \ --api-key=your-api-key \ --skip-verify-ssl \ /photos ``` -------------------------------- ### Cleanup Immich E2E Instance Script Source: https://github.com/simulot/immich-go/blob/main/scripts/e2e/README.md Performs a complete cleanup of an Immich e2e test instance, including containers, volumes, and the installation directory. May require sudo for root-owned volumes. ```bash ./scripts/e2e/immich-cleanup.sh ./internal/e2e/testdata/immich-server ``` -------------------------------- ### Set Concurrent Uploads to 1 Source: https://github.com/simulot/immich-go/blob/main/readme-old.md Use the --concurrent-uploads flag to specify the number of files to upload simultaneously. This example sets it to 1 for maximum stability, effectively disabling parallel uploads. ```bash immich-go upload from-folder --server=http://your-ip:2283 --api-key=your-api-key --concurrent-uploads=1 /path/to/your/photos ``` -------------------------------- ### Import Google Takeout with RAW/JPEG Stacking Source: https://github.com/simulot/immich-go/blob/main/readme-old.md Imports Google Photos takeout archives while stacking JPEG and RAW files, setting the RAW file as the cover. ```bash immich-go upload from-google-photos --server=http://your-ip:2283 --api-key=your-api-key --manage-raw-jpeg=StackCoverRaw /path/to/your/takeout-*.zip ``` -------------------------------- ### Make Immich-Go Executable Source: https://github.com/simulot/immich-go/blob/main/docs/installation.md On Linux and macOS, if you encounter a 'Permission denied' error, use chmod +x to grant execute permissions to the immich-go binary. ```bash chmod +x immich-go ``` -------------------------------- ### Google Photos Takeout upload report example Source: https://github.com/simulot/immich-go/blob/main/docs/misc/releases.md This report details the outcome of processing a Google Photos Takeout archive, showing counts for scanned, handled, uploaded, duplicated, and discarded files, along with specific reasons for unhandled files. ```text Upload report: 53998 scanned files 53993 handled files 26937 metadata files 535 uploaded files on the server 49 upgraded files on the server 1540 duplicated files in the input 8382 files already on the server 77 discarded files because in folder failed videos 1 discarded files because of options 16470 discarded files because server has a better image 1 files type not supported 1 errors 5 files without metadata file 7 files can't be handled File: Takeout/Google Photos/Photos from 2019/1556189729458-8d2e2d13-bca5-467e-a242-9e4cb238e(1).jpg File unhandled, missing JSON File: Takeout/Google Photos/Photos from 2022/original_1d4caa6f-16c6-4c3d-901b-9387de10e528_P(1).jpg File unhandled, missing JSON File: Takeout/Google Photos/Photos from 2022/original_af12c386-e334-4c57-88be-fdfadea71f16_P(1).jpg File unhandled, missing JSON File: Takeout/Google Photos/Photos from 2022/original_ec8d7b93-cbec-49c8-8707-38841db5e37d_P(1).jpg File unhandled, missing JSON File: Takeout/Google Photos/Photos from 2023/original_d3671642-c937-49c0-917a-8ef9cbb449c5_P(1).jpg File unhandled, missing JSON File: Takeout/Google Photos/user-generated-memory-titles.json Error , json: cannot unmarshal array into Go struct field GoogleMetaData.title of type string File: Takeout/archive_browser.html File type not supported Done. ``` -------------------------------- ### Perform Full Migration from Google Photos Source: https://github.com/simulot/immich-go/blob/main/docs/best-practices.md Initiate a full migration from Google Photos takeout archives, specifying concurrent tasks and logging. ```bash # Complete migration with monitoring immich-go upload from-google-photos \ --session-tag \ --tag="Migration/Full" \ --concurrent-tasks=8 \ --log-file=/var/log/migration.log \ --server=... --api-key=... /takeout-*.zip ``` -------------------------------- ### Run PowerShell Script to Get ZIP Contents (Windows) Source: https://github.com/simulot/immich-go/blob/main/docs/misc/how-to-send-debug-data.md Execute the ZipContents.ps1 script to generate a file list from ZIP archives. Specify the directory containing the ZIP files and the desired output file path. Ensure PowerShell execution policy is bypassed for script execution. ```powershell powershell -ExecutionPolicy Bypass -File .\ZipContents.ps1 -Path "C:\Path\To\Zips" -OutputFile "C:\Path\To\Zips\ZipContents.txt" ``` -------------------------------- ### Organization Strategy - Hybrid Approach Source: https://github.com/simulot/immich-go/blob/main/docs/best-practices.md Combine folder-based albums and date-based tags for a flexible organization strategy. ```bash # Combine albums and tags strategically immich-go upload from-folder \ --folder-as-album=PATH \ --folder-as-tags=true \ --tag="Import/$(date +%Y-%m)" \ --server=... --api-key=... /photos/ ``` -------------------------------- ### Archive Photos Before Stacking Source: https://github.com/simulot/immich-go/blob/main/docs/commands/stack.md Before performing major organization tasks like stacking, consider backing up your photos using the `archive` command. This provides a safety net. ```bash immich-go archive from-immich --write-to-folder=/backup --server=... --api-key=... ``` -------------------------------- ### Execute a Pilot Migration Batch Source: https://github.com/simulot/immich-go/blob/main/docs/best-practices.md Upload a subset of real data for a pilot migration, using session tags and a specific tag for identification. ```bash # Subset of real data immich-go upload from-folder \ --session-tag \ --tag="Migration/Pilot" \ --server=... --api-key=... /pilot-batch/ ``` -------------------------------- ### Run immich-go Application Source: https://github.com/simulot/immich-go/blob/main/GEMINI.md Executes the immich-go application. Use this to view help or run commands. ```sh ./immich-go --help ``` -------------------------------- ### Basic Immich-Go Upload Commands Source: https://github.com/simulot/immich-go/blob/main/readme.md Use these commands to upload photos from different sources to your Immich server. Ensure you replace placeholders with your server details and API key. The `--ban-file` option can be used to exclude specific files or directories. ```bash immich-go upload from-folder --server=http://your-ip:2283 --api-key=your-api-key /path/to/your/photos ``` ```bash immich-go upload from-google-photos --server=http://your-ip:2283 --api-key=your-api-key /path/to/takeout-*.zip ``` ```bash immich-go archive from-immich --from-server=http://your-ip:2283 --from-api-key=your-api-key --write-to-folder=/path/to/archive ``` -------------------------------- ### Configure Immich-Go Logging and UI Source: https://github.com/simulot/immich-go/blob/main/docs/best-practices.md Set log level, log file path, and disable the UI for automated operations. ```bash --log-level=WARN \ --log-file=/var/log/immich-go/automated.log \ --no-ui ``` -------------------------------- ### Test Stacking Rules Without Changes Source: https://github.com/simulot/immich-go/blob/main/docs/commands/stack.md Use the `--dry-run` flag to preview how immich-go would stack files without making any actual changes. This is crucial for testing configurations. ```bash immich-go stack \ --server=http://localhost:2283 \ --api-key=your-key \ --manage-burst=Stack \ --manage-raw-jpeg=StackCoverRaw \ --dry-run ``` -------------------------------- ### Performance Optimization - NAS or Low-Power Server Source: https://github.com/simulot/immich-go/blob/main/docs/best-practices.md Configuration for minimal resource usage on NAS or low-power servers. ```bash # Minimal resource usage --concurrent-tasks=1-2 --pause-immich-jobs=true --client-timeout=180m ``` -------------------------------- ### Upload from Folder Usage Source: https://github.com/simulot/immich-go/blob/main/docs/commands/upload.md This command uploads files from a specified local folder. Ensure the path is correct and any necessary options are provided. ```bash immich-go upload from-folder [options] ``` -------------------------------- ### Monitor Server Resources Source: https://github.com/simulot/immich-go/blob/main/docs/best-practices.md Utilize system monitoring tools like htop, iotop, and nethogs to observe server resource usage during uploads. ```bash # Monitor server resources during upload Π³Ρ€Π°Ρ„ΠΈΠΈ iotop nethogs ``` -------------------------------- ### Performance Optimization - Internet Connection Source: https://github.com/simulot/immich-go/blob/main/docs/best-practices.md Adaptive configuration for variable speed internet connections, balancing performance and stability. ```bash # Adaptive configuration --concurrent-tasks=4-8 --client-timeout=60m --on-errors=continue ``` -------------------------------- ### Basic Immich-Go Command Syntax Source: https://github.com/simulot/immich-go/blob/main/docs/installation.md The general structure for running Immich-Go commands involves the main command, a sub-command, optional flags, and a target path. ```bash immich-go command sub-command [options] [path] ```