Skip to main content

general-purpose cli for atproto record operations

Project description

pdsx

general-purpose cli for atproto record operations

📚 documentation

installation

uv add pdsx
# or
uvx pdsx --help

quick start

important: flags like -r, --handle, --password go BEFORE the command (ls, get, etc.)

# read anyone's posts (no auth needed)
uvx pdsx -r zzstoatzz.io ls app.bsky.feed.post -o json | jq -r '.[].text'

# update your bio (requires auth)
export ATPROTO_HANDLE=your.handle ATPROTO_PASSWORD=your-app-password
uvx pdsx edit app.bsky.actor.profile/self description='new bio'

features

  • crud operations for atproto records (list, get, create, update, delete)
  • blob upload: upload images, videos, and other binary content
  • cursor pagination: paginate through large collections
  • optional auth: reads with --repo flag don't require authentication
  • shorthand URIs: use app.bsky.feed.post/abc123 when authenticated
  • multiple output formats: compact (default), json, yaml, table
  • unix-style aliases: ls, cat, rm, edit, touch/add
  • jq-friendly json output
  • python 3.10+, type-safe
usage examples

read operations (no auth with -r)

# list records from any repo (note: -r goes BEFORE ls)
pdsx -r zzstoatzz.io ls app.bsky.feed.post --limit 5 -o json

# read someone's bio
pdsx -r zzstoatzz.io ls app.bsky.actor.profile -o json | jq -r '.[0].description'

pagination

# get first page (note: -r before ls, --cursor after)
pdsx -r zzstoatzz.io ls app.bsky.feed.post --limit 2

# output includes cursor if more pages exist, copy it for next command
# next page cursor: 3m5335qycpc2z

# get next page (use actual cursor from previous output)
pdsx -r zzstoatzz.io ls app.bsky.feed.post --limit 2 --cursor 3m5335qycpc2z

post with image (end-to-end)

# download a test image
curl -sL https://picsum.photos/200/200 -o /tmp/test.jpg

# upload image and capture blob reference
pdsx upload-blob /tmp/test.jpg
# copy the blob reference from output, example:
# {"$type":"blob","ref":{"$link":"bafkreif..."},"mimeType":"image/jpeg","size":6344}

# create post with uploaded image (paste your actual blob reference)
pdsx create app.bsky.feed.post \
  text='Posted via pdsx!' \
  'embed={"$type":"app.bsky.embed.images","images":[{"alt":"test image","image":{"$type":"blob","ref":{"$link":"PASTE_YOUR_CID_HERE"},"mimeType":"image/jpeg","size":6344}}]}'

write operations (auth required)

# update your bio
pdsx edit app.bsky.actor.profile/self description='Building with pdsx!'

# create a simple post
pdsx create app.bsky.feed.post text='Hello from pdsx!'

# delete a post (use the rkey from create output)
pdsx rm app.bsky.feed.post/PASTE_RKEY_HERE

note: when authenticated, use shorthand URIs (collection/rkey) instead of full AT-URIs (at://did:plc:.../collection/rkey)

output formats

both ls and cat/get support four output formats:

compact (default for ls)

app.bsky.feed.post (3 records)
3m4ryxwq5dt2i: {"created_at":"2025-11-04T07:25:17.061883+00:00","text":"..."}

json

pdsx -r zzstoatzz.io ls app.bsky.feed.post -o json | jq '.[].text'
pdsx -r zzstoatzz.io cat app.bsky.feed.post/3m5335qycpc2z -o json

yaml

pdsx -r zzstoatzz.io ls app.bsky.feed.post --limit 3 -o yaml
pdsx -r zzstoatzz.io cat app.bsky.actor.profile/self -o yaml

table (default for cat/get)

pdsx -r zzstoatzz.io ls app.bsky.feed.post --limit 5 -o table
pdsx -r zzstoatzz.io cat app.bsky.actor.profile/self  # default
development
git clone https://github.com/zzstoatzz/pdsx
cd pdsx
uv sync
uv run pytest
uv run ty check

license

mit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdsx-0.0.1a8.tar.gz (92.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdsx-0.0.1a8-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file pdsx-0.0.1a8.tar.gz.

File metadata

  • Download URL: pdsx-0.0.1a8.tar.gz
  • Upload date:
  • Size: 92.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.8

File hashes

Hashes for pdsx-0.0.1a8.tar.gz
Algorithm Hash digest
SHA256 340ac88bf069102a4fe2df492d8a21969de55c519d69cc5c4a8b4976b190d9f9
MD5 82434de1235746a1fe9305ebc635fdd5
BLAKE2b-256 9014253a417b250bcb0461e996f96e3f8b188c55d9b6753b00c325dae9d6f4dc

See more details on using hashes here.

File details

Details for the file pdsx-0.0.1a8-py3-none-any.whl.

File metadata

  • Download URL: pdsx-0.0.1a8-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.8

File hashes

Hashes for pdsx-0.0.1a8-py3-none-any.whl
Algorithm Hash digest
SHA256 d9c934be4e76179816f3c8a6928585af4bf91c3eedfb72fb80f63597d01f0c84
MD5 993e04c262f209ee8238c7bef3f7a04f
BLAKE2b-256 7c2691d5d72d7a14927351894208e116fef6de24dacbef36b44d7530b94d8ef1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page