| Crates.io | mpcli |
| lib.rs | mpcli |
| version | 0.1.1 |
| created_at | 2025-12-05 03:19:41.88692+00 |
| updated_at | 2025-12-19 21:43:23.970379+00 |
| description | mpcli: Micropub Publisher CLI | Publish text-only blog posts to Micropub endpoints via a command-line interface. |
| homepage | https://github.com/mjdescy/mp |
| repository | https://github.com/mjdescy/mp |
| max_upload_size | |
| id | 1967628 |
| size | 71,517 |
A command-line tool for publishing text-only blog posts to any Micropub-compatible blogging service.
mp is a simple, fast, and reliable command-line utility for publishing blog posts to a Micropub-compatible blog. It supports publishing posts and drafts with content (including an optional title) provided by command-line arguments, a text file, or stdin.
mp is known to work with the microblogging services listed below.
| Service Name | API URL |
|---|---|
| Micro.blog | https://micro.blog/micropub |
git clone https://github.com/mjdescy/mp.git
cd mp
cargo build --release
The binary will be available at target/release/mp.
Before using mp, you need to configure your Micropub service settings:
mp configure
This will prompt you to enter:
The configuration is saved locally and will be used for all subsequent posts.
Publish a post with content as an argument:
mp post "Hello, world! This is my first post."
Publish a post from a file:
mp post --file my-post.txt
Publish a post from stdin:
echo "Hello from stdin!" | mp post --stdin
Create a draft (same syntax as posts):
mp draft "This is a draft post."
mp draft --file draft.txt
mp draft --stdin
Use the --quiet or -q flag to suppress output (useful for scripting):
mp post --quiet "Silent post"
mp post [OPTIONS] [CONTENT]Publish a post to your configured Micropub endpoint.
[CONTENT] - The content of the post as a command-line argument-t, --title: The title of the post (optional)-f, --file <PATH> - Read content from file at PATH-s, --stdin - Read content from stdin-e, --extract-title - Extract a post title from the first line of post content, if the first line starts with a Markdown level 1 heading ("# ")-q, --quiet - Suppress outputmp draft [OPTIONS] [CONTENT]Create a draft post (same options as post).
mp configureCreate or update the configuration file containing your authentication settings. mp configure will launch a short, guided process that prompts for user input and then outputs a configuration file.
The configuration is stored in a TOML file at the standard configuration directory for your platform. On Unix-like systems, this path is ~/.config/mp/config.toml.
To create a config file, simply run mp configure and follow the on-screen prompts.
[microblog_service]
api_url = "https://your-micropub-endpoint.example.com"
auth_token = "your-authentication-token"
[default_behavior]
quiet = false
extract_title = true
# Configure the tool (first time setup)
mp configure
# Publish a simple post
mp post "Just finished reading a great book!"
# Publish a simple post with a title
mp post "Just finished reading a great book!" --title "Post title"
# Publish a longer post from a file
mp post --file blog-post.md
# Publish a longer post from a file,
# and submit the first line in the file as
# the post title if it is a markdown level 1
# heading ("# ")
mp post --file blog-post.md --extract-title
# Create a draft for later
mp draft "Working on this idea..."
# Silent posting for automation
echo "Automated post" | mp post --stdin --quiet
# Get command usage information
mp help
mp help post
mp help draft
This project is licensed under the MIT License - see the LICENSE.md file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Michael Descy mike@mjdescy.me
If you encounter any issues or have questions, please file an issue on the GitHub repository.