Skip to content

Command Line Interface ​

writeroom is a command line tool for reading and editing WriteRoom documents from the terminal and scripts. It drives the running WriteRoom app, and also runs WriteRoom's MCP server.

Installing the writeroom Command ​

  1. Choose WriteRoom > Install Command-Line Tool…
  2. Click Copy Install Command, then paste it into Terminal and run it.

This links /usr/local/bin/writeroom and its man page into WriteRoom.app. If you move WriteRoom.app, install again.

Quick Examples ​

Commands target the frontmost document by default. WriteRoom needs to be running.

sh
writeroom get documents                        # list open documents
writeroom get document                         # print the frontmost document's text
writeroom get selection                        # print the selected text
writeroom update selection --text "Hello"      # replace the selection
writeroom create document ~/notes/today.md     # create a file and open it
writeroom open document ~/notes/todo.md        # open a file
writeroom save document                        # save the frontmost document
writeroom close document                       # close it

Use --document with an id from get documents, or a file path, to target another document. Use -f - to read text from standard input:

sh
writeroom get document | tr a-z A-Z | writeroom update document -f -

Read the manual with man writeroom, and get help for any subcommand with --help, e.g. writeroom update selection --help.

See also ​