photo-distributor-cli
v0.0.2
Published
CLI for uploading photos and videos to a photo-distributor server.
Readme
Command-line uploader for sending photos and videos from an SD card (or any folder) to a running photo-distributor server.
Requirements
- Node.js 20.0.0 or later
What it does
- Auto-detects mounted camera/SD card volumes by looking for a
DCIMdirectory - Recursively scans for supported media files
- Uploads files to the photo-distributor upload API
- Skips duplicates reported by the server
- Supports dry-run mode to preview uploads
- Saves default server credentials locally for repeat use
Install
From npm (global install):
npm install -g photo-distributor-cliThis installs the pd-upload command globally on your machine.
If you prefer not to install globally, run it with npx:
npx photo-distributor-cli <command> [options]Quick start
# Auto-detect SD card, then upload from selected DCIM folder
pd-upload
# Upload from a specific folder
pd-upload upload /Volumes/CANON/DCIM
# Default command is upload, so this is equivalent
pd-upload /Volumes/CANON/DCIM
# Preview files without uploading
pd-upload --dry-run /Volumes/CANON/DCIMCommands
| Command | Description |
| --------------------------- | ------------------------------------------------------------------------ |
| pd-upload [source] | Default command. Upload from source, or auto-detect SD card if omitted |
| pd-upload upload [source] | Explicit upload command |
| pd-upload detect | List detected SD cards / camera storage volumes |
| pd-upload config | Show or save default connection settings |
Connection options
These apply to upload and config:
| Option | Description | Default |
| ----------------------- | ------------------------------------------------ | ----------------------- |
| --url <url> | Server URL (http or https) | http://localhost:3001 |
| --user <user> | Username | pd |
| --password <password> | Password | prompted if missing |
| --dry-run | List files that would be uploaded, do not upload | off |
Save defaults once
pd-upload config --url http://192.168.1.50:3001 --user pd --password mysecretThen run uploads without repeating flags:
pd-uploadThe CLI stores settings in:
~/.photo-distributor.json
SD card detection behavior
The CLI checks mounted volumes and keeps entries containing a DCIM directory.
- macOS:
/Volumes/* - Linux:
/media/<user>/*,/media/*,/run/media/*,/mnt/* - Windows: drive letters
A:\throughZ:\
Supported file types
Photos:
.jpg,.jpeg,.png,.heic,.heif,.webp,.tiff,.tif,.cr2,.cr3
Videos:
.mp4,.mov,.avi,.mkv,.m4v,.3gp,.wmv
Typical workflow
# 1) Verify server is running
# Example: http://localhost:3001
# 2) Save connection once
pd-upload config --url http://localhost:3001 --user pd
# 3) Detect card
pd-upload detect
# 4) Dry-run first
pd-upload --dry-run
# 5) Upload
pd-uploadTroubleshooting
Authentication failed
- Confirm
--userand--password - Re-save credentials with
pd-upload config
Cannot reach server
- Confirm server URL and port, for example
http://localhost:3001 - Make sure photo-distributor is running and reachable from this machine
No SD cards detected
- Provide a source path explicitly, for example:
pd-upload /path/to/mediaNo files found
- Confirm files are under the selected folder
- Confirm file extensions are in the supported list above
