Repository navigation
feat(google): add import google and export google commands - #90
Conversation
`rawback import google` connects the Google account when needed, opens Google Photos' own picker, shows what was picked (videos are skipped), confirms, starts the server-side import and watches it to the end. `rawback export google` validates one selection (--all, --from/--to, --album, --image/--images-file) with --include-secret, --include-archived, --no-skip-exported, --album-title/--no-album and --file original|fullsize, previews it (--dry-run stops there), confirms and watches the export. Both take --yes, --no-wait and --json. `rawback google` adds status, connect, disconnect, jobs, job <id> (--watch, --items) and cancel <id>. Links, progress and prompts never touch stdout under --json, which needs --yes because it cannot prompt. The server's Google Photos reasons map to the command to run next. Ctrl-C while waiting ends an unused picker session, or stops watching and leaves the job running, and exits 130. Upload sessions from an import are labelled GOOGLE PHOTOS in `rawback uploads`. Requires @rawback/sdk 0.3.5 for its Google Photos service; bun.lock is regenerated once that version is published. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nohf85JZVW1mqMnV17KH6o
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
/claude review Generated by Claude Code |
|
Claude finished @AnnatarHe's task in 25s —— View job Review of #90:
|
…e starting - `export google --dry-run` now refuses a selection over maxExportItems exactly as the real run does, since a dry run is how a selection is checked. - Ctrl-C while the server starts an import or export now says the job may have started anyway and points at `rawback google jobs`; the picker session is still left alone, because the import may be using it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nohf85JZVW1mqMnV17KH6o
|
Thanks for the review. Going through each point:
Generated by Claude Code |
0.3.5 is published, so the frozen install resolves again. The lockfile also stops pinning 0.3.3 under a package.json that already asked for 0.3.4 on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nohf85JZVW1mqMnV17KH6o
Summary
Adds Google Photos import and export to the CLI, built on the SDK's new
services.googlePhotos(rawback-app/sdk#53), which wraps the server API from rawback-app/server#478.rawback import google [--yes] [--no-wait] [--json]: connects the Google account if needed (it prints the authorization link to stderr, opens the browser, and waits for the server to report the account). It then opens Google Photos' own picker, waits for the picks, and shows what was picked, including how many videos will be skipped and the fact that Google withholds GPS. After you confirm, it starts the server-side import and watches it to the end. The import runs through the same pipeline as an SFTP upload, and its upload session appears asGOOGLE PHOTOSinrawback uploads.rawback export google: takes one selection, either--all(the default),--from/--to,--album <id>(repeatable), or--image <id>(repeatable) together with--images-file <path|->. Options are--include-secret,--include-archived,--no-skip-exported,--album-title <title>(default "Rawback"),--no-album,--file original|fullsize,--dry-run,--yes,--no-waitand--json. It shows the server's preview (count, size, already exported), confirms, starts, and watches.rawback google status | connect | disconnect [--yes] | jobs [--kind --limit --offset] | job <id> [--items --limit --offset --watch] | cancel <id>:connectis the command the error messages point to, andjob <id> --watchresumes a--no-waitrun.Behaviour:
--jsonkeeps stdout to machine-readable output only; links, progress and prompts go to stderr.--jsoncan't prompt, it requires--yes(--dry-runalso works for export).rawback google connectto reconnect."Docs: README quick start and
docs/commands.md.docs/configuration.mdis unchanged, because nothing new is stored under~/.rawback/; the Google grant lives on the server.package.jsonnow pins@rawback/sdkto0.3.5. That is the version release-please will publish from the SDK PR'sfeatcommit (bump-patch-for-minor-pre-major), and it doesn't exist on npm yet. CI'sbun install --frozen-lockfilewill fail until 0.3.5 is published. After that, runbun installand commit the regeneratedbun.lock. I deliberately didn't commit a lockfile that points at a local path or a guessed integrity hash.Note:
bun.lockatmainalready pins@rawback/sdk@0.3.3whilepackage.jsonsays0.3.4, so the frozen install was already out of step before this change. Regenerating the lockfile after 0.3.5 is published fixes both.Testing
node_modules/@rawback/sdk, without changing the committed files. Against that build,bun run check(typecheck, test, lint, format:check, build) exits 0 with 715 tests across 46 files.test/google-photos.test.ts, covering the connect, pick, import and export flows, cancellation, reason mapping and output. There are also 8 spawn-based help and validation tests intest/commands-cli.test.ts, covering selection conflicts, an invalid--file, bad dates, and--jsonwithout--yes../dist/rawback --versionprints1.0.15, matchingpackage.json, so the CI version assertion holds.🤖 Generated with Claude Code
https://claude.ai/code/session_01Nohf85JZVW1mqMnV17KH6o
Generated by Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.