This is a command-line interface (CLI) tool for interacting with the BSky social platform. It allows you to authenticate and create posts on BSky.
It is very much a prototype right now.
- Add color to the terminal
- Exclude multiple repeats on stream
- Add search
- Work out how to distribute
- Improve documentation
- Add unit tests
- Implement error handling
- Add other commands (fetch, stream)
- Anything else?
- Go 1.19 or later
- A
.env
file with your BSky username and app password
-
Clone the repository:
git clone https://github.com/doingandlearning/bsky-cli.git cd bsky-cli
-
Install dependencies:
go mod tidy
Create a .env
file in the root directory of the project with the following content:
USERNAME=your_username
APP_PASSWORD=your_password
If you'd like to change the colours used in the terminal, you can add these variables to your .env:
DISPLAY_NAME_COLOR=yellow
TEXT_COLOR=blue
URL_COLOR=white
Colours currently supported are red, green, yellow, blue, cyan, magenta and white.
go build -o bsky ./cmd/cli
To create a post on BSky, run the following command:
./bsky -content "Your post content here"
To list the last 10 posts from users in your feed:
./bsky -fetch
To stream posts use the following command.
./bsky -stream
It defaults to 10 seconds but you can pass and optional interval flag if you'd like more or less frequent updates.
./bsky -stream -interval=1s
Search for a given term and get 10 posts back
./bsky -search="Arcane"
To create a post on BSky, run the following command:
go run cmd/cli/*.go -content "Your post content here"
To list the last 10 posts from users in your feed:
go run cmd/cli/*.go -fetch
This project is licensed under the MIT License.