bun-s3-uploader
v1.0.3
Published
A lightning-fast command-line utility for uploading files to Linode Object Storage (and other S3-compatible providers) built with [Bun](https://bun.sh).
Readme
BunS3 🚀
A lightning-fast command-line utility for uploading files to Linode Object Storage (and other S3-compatible providers) built with Bun.
Features
- Interactive Setup: Simple one-time configuration for your S3 credentials.
- Smart Defaults: Saves your preferred bucket, region, and key prefix.
- Security by Default: Option to add random suffixes to filenames to prevent collisions and guessable URLs.
- Path Cleanup: Automatically handles double slashes and leading slashes for clean S3 keys.
- Public/Private Toggle: Quickly choose if your file should be publicly accessible.
Installation
bun add -g bun-s3-uploader
# or
npm install -g bun-s3-uploaderQuick Start
Run the uploader with any file:
buns3 my-image.pngFirst-time Configuration: On your first run, the tool will prompt you for:
- Linode Access Key ID
- Linode Secret Access Key
- Default Bucket Name
- Region (e.g.,
us-iad-1) - Default Key Prefix (e.g.,
uploads/)
These are stored securely in
~/.buns3rc.Interactive Upload: Follow the prompts to customize the remote path, filename, and visibility.
Usage
# Basic usage
buns3 <file-path>
# Example
buns3 ./vacation-photo.jpgConfiguration
Your configuration is stored in ~/.buns3rc. You can edit this file directly if you need to change your keys or default bucket.
{
"accessKeyId": "YOUR_KEY",
"secretAccessKey": "YOUR_SECRET",
"bucket": "my-cool-bucket",
"region": "us-iad-1",
"endpoint": "https://us-iad-1.linodeobjects.com",
"defaultKeyPrefix": "images/"
}Development
If you'd like to run it locally or contribute:
- Clone the repo
- Install dependencies:
bun install - Link the binary:
bun link - Run:
buns3 <file>
License
MIT
