Command line reference
Install the indrava command, sign in, and every command, option and exit code.
indrava is a thin client of the REST API: each command is one API call. It needs Node 26 or newer and has no other dependencies.
Install
The command is not on npm yet. It installs from the apps/cli folder of the Indrava repository:
npm install --global ./apps/cli
indrava helpSign in
indrava login --api-url http://localhost:4000This prints an address and a code. Open the address, sign in and confirm the code. If the server has no device sign-in, the command asks for an API key instead. To use an API key on purpose:
indrava login --key --api-url http://localhost:4000The key can also be piped in: echo "$KEY" | indrava login --key.
login checks the credential with the API before it reports success. The credential is stored in ~/.config/indrava/cli.json ($XDG_CONFIG_HOME/indrava/cli.json when that is set, %APPDATA%\indrava\cli.json on Windows), readable only by you. indrava logout deletes it.
In CI and for agents
Set two variables and do not run login:
export INDRAVA_API_URL=http://localhost:4000
export INDRAVA_API_KEY=YOUR_API_KEYINDRAVA_API_KEY wins over a stored credential.
Commands
Every operation of the API is a command, named after it. indrava commands prints them all, one per line with a summary, so the list always matches the API you are talking to:
indrava commands
indrava channels list
indrava posts get POST_ID
indrava media import-url --url https://example.com/a.png
indrava feeds save --data @feed.jsonValues that are part of the address come first (POST_ID). Every other input is --name value; repeat a flag for a list. --data takes the whole input as JSON: the text itself, @file, or - for standard input. The scope each command needs is that of its operation, listed on the operations page.
These commands have a shorter form of their own:
Command | What it does | Scope |
|---|---|---|
| Sign in in the browser with a device code | |
| Store an API key instead | |
| Forget the stored credential | |
| The workspace, scopes, plan and timezone of the credential | none |
| Every command, one per API operation | |
| List posts: id, status, time, start of the text |
|
| Save a draft |
|
| Publish at a time |
|
| Publish now |
|
| Send a draft on its way: for approval where the workspace asks for it |
|
| Schedule a draft at the next free slot of each channel |
|
| Delete a post |
|
| Retry the failed channels of a post |
|
| Add an image or video; prints the id for |
|
| Totals for a period: |
|
| Show usage |
posts submit on a post that needs no approval schedules it, and then needs posts:publish too.
Options of posts list
Option | Meaning |
|---|---|
| Only posts with this status. Repeat for several. One of |
| At most this many, 1 to 500 |
Options of posts create, posts schedule and posts publish
Option | Meaning |
|---|---|
| The text. Required. Repeat it to make a thread |
| A channel id from |
| A file id from |
| When to publish, for |
| A retry with the same key returns the same post instead of making a second |
Each of the three prints the id of the post.
Options of every command
Option | Meaning |
|---|---|
| Machine-readable output on standard output; errors as JSON on standard error |
| The API to talk to. Default: |
| Show usage |
Examples
# the channels you can post to, and what this credential may do
indrava channels list
indrava whoami
# a draft, without channels yet
indrava posts create --text "An idea for later"
# one post with a picture to two channels, tomorrow morning
indrava media upload ./launch.png
indrava posts schedule --text "We shipped it" --media MEDIA_ID \
--channel CHANNEL_A --channel CHANNEL_B --at 2027-01-31T09:00:00Z
# a thread of two parts, now
indrava posts publish --text "First part" --text "Second part" --channel CHANNEL_A
# a draft made by an agent, sent for approval
indrava posts submit POST_ID
# failed posts as JSON, then retry one
indrava posts list --status failed --json
indrava posts retry POST_IDExit codes
Code | Meaning |
|---|---|
| Success |
| The API refused the request or failed |
| Bad usage: an unknown command or option, or a missing value |
| Not signed in, or the sign-in expired |