cloudbridge-cli
v1.3.5
Published
CLI tool for uploading files and folders to CloudBridge
Readme
CloudBridge CLI
A simple command-line tool for uploading files and folders to CloudBridge. It supports authentication, recursive folder uploads, and preserves directory structure.
🚀 Installation
npm install -g cloudbridge-cliIf you published under a scope (e.g., @nugitech/cloudbridge-cli):
npm install -g @nugitech/cloudbridge-cli🔑 Authentication
Before uploading, save your CloudBridge credentials:
cloudbridge auth --access-key YOUR_ACCESS_KEY --secret-key YOUR_SECRET_KEYThis stores credentials securely in:
- Windows:
%USERPROFILE%\.cloudbridge.json - macOS/Linux:
~/.cloudbridge.json
📤 Upload Files & Folders
Upload a single file
Windows:
cloudbridge upload C:\path\to\report.pdf --folder docsmacOS/Linux:
cloudbridge upload /path/to/report.pdf --folder docsUpload an entire folder (recursive)
Windows:
cloudbridge upload C:\path\to\public --folder publicmacOS/Linux:
cloudbridge upload /path/to/public --folder publicThis will upload all files from the public directory while preserving the directory structure. For example, if you have /path/to/public/images/logo.png, it will be uploaded to public/images/logo.png.
Upload multiple files and folders
Windows:
cloudbridge upload C:\path\to\images C:\path\to\docs C:\path\to\readme.md --folder backupmacOS/Linux:
cloudbridge upload /path/to/images /path/to/docs /path/to/readme.md --folder backup⚙️ How It Works
- Credentials are stored locally (Windows:
%USERPROFILE%\.cloudbridge.json, macOS/Linux:~/.cloudbridge.json) - Each upload request includes:
- x-access-key header
- x-signature header (HMAC-SHA256 of your access key using secret key)
- Files are streamed via
multipart/form-data - Directory structure is preserved during upload
- Recursive directory scanning is supported
API endpoint used:
POST https://api.cloudbridge.nugitech.com/api/v1/public/upload📌 Example Output
🔐 Reading credentials from: ~/.cloudbridge.json
✅ Credentials loaded successfully
🔍 Searching in paths: ["/path/to/public"]
📂 Processing directory: /path/to/public
Found 5 files in /path/to/public
📦 Processing 5 files...
📝 Mapping: /path/to/public/images/logo.png → public/images
📤 Uploading images/logo.png to public/images...
✅ Uploaded images/logo.png → public/images📄 License
MIT © 2024 Nugitech
