Observed since 20 Oct, 18:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Command-line client for the ActivityPub API
ap is a command-line client for the ActivityPub API.
I initially developed this program to illustrate how to write client code for the ActivityPub API as part of my book for O'Reilly Media, "ActivityPub: Programming for the Social Web".
Note that not all servers that implement the ActivityPub federation protocol necessarily implement the ActivityPub API. In particular, as of this writing, Mastodon does not implement the ActivityPub API; it has its own API. If you're using Mastodon, you may prefer the toot CLI instead.
A good list of supporting software is here:
https://codeberg.org/fediverse/delightful-fediverse-experience/issues/130
The easiest way to install is from PyPI.
pipx install activitypub-cli
ap uses the subcommand pattern common with other large command-line programs like git and docker. The full list of subcommands is available by typing ap --help. Familiarity with the ActivityPub API is helpful for understanding these commands!
ap login <id>Logs in as a user to an ActivityPub API server using OAuth 2.0. The <id> argument is a Webfinger ID like username@domain.example or the ActivityPub Actor ID (usually an HTTPS URL).
Example with a Webfinger ID:
ap login username@domain.example
Example with an ActivityPub actor ID:
ap login https://social.example/person/df816567-4c64-480c-955a-0f734bf93362
ap login stores the OAuth 2.0 token(s) in a file in the user's home directory, $HOME/.ap/token.json, so that subsequent commands can use them.
If this command fails, it's likely that your server doesn't support the ActivityPub API.
ap logoutLogs out of the current session by deleting the token file.
ap whoamiShows the currently logged-in user.
ap get <id>Gets the object with the given ID and prints it to stdout.
ap inboxap outboxap followersap followingap pending followersap pending followingShows these collections for the currently logged-in user.
ap follow <id>Follows the user with the given ID.
ap accept follower <id>ap reject follower <id>Accepts or rejects a follow request from the user with the given ID.
ap undo follow <id>Unfollows the user with the given ID.
ap create note <text>Creates a Note object with the given text.
ap upload <filename>Uploads the given file and prints the resulting URL.
The project uses uv. To get set up, clone from Git and set up a virtual environment:
git clone https://github.com/evanp/ap.git
cd ap
uv venv
source .venv/bin/activate
uv pip install -e .
Then you can run the application directly:
ap -h
I'm very interested in contributions to this project. Some quick notes:
Small note: If editing the Readme, please conform to the standard-readme specification.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.5.1 | 11 Mar 2026 | 5 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:38 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:6c2f8179579e6d940de3085ceb6789011d457e8576b848d3f27c20f752d41044