writer-cli

Write from your terminal.
Publish with one command.

A command-line tool for bloggers who have a static site and just want to open a terminal, write something, and have it live on the Internet.

curl -fsSL https://raw.githubusercontent.com/brennanbrown/writer-cli/main/INSTALL.sh | bash

Installs to ~/.local/bin/.
Feel free to read the installer source before running.
It's 120 lines of plain bash!


What it looks like

After you type the command, you'll be prompted:


How it works

  1. Run writer my-slug: writer asks for your post title and optional tags.
  2. Your editor opens with the cursor on the first blank line below the frontmatter. Write your post. Save and close.
  3. You're asked for an optional one-line description/summary.
  4. Press Enter to confirm. Writer builds the site and pushes to git.

At the confirm step, pressing N saves your post file without building or pushing. You can come back and publish later.

Full guide →


Why?

Made for SSH

Run writer on a remote server. Hugo, git, and your editor all live there, and you just connect and write.

A familiar default editor

The default editor is micro. Ctrl+S saves, Ctrl+Q quits, just like you'd expect.

Guided setup wizard

Run writer --setup and answer the prompts. Each one comes with a sensible default, so you can press Enter right through.

Small and auditable

700 lines of bash across 8 files, with no npm, no Python, and no external dependencies.

Hugo, Eleventy, Jekyll

Works with any SSG that has a shell build command. YAML or TOML frontmatter.

Drafts and sections

--draft keeps posts out of the build. --section puts them in a different folder. --no-push builds without pushing.


Install & Setup

1. Install

curl -fsSL https://raw.githubusercontent.com/brennanbrown/writer-cli/main/INSTALL.sh | bash

Or clone and symlink manually:

git clone https://github.com/brennanbrown/writer-cli
ln -s "$PWD/writer-cli/writer.sh" ~/.local/bin/writer
chmod +x ~/.local/bin/writer

2. Run setup

writer --setup

The wizard asks ten questions: your SSG, build command, content directory, editor, timezone, etc. Each prompt shows the current default. Press Enter to keep it. You only need to do this once.

If you skip setup and run writer directly, the wizard starts automatically on first run.

3. Write

writer on-the-meaning-of-home

The slug, the part after writer, becomes the URL path for your post. Keep it lowercase, use hyphens for spaces, letters and numbers only.

Full guide   Reference


About

Hi, I'm Brennan! I'm a Queer Métis author and FOSS web developer based in Mohkínstsis, Treaty 7 territory, and the founder of 🍓 Berry House. I write personal essays, cultural criticism, and about why the Internet is worth fighting for. IndieWeb forever!

I built writer-cli inspired by the TTBP (tilde.town feels engine), a blogging tool from the tildeverse that makes writing and publishing feel effortless. I wanted something like that for my own static site. If it's useful to you too, I'd love it if you considered supporting my work.

Support Brennan ↗