feat(cli): add device approval and watch positions - #57
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds new CLI surfaces to support agent-driven device-code approval and file watch-position (“start-from”) workflows, integrating them with the existing Effect-based command infrastructure, output contracts, and consumer-facing guidance.
Changes:
- Introduce
auth approve <code>with--jsonand--dry-run, mapping to the SDKauth.linkDevice. - Add
files start-from get|set|resetcommands with field selection on reads and dry-run + raw JSON input on writes. - Update command metadata, i18n strings, tests, and consumer reference docs/README to reflect the new command surface.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/commands/auth.ts | Adds auth approve command with schema validation, dry-run planning, and SDK call wiring. |
| src/commands/files.ts | Adds `files start-from get |
| src/internal/command-specs.ts | Adds integerArgument helper for command metadata. |
| src/i18n/catalog/en.ts | Adds terminal messages and metadata descriptions for new commands. |
| src/internal/metadata.test.ts | Updates describe/metadata expectations to include the new commands. |
| src/command-paths.test.ts | Adds command-path tests for approval and start-from read/write flows. |
| src/test-support/command-path-mocks.ts | Extends SDK mock surface for linkDevice and start-from operations. |
| src/cli.test.ts | Verifies JSON metadata shape includes the new command inputs. |
| skills/putio-cli/references/auth.md | Documents the new auth approve flow for consumers/agents. |
| skills/putio-cli/references/reads.md | Documents files start-from get and its field/output contract. |
| skills/putio-cli/references/writes.md | Documents dry-run/write examples for start-from and approve. |
| README.md | Adds user-facing examples for device approval and watch-position commands. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
putio-releaser Bot
added a commit
that referenced
this pull request
Aug 11, 2026
## [1.3.0](v1.2.7...v1.3.0) (2026-08-11) ### Features * **cli:** add device approval and watch positions ([#57](#57)) ([4eb1d9e](4eb1d9e))
Contributor
|
🎉 This PR is included in version 1.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #53
Closes #55
Changed
auth approve <code>maps to the SDKauth.linkDeviceoperationfiles start-from get|set|resetmap to the existing SDK watch-position operations--jsonand--dry-run; the read supports--fieldsReview aids
putio auth approve PUTIO1 --dry-run --output json{"command":"auth approve","dryRun":true,"request":{"code":"PUTIO1"}}putio files start-from set 42 95 --dry-run --output json{"command":"files start-from set","dryRun":true,"request":{"file_id":42,"time":95}}putio files start-from get 42 --fields start_from --output jsonstart_fromRisks
Verification
pnpm exec vp run verifydist/bin.mjs describecontract inspectionComplexity
Summary by cubic
Adds
auth approveto link a device code with the authenticated account andfiles start-from get|set|resetto read and manage saved watch positions. Supports positional args or raw--json, with dry-run previews and field selection on reads.auth approve <code>calls SDKauth.linkDevice; trims whitespace and rejects codes containing?or#.files start-from get <file-id>returns{ file_id, start_from }; supports--fields.files start-from set <file-id> <seconds>andfiles start-from reset <file-id>map to SDK watch-position ops; support--jsonand--dry-run.file_idmust be a positive integer;secondsmust be a non-negative integer.Written for commit 1979d37. Summary will update on new commits.