π AT Protocol Core Implementation π
A command-line interface for the AT Protocol, focusing on the core com.atproto.* namespace with additional Bluesky social features.
ATP CLI provides comprehensive access to the AT Protocol with primary focus on core protocol operations:
- π Authentication & Session Management - Full session lifecycle support
- π€ Identity Resolution - Handle and DID resolution and management
- π¦ Repository Operations - Complete CRUD operations for AT Protocol records
- π Synchronization - Repository sync and blob management
- π₯οΈ Server Management - Server capabilities and session management
- π― Bluesky Integration - Native support for Bluesky social features (
app.bsky.*)
git clone https://github.com/yourusername/atp
cd atp
cargo build --releasecargo install atp# Login with your credentials
atp auth login --identifier your.handle --password your-app-password
# Check current session
atp auth session# Resolve handle to DID
atp atproto identity resolve-handle --handle alice.bsky.social
# Resolve DID to DID document
atp atproto identity resolve-did --did did:plc:example123
# Update your handle
atp atproto identity update-handle --handle new.handle.com# Create a new record
atp atproto repo create-record \
--repo did:plc:example \
--collection app.bsky.feed.post \
--record '{"text": "Hello AT Protocol!", "createdAt": "2024-01-01T00:00:00Z"}'
# Get a specific record
atp atproto repo get-record \
--repo did:plc:example \
--collection app.bsky.feed.post \
--rkey 3k2a4b5c6d7e8f9g
# List records in a collection
atp atproto repo list-records \
--repo did:plc:example \
--collection app.bsky.feed.post \
--limit 50
# Delete a record
atp atproto repo delete-record \
--repo did:plc:example \
--collection app.bsky.feed.post \
--rkey 3k2a4b5c6d7e8f9g
# Upload a blob
atp atproto repo upload-blob --file image.jpg
# Describe a repository
atp atproto repo describe-repo --repo did:plc:example# Create a session (alternative to auth login)
atp atproto server create-session \
--identifier your.handle \
--password your-password
# Get current session info
atp atproto server get-session
# Refresh session tokens
atp atproto server refresh-session
# Delete session (logout)
atp atproto server delete-session
# Get server capabilities
atp atproto server describe-server# Get a blob
atp atproto sync get-blob --did did:plc:example --cid bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
# Get repository head
atp atproto sync get-head --did did:plc:example
# Get latest commit
atp atproto sync get-latest-commit --did did:plc:example
# Get repository status
atp atproto sync get-repo-status --did did:plc:example
# List repositories
atp atproto sync list-repos --limit 100# View a user's profile
atp bsky actor profile --actor alice.bsky.social
# Get multiple profiles
atp bsky actor profiles --actors alice.bsky.social,bob.bsky.social
# Search for users
atp bsky actor search --query "rust developer" --limit 25
# Get user suggestions
atp bsky actor suggestions --limit 50
# Get user preferences
atp bsky actor preferences| Namespace | Commands | Coverage | Status |
|---|---|---|---|
com.atproto.identity |
3/9 | π‘ 33% | Core identity operations |
com.atproto.repo |
6/12 | π‘ 50% | Repository management |
com.atproto.server |
5/25 | π΄ 20% | Server operations |
com.atproto.sync |
5/17 | π΄ 29% | Synchronization |
com.atproto.admin |
0/15 | π΄ 0% | Administrative functions |
com.atproto.label |
0/3 | π΄ 0% | Content labeling |
com.atproto.moderation |
0/3 | π΄ 0% | Moderation tools |
com.atproto.temp |
0/4 | π΄ 0% | Temporary operations |
β Implemented Features (Click to expand)
- β
resolveHandle- Resolve handle to DID - β
resolveDid- Resolve DID to DID document - β
updateHandle- Update account handle
- β
createRecord- Create new record - β
getRecord- Get specific record - β
listRecords- List records in collection - β
deleteRecord- Delete record - β
uploadBlob- Upload blob - β
describeRepo- Get repository metadata
- β
createSession- Login/create session - β
getSession- Get current session info - β
refreshSession- Refresh tokens - β
deleteSession- Logout - β
describeServer- Get server capabilities
- β
getBlob- Get blob data - β
getHead- Get repository head - β
getLatestCommit- Get latest commit - β
getRepoStatus- Get repository status - β
listRepos- List repositories
π§ Planned Core Features (Click to expand)
- β
com.atproto.repo.applyWrites- Batch repository operations - β
com.atproto.repo.putRecord- Update existing records - β
com.atproto.server.createAccount- Account creation - β
com.atproto.identity.getRecommendedDidCredentials- DID credential management - β
com.atproto.moderation.createReport- Content reporting
- β
com.atproto.label.queryLabels- Query content labels - β
com.atproto.sync.subscribeRepos- Subscribe to repository events - β
com.atproto.server.createAppPassword- App password management - β
com.atproto.identity.signPlcOperation- PLC operations - β
com.atproto.repo.importRepo- Repository import/export
- β
com.atproto.admin.*- Administrative operations (15 commands) - β
com.atproto.temp.*- Temporary/experimental features (4 commands)
| Category | Implemented | Total | Coverage |
|---|---|---|---|
| Core AT Protocol | 19 | 66 | π‘ 29% |
| Bluesky Features | 5 | 95+ | π΄ 5% |
| Total | 24 | 161+ | π΄ 15% |
ATP CLI has comprehensive test coverage with 93 passing integration tests covering:
- β All command-line argument validation
- β Authentication and authorization flows
- β Error handling and edge cases
- β Parameter validation and boundary testing
- β JSON validation and parsing
- β Help system consistency
- β Unicode and special character handling
# Run all tests
cargo test
# Run only integration tests
cargo test --test integration_tests
# Run with verbose output
cargo test -- --nocaptureATP CLI stores configuration and session data in your system's local config directory:
- Linux:
~/.config/atp/config.toml - macOS:
~/Library/Application Support/atp/config.toml - Windows:
%APPDATA%\atp\config.toml
[session]
did = "did:plc:example123"
handle = "alice.bsky.social"
email = "alice@example.com"
accessJwt = "..."
refreshJwt = "..."ATP CLI is built with:
- π¦ Rust 2024 Edition - Modern, safe systems programming
- β‘ Tokio - Async runtime for high-performance networking
- π§ Clap - Powerful command-line argument parsing
- π Reqwest - HTTP client with JSON support
- π Serde - Serialization/deserialization
- β TDD Approach - Test-driven development with comprehensive coverage
Contributions are welcome! Please feel free to submit a Pull Request.
- Core AT Protocol Features - Complete the
com.atproto.*namespace implementation - Batch Operations - Implement
applyWritesand bulk operations - Identity Management - Complete DID and handle operations
- Event Streaming - Add support for real-time subscriptions
- Documentation - Improve examples and API documentation
git clone https://github.com/yourusername/atp
cd atp
cargo build
cargo testThis project is licensed under the MIT License - see the LICENSE file for details.
- Built on the AT Protocol specification
- Compatible with Bluesky and other AT Protocol servers
- Inspired by the vision of a decentralized social web
- Thanks to all contributors and testers
AT Protocol β’ Issues β’ Discussions
Made with β€οΈ for the decentralized social web