Publish from the terminal with the CLI
Comfortable in a terminal? Publish a page to Coedit and read comments back with the coedit command.
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.
$ 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
Before you start
- Node.js 18 or newer (check with
node --version). The CLI has no other dependencies to install. - The Coedit repository on your machine (you need the
cli/folder). - A running Coedit server to point at (local
http://localhost:3000, or your hosted URL).
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"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 historyBy 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.