Musket
With Musket a “shooter” “fires” a URL at a “target” :D.
Musket is a command line interface to send a URL to several destinations. Each destination handle the URL depending the nature of the destination, for example, Bluesky, Mastodon and LinkedIn destinations post the URL in the user's feed whereas Turso destination stores the URL in Turso Service (a SQLite database SaaS).
Usage
1.- Install
For a while, Musket is provided as a cargo package, therefore you need cargo installed in your machine.
2.- Create the configuration file
To create the configuration file, execute:
Musket uses a configuration file named config.toml. This file is placed in the directory musket inside the users's home. This home depends of the operating system:
The
musket initcommand will display the full path to the configuration file.
3.- Configure the destinations
All destinations have to be configured from the configuration file. The configuration is a .toml file, therefore, strings must be in quotes and booleans must be the word true or false.
Bluesky
Before sending a URL to Bluesky destination you must:
- Create a Bluesky account. For a while, Musket only suports the Bluesky Social provider.
- Fill the
blueskysection in the Musket configuration file. You must provide:- the
identifieris the account's username or email. - the
passwordof the account. commentaryis the default text that will be shown in the post along the link.enabledto set whether the destination can be selected.
- the
Mastodon
Before sending a URL to Mastodon destination you must:
- Create a Mastodon account.
- Create a Mastodon Application with the Write and Profile scopes added. Once the Application has been created an access token will be generated.
- Fill the
mastodonsection in the Musket configuration file. You must provide:- the
serveris the URL of your Mastodon account provider, for example: https://mastodon.online. - the
tokenused as a authentication. commentaryis the default text that will be shown in the post along the link.enabledto set whether the destination can be selected.
- the
Before sending a URL to LinkedIn destination you must:
- Create a LinkedIn Application with the Share on LinkedIn and Sign In with LinkedIn using OpenID Connect products added to the application.
- Create an access token with the email, openid, profile, w_member_social permissions.
- Get the author identifier (doing a request to the userinfo endpoint using the access token).
- Fill the
linkedinsection in the Musket configuration file. You must provide:- the
tokenused as a bearer authentication. - the
authoridentifier. commentaryis the default text that will be shown in the post along the link.visibility, can be "PUBLIC" or "CONNECTIONS".enabledto set whether the destination can be selected.
- the
Turso
Before sending a URL to Turso destination you must:
- Create a Turso account.
- Create a Turso Database.
- Create a Table with the following schema:
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
url TEXT,
tags TEXT,
created DATETIME
);
- Fill the
tursosection in the Musket configuration file. You must provide:- the url of the
databasewhere store the data. - the
tokenused as a authentication. enabledto set whether the destination can be selected.
- the url of the
4.- Using de CLI
Run musket -h to get the details of each command and option.
Init command
Use this command to initialize Musket creating the configuration file:
The init command have one options:
- -f, --force: Use this option to create the configuration file by overwriting the existing one.
Fire command
Use this command to send a URL:
The fire command have several options:
- -u, --url: Use this option to set the URL to send to the destinations. Url is mandatory.
- -d, --destination: Use this option to set where the URL will be send. At least, one destination must be specified.
- -t, --tags: Use this option to set the tags to be used in the destinations. Tags are optional.
- -c, --commentary: Use this option to set the text that will be published along with the URL. Commentary is optional. If no text is specified, then the text set in the configuration file will be used. Turso destination not uses commentaries.
For example:
or
Contributing
If you want to contribute to Musket, please read the CONTRIBUTING.md document.