Help centerBack to app

Publish from the terminal with the CLI

Comfortable in a terminal? Publish a page to Coedit and read comments back with the coedit command.

Updated July 1, 20264 min read

This one is for people comfortable running commands in a terminal. If that is not you, you do not need it: create a project the normal way instead.

The coedit CLI is a small command you run in your terminal to publish a page and read back its comments and versions. It lives in the Coedit repository at cli/bin/coedit.mjs and uses the same Coedit REST API the app uses.

zsh · coedit
$ coedit push ./app.html --name "Summer Pass"✓ Published "Summer Pass"  Share:  https://coedit.page/summer-pass  Edit:   https://coeditapp.com/p/xa91?k=edit-…
$ coedit comments xa91 --open  1 open · "Can we try $29?" on node-price
coedit push publishes a file and prints the share and edit links.

Before you start

Step 1: Publish a page

Run the CLI with Node, pointing at your .html file:

node /path/to/Coedit/cli/bin/coedit.mjs push ./app.html --name "Summer Pass"
Prints the share link and the edit link for your new project.

Tidier: run npm link inside the cli/ folder once, and then you can just type coedit push ./app.html from anywhere.

Step 2: Read comments and versions

coedit pull <projectId>            # print the current HTML
coedit comments <projectId> --open  # list open comments
coedit versions <projectId>         # list version history
The projectId is printed when you push, and it's in the project's URL.

By default the CLI talks to http://localhost:3000. To point at another server, add --api https://your-coedit-url to any command, or set the COEDIT_API environment variable once.

Was this article helpful?
← All Bring work in from any tool articles