ap
is a command-line client for the ActivityPub protocol.
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".
I haven't pushed it to PyPI yet, so you'll have to install it from source:
git clone https://github.com/evanp/ap.git
cd ap
python setup.py install
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 protocol 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 or the URL of the user's profile.
This 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.
ap logout
Logs out of the current session by deleting the token file.
ap whoami
Shows the currently logged-in user.
ap get <id>
Gets the object with the given ID and prints it to stdout.
ap inbox
ap outbox
ap followers
ap following
ap pending followers
ap pending following
Shows 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.
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.