{"id":22195200,"url":"https://github.com/isfegu/musket","last_synced_at":"2025-10-13T00:30:48.869Z","repository":{"id":263406151,"uuid":"889579214","full_name":"isfegu/musket","owner":"isfegu","description":"Musket is a command line interface to send a URL to several destinations.","archived":false,"fork":false,"pushed_at":"2025-01-17T19:29:11.000Z","size":150,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T19:50:12.881Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://crates.io/crates/musket","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isfegu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-16T17:28:54.000Z","updated_at":"2025-01-17T19:29:07.000Z","dependencies_parsed_at":"2024-12-31T11:17:30.429Z","dependency_job_id":"46603764-42e4-4ead-8813-45e805c71b56","html_url":"https://github.com/isfegu/musket","commit_stats":null,"previous_names":["isfegu/musket"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isfegu%2Fmusket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isfegu%2Fmusket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isfegu%2Fmusket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isfegu%2Fmusket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isfegu","download_url":"https://codeload.github.com/isfegu/musket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236284628,"owners_count":19124144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T13:17:15.736Z","updated_at":"2025-10-13T00:30:48.858Z","avatar_url":"https://github.com/isfegu.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Musket\n\nWith __Musket__ a “shooter” “fires” a URL at a “target” :D.\n\n__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).\n\n## Usage\n\n### 1.- Install\n\nFor a while, __Musket__ is provided as a cargo package, therefore you need _cargo_ installed in your machine.\n\n```bash\ncargo install musket\n```\n\n#### Dependencies\n\nDue to `cargo install` download, compile and build __Musket__ some dependencies must be installed in your machine.\n\nFor an Ubuntu 24.04:\n```bash\n$ sudo apt install build-essential pkg-config libssl-dev\n```\n\nOther GNU/Linux distros have to change the package manager (like `dnf`, `pacman`, etc) and the package names.\n\nNecessary dependencies for other operating systems are pending investigation.\n\n### 2.- Create the configuration file\n\nTo create the configuration file, execute:\n\n```bash\n$ musket init\n```\n\n__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:\n\n- [GNU/Linux](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)\n- [MS Windows](https://learn.microsoft.com/es-es/windows/win32/shell/knownfolderid?redirectedfrom=MSDN)\n- [macOS](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW6)\n\n\u003e The `musket init` command will display the full path to the configuration file.\n\n### 3.- Configure the destinations\n\nAll destinations have to be configured from the [configuration file](#2--create-the-configuration-file). The configuration is a .toml file, therefore, strings must be in quotes and booleans must be the word _true_ or _false_.\n\n#### Bluesky\n\nBefore sending a URL to Bluesky destination you must:\n\n1. Create a [Bluesky](https://bsky.app/) account. For a while, __Musket__ only suports the _Bluesky Social_ provider.\n2. Fill the `bluesky` section in the __Musket__ [configuration file](#2--create-the-configuration-file). You must provide:\n   - the `identifier` is the account's username or email.\n   - the `password` of the account.\n   - `commentary` is the default text that will be shown in the post along the link.\n   - `language` is the language of the commentary.\n   - `enabled` to set whether the destination can be selected.\n\n#### Mastodon\n\nBefore sending a URL to Mastodon destination you must:\n\n1. Create a [Mastodon](https://docs.joinmastodon.org/) account.\n2. Create a [Mastodon Application](https://www.linkedin.com/developers) with the _Write_ and _Profile_ scopes added. Once the Application has been created an access token will be generated. \n3. Fill the `mastodon` section in the __Musket__ [configuration file](#2--create-the-configuration-file). You must provide:\n   - the `server` is the URL of your Mastodon account provider, for example: https://mastodon.online.\n   - the `token` used as a authentication.\n   - `commentary` is the default text that will be shown in the post along the link.\n   - `language` is the language of the commentary.\n   - `enabled` to set whether the destination can be selected.\n\n#### LinkedIn\n\nBefore sending a URL to LinkedIn destination you must:\n\n1. Create a [LinkedIn Application](https://www.linkedin.com/developers) with the _Share on LinkedIn_ and _Sign In with LinkedIn using OpenID Connect_ products added to the application.\n2. Create an [access token](https://www.linkedin.com/developers/tools/oauth) with the _email_, _openid_, _profile_, _w_member_social_ permissions.\n3. Get the [author identifier](https://learn.microsoft.com/es-es/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2#api-request-to-retreive-member-details) (doing a request to the userinfo endpoint using the access token).\n4. Fill the `linkedin` section in the __Musket__ [configuration file](#2--create-the-configuration-file). You must provide:\n   - the `token` used as a bearer authentication.\n   - the `author` identifier.\n   - `commentary` is the default text that will be shown in the post along the link.\n   - `language` is the language of the commentary.\n   - `visibility`, can be \"PUBLIC\" or \"CONNECTIONS\".\n   - `enabled` to set whether the destination can be selected.\n\n#### Turso\n\nBefore sending a URL to Turso destination you must:\n\n1. [Create a Turso account](https://app.turso.tech).\n2. Create a Turso Database.\n3. Create a Table with the following schema:\n\n```sql\nCREATE TABLE links (\n  id INTEGER PRIMARY KEY AUTOINCREMENT,\n  url TEXT,\n  tags TEXT,\n  created DATETIME\n);\n```\n4. Fill the `turso` section in the __Musket__ [configuration file](#2--create-the-configuration-file). You must provide:\n   - the url of the `database` where store the data.\n   - the `token` used as a authentication.\n   - `enabled` to set whether the destination can be selected.\n\n### 4.- Configure the sources\n\nOne way to specify a URL is to get it from the sources instead of setting it directly. Currently, __Musket__ only supports [Instapaper](https://www.instapaper.com/) as a valid source.\n\n#### Instapaper\n\nBefore getting a URL from Instapaper you must:\n\n1. Create a [Instapaper](https://www.instapaper.com/) account.\n2. Request a [New OAuth Application](https://www.instapaper.com/main/request_oauth_consumer_token).\n3. Fill the `instapaper` section in the __Musket__ [configuration file](#2--create-the-configuration-file). You must provide:\n   - the `username` used as a part of the credentials of your account.\n   - the `password` used as a part of the credentials of your account.\n   - the `consumer_key` provided by Instapaper after the New OAuth Application request.\n   - `consumer_secret` provided by Instapaper after the New OAuth Application request.\n\nHere's how __Musket__ works with Instapaper:\n\n- __Musket__ only sends to the destinations one Instapaper bookmark at a time.\n- __Musket__ only sends to the destinations Instapaper bookmarks with the tag `musket`.\n- Once the bookmark is sent to the destinations, __Musket__ deletes it from Instapaper.\n\n### 5.- Using the CLI\n\nRun `musket -h` to get the details of each command and option.\n\n#### Init command\n\nUse this command to initialize __Musket__ creating the configuration file:\n\n```bash\n$ musket init\n```\n\nThe _init_ command have one options:\n\n- __-f, --force__: Use this option to create the configuration file by overwriting the existing one.\n\n#### Fire command\n\nUse this command to send a URL:\n\n```bash\n$ musket fire\n```\n\nThe _fire_ command have several options:\n\n- __-u, --url__: Use this option to set the URL to send to the destinations. Url is mandatory if `-f, --from` is not present.\n- __-f, --from__: Use this option to set from where the URL to send to the destinations should be obtained. From is mandatory if `-u, --url` is not present.\n- __-d, --destination__: Use this option to set where the URL will be send. At least, one destination must be specified.\n- __-t, --tags__: Use this option to set the tags to be used in the destinations. Tags are optional. If `-f, --from` is present, the tags used will be the tags set in the source.\n- __-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](#2--create-the-configuration-file) will be used. _Turso_ destination not uses commentaries.\n- __-l, --language__: Use this option to set the language of the commentary. Language is optional. If no language is specified, then the language set in the [configuration file](#2--create-the-configuration-file) will be used. _Turso_ destination not uses language. The language __must__ be use [ISO 639-1 language tag](https://en.wikipedia.org/wiki/ISO_639-1). That means, use two letters, like `en` for English, `es` for Spanish, etc.\n\n```bash\n$ musket fire --url \u003cURL\u003e --from \u003cSOURCE\u003e --destination \u003cDESTINATION\u003e --tags \u003ctags\u003e --commentary \u003ctext\u003e --language \u003ctext\u003e\n```\n\nFor example:\n\n```bash\n$ musket fire --url wikipedia.org --destination bluesky,mastodon,linked-in,turso --tags one,two,three --commentary \"I've just discover this amazing website!\" --language en\n```\n\nor\n\n```bash\n$ musket fire --url wikipedia.org -d bluesky -d mastodon -d linked-in -d turso -t one -t two -t three -c \"I've just discover this amazing website!\" -l en\n```\n\nor\n\n```bash\n$ musket fire --source instapaper --destination all --commentary \"I've just discover this amazing website!\" --language en\n```\n\n#### Logging\n\nBy default, _errors_ and _information_ messages will be displayed on the terminal to be notified about the result of the __Musket__ execution. If you want to see the _debug_ messages you must set the `RUST_LOG` environment variable with the value `debug`. For example adding it before a __Musket__ execution command:\n\n```bash\n$ RUST_LOG=\"debug\" musket fire --url wikipedia.org -d bluesky -d mastodon -d linked-in -d turso -t one -t two -t three -c \"I've just discover this amazing website!\"\n```\n\n## Contributing\n\nIf you want to contribute to __Musket__, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) document.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisfegu%2Fmusket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisfegu%2Fmusket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisfegu%2Fmusket/lists"}