Something went wrong. Try again.
CLI tools and operational extensions for the void architecture on ATProtocol.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344import osimport syssys.path.insert(0, '/home/cameron/void/src')
from dotenv import load_dotenvfrom atproto import Client
load_dotenv('/home/cameron/void/.env', override=True)
pds_uri = os.getenv('PDS_URI', 'https://bsky.social')client = Client(base_url=pds_uri)client.login(os.getenv('BSKY_USERNAME'), os.getenv('BSKY_PASSWORD'))
# Get current profile for display nameprofile = client.app.bsky.actor.get_profile({'actor': client.me.did})
# New description from command line or defaultdescription = sys.argv[1] if len(sys.argv) > 1 else ''display_name = sys.argv[2] if len(sys.argv) > 2 else profile.display_name
# Fetch existing profile record to get proper blob refsexisting = client.com.atproto.repo.get_record({ 'repo': client.me.did, 'collection': 'app.bsky.actor.profile', 'rkey': 'self'})
# Convert to dict and updaterecord = dict(existing.value)record['description'] = descriptionrecord['displayName'] = display_namerecord['createdAt'] = client.get_current_time_iso()
# Publish the profile updateresult = client.com.atproto.repo.put_record({ 'repo': client.me.did, 'collection': 'app.bsky.actor.profile', 'rkey': 'self', 'record': record})
print(f"Profile updated successfully")print(f"New description: {description}")