mpcli: Micropub Publisher Command Line Interface
A command-line tool for publishing text-only blog posts to any Micropub-compatible blogging service.
Overview
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.
Features
- ✅ Publish posts directly to Micropub endpoints
- ✅ Read content from multiple sources (arguments, files, stdin)
- ✅ Post titles are optional
- ✅ Post titles can be extracted from line 1 of post content
- ✅ Quiet mode for scripting
- ✅ Configuration management with interactive setup
- ✅ Built with Rust for performance and reliability
Compatible Microblogging Services
mp is known to work with the microblogging services listed below.
| Service Name | API URL |
|---|---|
| Micro.blog | https://micro.blog/micropub |
Installation
From Source
The binary will be available at target/release/mp.
Configuration
Before using mp, you need to configure your Micropub service settings:
This will prompt you to enter:
- API URL: Your Micropub API endpoint URL (refer to the "Compatible Microblogging Services" table above)
- Authentication Token: Your Micropub authentication token
The configuration is saved locally and will be used for all subsequent posts.
Usage
Publishing Posts
Publish a post with content as an argument:
Publish a post from a file:
Publish a post from stdin:
|
Creating Drafts
Create a draft (same syntax as posts):
Quiet Mode
Use the --quiet or -q flag to suppress output (useful for scripting):
Command Reference
mp post [OPTIONS] [CONTENT]
Publish a post to your configured Micropub endpoint.
Arguments
[CONTENT]- The content of the post as a command-line argument
Options
-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 output
mp draft [OPTIONS] [CONTENT]
Create a draft post (same options as post).
mp configure
Create 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.
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.
Example Configuration File
[]
= "https://your-micropub-endpoint.example.com"
= "your-authentication-token"
[]
= false
= true
Usage Examples
# Configure the tool (first time setup)
# Publish a simple post
# Publish a simple post with a title
# Publish a longer post from a file
# 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 ("# ")
# Create a draft for later
# Silent posting for automation
|
# Get command usage information
Requirements
- Rust 1.70+ (for building from source)
- A Micropub-compatible blogging service
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
Michael Descy mike@mjdescy.me
Support
If you encounter any issues or have questions, please file an issue on the GitHub repository.