Micropub CLI
An ultra-compliant Micropub CLI for interacting with Micropub-enabled sites like micro.blog.
Features
- ✅ Full W3C Micropub spec compliance
- ✅ CLI-managed drafts with YAML frontmatter
- ✅ Server-side draft support (push drafts to server before publishing)
- ✅ Automatic media upload and URL replacement
- ✅ Multi-site support with profiles
- ✅ IndieAuth/OAuth authentication
- ✅ Create, update, delete, undelete posts
- ✅ Backdated post publishing
- ✅ XDG-compliant configuration storage
Installation
Homebrew (macOS)
From Source
Quick Start
-
Authenticate with your site:
-
Create a new draft:
-
List drafts:
-
Push draft to server (optional):
# Or backdate when pushing -
Publish a draft:
See USAGE.md for detailed documentation.
Server-side Draft Workflow
Micropub supports pushing drafts to your server before publishing, allowing you to preview and edit posts on your site:
-
Create and edit a local draft:
# Edit the draft file in your editor -
Push draft to server (with draft status):
The draft is now on your server but not published (marked as
post-status: draft) -
Update the draft:
# Edit the local draft file -
Publish when ready:
This changes the server post from draft to published status
Benefits:
- Preview drafts on your site before publishing
- Edit and iterate on server-side drafts
- Works with backdating:
micropub draft push <id> --backdate "2023-12-25" - Available via MCP for AI assistant workflows
Architecture
config- Configuration and XDG directory managementauth- IndieAuth/OAuth authenticationdraft- Draft lifecycle managementclient- Micropub HTTP clientmedia- Media upload and path replacementpublish- Post publishing orchestrationoperations- Update/delete/undelete operations
Testing
# Run all tests
# Run with output
# Run specific test
Development
Built with Rust using:
- clap - CLI argument parsing
- reqwest - HTTP client
- tokio - Async runtime
- serde - Serialization
- oauth2 - OAuth flow
License
MIT