CLI

Command line

Publish, schedule and triage from a terminal or a CI job. A thin layer over the same API the app uses — zero dependencies, Node 18 or newer.

Install

shell
npm install -g echoia-cli

Or run it without installing, which is what a pipeline usually wants: npx echoia-cli accounts. The package is echoia-cli; the command it installs is echoia.

Authenticate

shell
echoia login

Opens your browser, you approve the terminal, and the key lands in ~/.config/echoia/config.json with 0600 permissions. Nothing to copy or paste.

It uses PKCE over a loopback redirect (RFC 8252). A CLI published on npm cannot keep a client secret — anyone can read it off the registry — so it commits to the hash of a random value up front and proves itself with the value at the end. The browser is handed a one-time code, never the key: a key in a redirect URL survives in browser history, in the referrer, and in every proxy log on the way.

Without a browser

A CI job has no browser and nobody to click, so the environment still wins over everything else — no login step needed:

shell
export ECHOIA_API_KEY="eko_..."

On a shared machine, pipe the key in so it never reaches argv: anyone else on the box can read a command line out of ps.

shell
echo "$KEY" | echoia login --stdin

echoia login --no-browser prompts instead, without echoing what you type. The browser flow is skipped automatically whenever output is not a terminal.

Your first commands

shell
# Which workspace does this key open?
echoia whoami

# What is connected, and does anything need reconnecting?
echoia accounts

# Draft a post — no --at or --now means it stays a draft
echoia post "Something I'm still thinking about" -a linkedin:@you

Draft is the default

Without --at or --now, nothing goes public — a draft waits in the Posts tab. --now publishes straight away and does not ask again: the flag is the confirmation.

Commands

CommandDoes
echoia loginSign in through your browser
echoia logoutRemove the stored key
echoia whoamiShow which workspace this key opens
echoia accountsList connected social accounts
echoia postsList posts
echoia postCreate a draft, schedule, or publish
echoia statsDaily performance of one post
echoia commentsList comments with sentiment and tags
echoia replyReply publicly to a comment
echoia rawCall any endpoint directly

Full options for each on the commands page, or echoia <command> --help in your terminal.

Environment

VariableEffect
ECHOIA_API_KEYThe key. Wins over the stored one.
ECHOIA_BASE_URLPoint at another API host.
ECHOIA_CONFIG_DIRWhere to keep config.json.
NO_COLORDisable colour. Also off when stdout is not a terminal.

Exit codes

  • 0 — success.
  • 1 — anything else. The message goes to stderr with a hint: a 403 names the missing scope, a 429 says whether waiting will help.
Was this page helpful?