feat(storage): add storage zone and file commands with S3 credentials#98
Conversation
🦋 Changeset detectedLatest commit: 26cbbe5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
||
| # Files: list, upload, download, delete (paths are relative to the zone root) | ||
| bunny storage file list my-zone | ||
| bunny storage file list my-zone images/ |
There was a problem hiding this comment.
when dir doesn't exist it says Directory is empty. maybe a more accurate error message would be nicer. the current one implies the dir exists but empty.
There was a problem hiding this comment.
I don't think we know either way here, unless something changed in the API recently. I discovered this while working on bunny-upload/file-manager. We could instead return No files found at "images/". The path may be empty or not exist though, wdyt?
| bunny storage file list my-zone images/ | ||
| bunny storage file upload my-zone ./photo.png --to images/ | ||
| bunny storage file upload my-zone ./photo.png --checksum --content-type image/png | ||
| bunny storage file download my-zone images/photo.png --out ./local.png |
There was a problem hiding this comment.
this doesn't work for me. it gets stuck on downloading and blocks the process.
There was a problem hiding this comment.
@amir-at-bunny can you check with the latest this works as you expect.
|
@codex review |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2eb4f25d96
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ): string[] { | ||
| const primary = primaryCode?.toUpperCase(); | ||
| const normalized = regions | ||
| .map((region) => region.trim().toUpperCase()) |
There was a problem hiding this comment.
Split comma-separated replication regions
The new examples use --replication LA,SG, but the parser passes that as one array element, and this normalization only trims/uppercases each element before validating it. As a result LA,SG is checked as a single region code and rejected as unknown, so the documented creation/update form fails unless users repeat the flag; split each entry on commas before validation or change the documented syntax.
Useful? React with 👍 / 👎.
| }; | ||
| } | ||
|
|
||
| if (output === "json") { |
There was a problem hiding this comment.
Add the requested domain before returning JSON
When bunny storage zones add ... --domain <host> --output json is used, --domain already made the pull zone get created, but this JSON branch returns before the custom-domain block below runs. The command therefore reports success while silently skipping the explicit domain the user asked to attach; perform the non-interactive hostname add before this return and include its result/error in the JSON payload.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@greptile-apps re-review |
Greptile SummaryThis PR adds the experimental
Confidence Score: 4/5Safe to merge with one documentation fix: the new README section explicitly documents the opposite secret-handling behaviour from what credentials.ts now implements. The credentials command was fixed (correctly) to mask the secret in JSON output, but the README written in the same PR tells users and automation scripts that --output json always emits the full secret. Any script following the documentation — e.g. piping JSON to jq — will silently receive a bullet-masked string rather than the real secret and need an undocumented --show-secret flag to work. packages/cli/README.md (line ~330) needs to be updated to reflect that --output json respects --show-secret just like the table output does; AGENTS.md line ~68 has the same stale claim. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[bunny storage zones credentials] --> B{--format?}
B -- yes --> C[renderS3ToolConfig\nalways full secret]
B -- no --> D{--output json?}
D -- yes --> E{--show-secret?}
E -- yes --> F[JSON with full secret]
E -- no --> G[JSON with masked secret]
D -- no --> H{--show-secret?}
H -- yes --> I[Table with full secret]
H -- no --> J[Table with masked secret]
style C fill:#90EE90
style F fill:#90EE90
style G fill:#FFD700,stroke:#FF8C00
style I fill:#90EE90
style J fill:#FFD700,stroke:#FF8C00
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[bunny storage zones credentials] --> B{--format?}
B -- yes --> C[renderS3ToolConfig\nalways full secret]
B -- no --> D{--output json?}
D -- yes --> E{--show-secret?}
E -- yes --> F[JSON with full secret]
E -- no --> G[JSON with masked secret]
D -- no --> H{--show-secret?}
H -- yes --> I[Table with full secret]
H -- no --> J[Table with masked secret]
style C fill:#90EE90
style F fill:#90EE90
style G fill:#FFD700,stroke:#FF8C00
style I fill:#90EE90
style J fill:#FFD700,stroke:#FF8C00
Reviews (8): Last reviewed commit: "secret fix" | Re-trigger Greptile |
|
We should also prompt before adding a replica that it cannot later be removed. |
# Conflicts: # AGENTS.md # bun.lock
# Conflicts: # bun.lock # packages/cli/src/cli.ts
No description provided.