CLI tool for uploading files and folders to CloudBridge
npm install cloudbridge-cliA simple command-line tool for uploading files and folders to CloudBridge.
It supports authentication, recursive folder uploads, and preserves directory structure.
``bash`
npm install -g cloudbridge-cli
If you published under a scope (e.g., @nugitech/cloudbridge-cli):
`bash`
npm install -g @nugitech/cloudbridge-cli
Before uploading, save your CloudBridge credentials:
`bash`
cloudbridge auth --access-key YOUR_ACCESS_KEY --secret-key YOUR_SECRET_KEY
This stores credentials securely in:
- Windows: %USERPROFILE%\.cloudbridge.json~/.cloudbridge.json
- macOS/Linux:
Windows:
`bash`
cloudbridge upload C:\path\to\report.pdf --folder docs
macOS/Linux:
`bash`
cloudbridge upload /path/to/report.pdf --folder docs
Windows:
`bash`
cloudbridge upload C:\path\to\public --folder public
macOS/Linux:
`bash`
cloudbridge upload /path/to/public --folder public/path/to/public/images/logo.png
This will upload all files from the public directory while preserving the directory structure. For example, if you have , it will be uploaded to public/images/logo.png.
Windows:
`bash`
cloudbridge upload C:\path\to\images C:\path\to\docs C:\path\to\readme.md --folder backup
macOS/Linux:
`bash`
cloudbridge upload /path/to/images /path/to/docs /path/to/readme.md --folder backup
* Credentials are stored locally (Windows: %USERPROFILE%\.cloudbridge.json, macOS/Linux: ~/.cloudbridge.json)multipart/form-data
* Each upload request includes:
* x-access-key header
* x-signature header (HMAC-SHA256 of your access key using secret key)
* Files are streamed via
* Directory structure is preserved during upload
* Recursive directory scanning is supported
API endpoint used:
``
POST https://api.cloudbridge.nugitech.com/api/v1/public/upload
`bash``
š 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
MIT Ā© 2024 Nugitech