Because writing in markdown and performing commands via the terminal makes me feel more like a hacker.

This blog is built with Plato (soon to be open source, I promise), an opinionated CLI for Metalsmith. It's a pleasure to use, since I get to write all of these posts in markdown, `plato preview` to preview the post locally, then `plato save` and `plato deploy` to push changes to GitHub, where it's hosted.

I loved writing in Markdown so much, that I wanted to do the same when publishing to Medium. When I saw that Medium released a publishing API, I knew that I had to make a CLI for it (and it's open sourced).

Here is the npm and GitHub.

Have fun!


$ npm install -g medium-cli


There are four commands: `medium create`, `medium login`, `medium publish`, and `medium open`.

create <directory name>

$ medium create buzzfeed

  medium · Successfully created your blog!

This command creates a new sub directory <directory name> in your current directory, with two example articles. The directory looks like this:

├── articles
|   ├── 12-classic-love-scenes-improved-by-a-chipotle-burrito
|   |   └──
|   └── 51-corgi-gifs-that-will-change-your-life
|       └──
└── .gitignore

The `` files are the blog posts. More on this later.


$ medium login

  medium · Please open in your browser.
         · At the bottom of the page, under `Integration Tokens`, copy
         · this description:

         · "Medium-CLI basic publishing access."

         · Then generate the new token and copy it.

  Paste your Integration Token here: XXXX

         · Authenticating into Medium..

         · Saved!

This command asks you for your Integration Token (which can be retrieved at the bottom of this page). It also auths into Medium to get your user information. Lastly, it saves the token, your `userId`, and your URL to your ~/.netrc file.


$ medium publish

This command iterates through your `` files in `./articles` and publishes the ones that don't have `published: true` in the front matter to your Medium account.

Here is an example of an `` file:

title: 12 Classic Love Scenes Improved By A Chipotle Burrito
tags: burrito, gifs, love
publishStatus: draft
license: all-rights-reserved

# 1. Titanic (1997)


# 2. The Notebook (2004)


# 3. Dirty Dancing (1987)


Note that `title` is the only field that is required in the front matter, with all the other ones optional. For a list of the accepted possible parameters, see Medium's API documentation. `contentFormat` and `content` are not required in the front matter, as they are both added later by the `medium publish` command.

For each successful post, the `medium publish` command also adds `published: true` to the front matter.


$ medium open

This directs your browser to your Medium page. You need to have `medium login` first to set your Medium URL.