3 releases
Uses new Rust 2024
| 0.1.2 | Dec 23, 2025 |
|---|---|
| 0.1.1 | Dec 23, 2025 |
| 0.1.0 | Dec 22, 2025 |
#2277 in Command line utilities
26KB
282 lines
pic-od
A CLI tool for uploading images to various cloud storage services using Apache OpenDAL.
Features
- Upload images to multiple cloud storage backends (S3, GCS, Azure Blob, OSS, COS, etc.)
- Multiple profile support for different storage targets
- Customizable filename format with template variables
- Environment variable support for CI/CD integration
Installation
cargo install pic-od
Configuration
Create a configuration file at ~/.config/pic-od/config.toml:
current_profile = "default"
[profiles.default]
type = "s3"
bucket = "my-bucket"
region = "us-east-1"
access_key_id = "YOUR_ACCESS_KEY"
secret_access_key = "YOUR_SECRET_KEY"
root = "/images"
base_url = "https://cdn.example.com"
filename_format = "{date}/{name}"
[profiles.backup]
type = "gcs"
bucket = "backup-bucket"
credential_path = "/path/to/credentials.json"
base_url = "https://storage.googleapis.com/backup-bucket"
Supported Storage Backends
s3- Amazon S3 and compatible servicesgcs- Google Cloud Storageazblob- Azure Blob Storageoss- Aliyun OSScos- Tencent COSobs- Huawei OBSfs- Local filesystemwebdav- WebDAV- And more...
Filename Format Variables
{name}- Original filename with extension{stem}- Original filename without extension{ext}- File extension{date}- Current date (YYYYMMDD){year}- Current year (YYYY){month}- Current month (MM){day}- Current day (DD){uuid}- UUIDv7 string
Usage
Upload images
# Upload single image
pic-od upload image.png
# Upload multiple images
pic-od upload image1.png image2.jpg image3.gif
# Use a specific profile
pic-od upload -t backup image.png
pic-od upload --profile backup image.png
# Use environment variable
PIC_OD_PROFILE=backup pic-od upload image.png
Manage profiles
# List all profiles (* indicates current)
pic-od list
# Set current profile
pic-od profile backup
Integrations
Typora
- Open Typora Preferences → Image
- Choose "Custom Command" as Image Uploader
- Set command to:
pic-od upload
Now when you insert an image, Typora will use pic-od to upload it and insert the URL.
VSCode
Install the Pic OpenDAL extension from the VSCode marketplace.
License
Apache-2.0
Dependencies
~23–40MB
~568K SLoC