A file watcher that automatically uploads new files to S3-compatible storage and copies the public URL to your clipboard. Especially useful with screenshot tools.
- Monitors a directory for new files
- Uploads to AWS S3 or Cloudflare R2
- Copies public URLs to clipboard
- Supports both X11 and Wayland on Linux
- Generates unique filenames using Snowflake IDs
git clone https://github.com/eli-rich/radar
cd radar
pnpm installCopy .env.example to .env and configure:
cp .env.example .envRequired environment variables:
ACCOUNT_ID- Your AWS/Cloudflare account IDACCESS_KEY_ID- Your access key IDSECRET_ACCESS_KEY- Your secret access keyWATCH_DIR- Directory to watch for new files (e.g.,~/Pictures/Screenshots)BUCKET- Storage bucket nameBASE_URL- Public URL for accessing uploaded filesMACHINE_ID- Unique identifier for this machine (prevents Snowflake ID conflicts)
Build the project:
pnpm buildRun the watcher:
pnpm startFor production use, run Radar as a system service:
Linux (systemd)
Create /etc/systemd/system/radar.service:
[Unit]
Description=Radar file watcher
After=network.target
[Service]
Type=simple
User=your-username
WorkingDirectory=/path/to/radar
ExecStart=/usr/bin/node dist/index.js
Restart=always
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable radar
sudo systemctl start radarmacOS (launchd)
Use a plist file in ~/Library/LaunchAgents/.
Cross-platform
Use pm2:
pm2 start dist/index.js --name radar
pm2 save
pm2 startupTested on Linux (X11 and Wayland) and macOS. Windows support is untested.
MIT