feat: add login and sync commands#1297
feat: add login and sync commands#1297grauschnabel wants to merge 24 commits intosimulot:developfrom
Conversation
release: v0.31.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v5...v6) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v4...v5) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v4...v6) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](actions/github-script@v7...v8) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…s/actions/setup-go-6 chore(deps): bump actions/setup-go from 5 to 6
…s/actions/upload-artifact-5 chore(deps): bump actions/upload-artifact from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…s/actions/checkout-6 chore(deps): bump actions/checkout from 4 to 6
…s/actions/setup-node-6 chore(deps): bump actions/setup-node from 4 to 6
…s/actions/github-script-8 chore(deps): bump actions/github-script from 7 to 8
updated flags to match program
Update archive.md
- `immich-go login`: interactive credential storage to ~/.config/immich-go/config.yaml - `immich-go sync down`: download server assets to local directory with state tracking - `immich-go sync up`: upload local assets to server with checksum-based dedup - Config layering: global config → local config → CLI flags with flat-key fallback - Sync state: atomic writes, lock files, server/user validation, batch saves - Delete safeguards: only tracked assets, confirmation for >10 deletions - Graceful Ctrl+C: saves state and releases lock on interrupt - Dry-run: no state written, all actions logged to stdout Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New docs/commands/login.md and docs/commands/sync.md - Updated command reference, docs hub, readme, and configuration docs - Fix: Ctrl+C no longer shows "context canceled" error and usage text Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Thanks for the PR and for contributing to To help me better understand the context of these changes, could you please provide a brief overview of your motivation and the specific use case this addresses? In the meantime, please consider the following technical requirements for this PR: Branching: All PRs should be targeted against the End-to-End (e2e) Testing: While unit tests are necessary, e2e tests are welcomed to validate logic against a live test server. Please add new test cases in ./internal/e2e/client. Edge Cases: Ensure you account for scenarios where Immich handles multiple assets with identical filenames and capture dates. Cross-Platform Validation: These tests run on both Linux and Windows runners to catch OS-specific bugs, such as improper usage of Once these items are addressed, I'll be happy to do a deeper dive into the code. Looking forward to your updates! |
Motivation & Use CasesWhy
|
- Extract asset matching algorithm into internal/assetmatch package with shared AdviceCode types, CompareDate(), and Index for both upload and sync commands - Upgrade sync up from SHA1-only to full 2-phase matching (checksum → name+date±5s+size), handling SmallerOnServer case - Add CaptureDate to syncstate.AssetEntry (omitzero for compat) - Refactor upload advice.go to import shared types from assetmatch - Add E2E tests for sync up/down (basic + idempotency) - Add unit tests for assetmatch decision matrix and syncstate migration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
immich-go login: Interactive credential storage to~/.config/immich-go/config.yamlwith server validation and API key verificationimmich-go sync down: Download server assets to local directory with checksum-based state tracking, atomic writes, andYYYY/YYYY-MM/directory structureimmich-go sync up: Upload local assets to server with robust dedup (SHA1 → name+date±5s+size matching via sharedassetmatchpackage)server/api-keyfrom global config work for all subcommands--forceto bypassdocs/commands/login.mdanddocs/commands/sync.md, updated README, command reference, and configuration docsTest plan
go build ./...passesgo test -race ./internal/syncstate/...— 10 tests pass (incl. CaptureDate migration + roundtrip)go test -race ./internal/assetmatch/...— 13 tests pass (dedup decision matrix)golangci-lint run— 0 new issuesimmich-go login→ credentials saved and reused by subsequent commandsimmich-go sync down -d /tmp/test --dry-run→ shows planned downloads on stdoutimmich-go sync down -d /path→ downloads assets, creates stateimmich-go sync up -d /pathimmich-go sync down --delete --dry-run🤖 Generated with Claude Code