Skip to content
📝 Publish your markdown to medium, from cli
Branch: master
Clone or download
Pull request Compare This branch is 4 commits ahead of pavanjadhaw:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


XO Code Style used Latest version on npm Project license

publish your markdown to medium, from cli

MDM is commandline utility that lets you publish your markdown documents without leaving your comfy terminal.


No installation required. Can be directly used via npx!


MDM requires medium integration token and author id to be able to publish your markdown. You can generate integration token from the medium settings page. Export this integration token by adding it to your ~/.bashrc or ~/.zshrc as follows

export MEDIUM_TOKEN='token here'

After adding integration token you can easily get your unique author id by running

npx mdium init

Then export your unique author id as follows

export MEDIUM_ID='authorID here'

Now you are good to go...


For publishing, your markdown doc must have the following frontmatter:

title: My Awesome Post
tags: ['some', 'tags', 'here']
status: draft
## markdown here

Note that the status field can be either draft or public. I recommend that you publish them as drafts and fine tune using Medium’s editor.

If your post contains images, host them somewhere public and then include them in your document like so:


Medium will then CDN it and you can delete it from there if you want to.

When you’re ready to publish, run

$ npx mdium publish path/to/
Done! Your post has been published at

It’s that simple.


This project is completely based on @icyphox's mdium project. mdium is written is python, I wanted to try and implement it in node.


MIT © Pavan Jadhaw

You can’t perform that action at this time.