cli client for mastodon social media platform
since we don't provide pre-built binaries, having Go installed on your machine is required. Follow this link: https://go.dev/dl/
-
Clone repo to your local machine (fork repo if you intend to be a Contributor!)
git clone https://github.com/socraticDevBlog/mastodonctl.git
-
Install project
go install
-
Build project
go build .
-
Add current project directory to your user PATH
export PATH="$PATH:${GOPATH}/bin/mastodonctl"
-
(required) in order for the binary to be able to read configuration file
current_directory=`pwd` export CONFIG_FILEPATH=${current_directory}/conf.json
mastodonctl
is now available as CLI tool! ๐
As an experienced user, you may want to customize your commandline-tool.
This is possible by editing conf.json
file
field | description |
---|---|
ResultsDisplayCount | number of results displayed in your terminal |
ApiUrl | URL of targetted mastodon server |
AuthToken | auth token required to interact with a server's API |
* requires auth token for the server used
Will query Mastadon server's API for user infos based on their username
populate AuthToken
field in conf.json configuration file
conf.json
file to git
version control
try out a few commands to see if everything is working properly
go run . userinfos -username dave
Expect:
Will query Mastadon server's public API for latest post tagged with a specific hashtag
go run . hashtag -name cat
Expect:
- my
.profile
file
# golang configs
export GOPATH=$HOME/go
export PATH="$GOPATH/bin:$PATH"
# mastodonctl
# a valid conf.json file located beside mastodonctl binary
export CONFIG_FILEPATH="$GOPATH/bin/conf.json"