A command-line tool for uploading files to UCloud US3 storage using HMAC-SHA1 signature authentication.
- Simple command-line interface
- Secure credential management (stored in
~/.config/us3-cp/config) - Cross-platform support (macOS and Linux)
- Automatic MIME type detection
- MD5 checksum calculation
- Progress indication during upload
- Bash 4.0+
curlopensslfilecommand (for MIME type detection)
-
Download the
us3-cpscript:curl -LfS -o us3-cp https://raw.githubusercontent.com/DaysJan/ucloud-uploader/main/us3-cp
-
Make it executable:
chmod +x us3-cp
-
(Optional) Add to your PATH:
# Move to a directory in your PATH (e.g., ~/.local/bin) mv us3-cp ~/.local/bin
Append to your shell config (~/.zshrc or ~/.bashrc)
export PATH="$HOME/.local/bin:$PATH"
On first run, the script will prompt you to create a configuration file at ~/.config/us3-cp/config.
You can also create it manually:
mkdir -p ~/.config/us3-cp
cat > ~/.config/us3-cp/config <<EOF
REGION="hk"
DOMAIN="ufileos.com"
PUBLIC_KEY="your-public-key"
PRIVATE_KEY="your-private-key"
EOF
chmod 600 ~/.config/us3-cp/config- Region: See UCloud US3 region documentation
- Domain: Get your domain from UCloud US3 domain management or use
ufileos.comfor test - Public/Private Keys: Get your token from UCloud US3 token management
us3-cp <local_file_path> <bucket_name>/<file_key># Upload a text file
us3-cp ./text.txt mybucket/text.txt
# Upload an image to a subdirectory
us3-cp /path/to/image.jpg mybucket/images/image.jpgOn successful upload, the script will output the download URL.