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.
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:
$ writer my-new-post Title: My New Post Tags (comma-separated): life, coffee → Created: content/posts/my-new-post/index.md → Opening in micro... [you write your post, then Ctrl+S to save and Ctrl+Q to quit] Summary: A short piece about mornings. Confirm build and push? [Y/n]: → Building site... done (1.8s) → git add . → git commit -m "new post: my-new-post" → git push... ✓ Published: my-new-post
How it works
- Run
writer my-slug: writer asks for your post title and optional tags. - Your editor opens with the cursor on the first blank line below the frontmatter. Write your post. Save and close.
- You're asked for an optional one-line description/summary.
- 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.
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.
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.