feat(cli): add local file upload - #58
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new write-path to the put.io CLI for uploading a readable local regular file into put.io, with profile-aware auth, input validation, dry-run planning, and describe/agent documentation updates.
Changes:
- Introduces
putio files upload(flags + raw JSON input) that validates local path + optional parent ID + optional remote filename, and uploads viasdk.files.upload. - Adds local upload preparation helper (
prepareLocalUpload) plus new input validator (validateLocalPathInput), i18n strings, and terminal rendering for upload results. - Extends command metadata/describe coverage, command-path mocks, and adds command-path + renderer tests; updates README + skills guardrails/references.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test-support/command-path-mocks.ts | Adds files.upload SDK mock and reset behavior for command-path tests. |
| src/internal/metadata.test.ts | Ensures files upload appears in the describe/metadata command list. |
| src/internal/local-upload.ts | New helper to resolve/validate a local regular file and create a Blob for upload. |
| src/internal/command.ts | Adds validateLocalPathInput for local path safety checks. |
| src/i18n/catalog/en.ts | Adds upload-related loader + terminal strings and metadata description. |
| src/commands/files.ts | Implements files upload, dry-run plan output, upload invocation, and command specs entry. |
| src/commands/files.test.ts | Tests terminal rendering for upload responses (file vs queued transfer). |
| src/command-paths.test.ts | Adds end-to-end command-path tests for upload, dry-run, and validation failures. |
| src/cli.test.ts | Validates describe exposes the expected JSON schema properties for files upload. |
| skills/putio-cli/references/writes.md | Documents upload usage patterns for write commands and dry-run. |
| skills/putio-cli/references/guardrails.md | Updates guardrails to mention local upload path validation expectations. |
| README.md | Adds a user-facing example for putio files upload. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
All reported issues were addressed across 12 files
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
## [1.4.0](v1.3.0...v1.4.0) (2026-08-11) ### Features * **cli:** add local file upload ([#58](#58)) ([28f6b43](28f6b43))
|
🎉 This PR is included in version 1.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Add a safe, profile-aware
files uploadcommand backed by the TypeScript SDK.Closes #54.
Changed
Blobintosdk.files.uploadputio describeand document agent guardrailsReview aids
flowchart LR A["flags or JSON"] --> B["validate path and destination"] B --> C["resolve regular readable file"] C --> D{"dry-run?"} D -- yes --> E["emit request plan"] D -- no --> F["shared authenticated SDK"] F --> G["files.upload with file-backed Blob"]Risks
The file contents are consumed lazily by the SDK request. The command resolves the path and checks regular-file/read access first, but a file changed after validation can still fail at upload time and is reported through the existing SDK error boundary.
Verification
pnpm exec vp run verifyREADME.mdgpt-5.6-sol, high reasoning, native isolation, web disabled; two boundary findings fixed, rerun clean at 0.86 confidenceComplexity
O(1) CLI memory for file content; the SDK consumes a file-backed
Blobinstead of eagerly buffering the file.Summary by cubic
Add
putio files uploadto send a readable local file to put.io with an optional parent folder and remote filename. Supports dry-run and JSON input, validates inputs up front, and streams via a file-backedBlobto keep memory use low.New Features
putio files upload--path,--parent-id,--file-name,--json,--dry-run,--outputparent-idbefore callingsdk.files.uploadsdk.files.upload; adds clear loader and terminal feedback for direct file or queued transfer resultsdescribemetadata (JSON input schema), i18n strings, and guardrails/writes referencesBug Fixes
parent-id, and SDK failure propagationWritten for commit 78cdc0f. Summary will update on new commits.