musket 0.18.0

Musket is a command line interface to send a URL to several destinations.
Documentation

Musket

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 destination post the URL in the user's feed, LinkedIn destination publish the link in the user profile and 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.

cargo install musket

2.- Create the configuration file

To create the configuration file, execute:

$ musket init

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 init command will display the full path to the configuration file.

3.- Configure the destinations

All destinations have to be configured from the configuration file.

Bluesky

Before sending a URL to Bluesky destination you must:

  1. Create a Bluesky account. For a while, Musket only suports the Bluesky Social provider.
  2. Fill the bluesky section in the Musket configuration file. You must provide:
    • the identifier is the account's username or email.
    • the password of the account.
    • commentary is the default text that will be shown in the post along the link.

LinkedIn

Before sending a URL to LinkedIn destination you must:

  1. Create a LinkedIn Application with the Share on LinkedIn and Sign In with LinkedIn using OpenID Connect products added to the application.
  2. Create an access token with the email, openid, profile, w_member_social permissions.
  3. Get the author identifier (doing a request to the userinfo endpoint using the access token).
  4. Fill the linkedin section in the Musket configuration file. You must provide:
    • the token used as a bearer authentication.
    • the author identifier.
    • commentary is the default text that will be shown in the post along the link.
    • visibility, can be "PUBLIC" or "CONNECTIONS".

Turso

Before sending a URL to Turso destination you must:

  1. Create a Turso account.
  2. Create a Turso Database.
  3. Create a Table with the following schema:
CREATE TABLE links (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  url TEXT,
  tags TEXT,
  created DATETIME
);
  1. Fill the turso section in the Musket configuration file. You must provide the database url and the turso token.

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:

$ musket init

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:

$ musket fire

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.
$ musket fire --url <URL> --destination <DESTINATION> --tags <tags> --commentary <text>

For example:

$ musket fire --url wikipedia.org --destination bluesky,linked-in,turso --tags one,two,three --commentary "I've just discover this amazing website!"

or

$ musket fire --url wikipedia.org -d bluesky -d linked-in -d turso -t one -t two -t three -c "I've just discover this amazing website!"

Contributing

If you want to contribute to Musket, please read the CONTRIBUTING.md document.