bluesky-avatar-updater
bluesky-avatar-updater is a Rust tool that swaps your Bluesky profile avatar — and optionally your banner — based on the current hour. Each hour maps to a blob CID stored in a JSON config file. It fetches the blob metadata from your PDS, updates the profile record, writes logs, and installs an hourly cron job so it can run unattended.
Inspired by @dame.is's post on building an automated dynamic avatar.
Status
Unmaintained — the repository carries a "No Maintenance Intended" badge.
Setup
Requires Rust 1.85+ and Cargo. No Python environment is needed.
git clone https://github.com/ewanc26/bluesky-avatar-updater.git
cd bluesky-avatar-updater
cargo build --release
Create assets/.env (a .env in the repository root is also read):
ENDPOINT=https://bsky.social
HANDLE=your_handle.bsky.social
PASSWORD=your_app_password
DID=did:plc:your_did
UPDATE_BANNER=false
Create assets/cids.json mapping each hour to blob CIDs. The banner field is optional per hour:
{
"00": { "avatar": "cid_for_midnight", "banner": "banner_cid_for_midnight" },
"01": { "avatar": "cid_for_1am", "banner": "banner_cid_for_1am" }
}
Run it:
cargo run --release
After building, the binary can also be run directly with ./target/release/bluesky-avatar-updater.
On startup it:
- Adds
0 * * * * /path/to/binaryto your crontab if the binary is not already listed - Loads environment variables from
.envorassets/.env - Validates
ENDPOINT,HANDLE,PASSWORD, andDID, and normalises the endpoint to HTTPS - Checks the endpoint's
xrpc/_healthroute - Reads the CID map from
assets/cids.json - Selects the avatar and optional banner for the current hour
- Logs in with the app password and reads the current profile record, keeping its CID for a
swap_recordupdate - Fetches blob metadata from
com.atproto.sync.getBloband updates the avatar; updates the banner only whenUPDATE_BANNER=trueand a banner CID exists - Writes the profile record and logs to daily-rolled files under
logs/
Licence
MIT.
← all docs