# Command line reference

> For AI agents: the index of these docs is at https://indrava.forumulate.com/docs/llms.txt (every page it lists has a Markdown version like this one).

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:

```bash
npm install --global ./apps/cli
indrava help
```

## Sign in

```bash
indrava login --api-url http://localhost:4000
```

This 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:

```bash
indrava login --key --api-url http://localhost:4000
```

The 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`:

```bash
export INDRAVA_API_URL=http://localhost:4000
export INDRAVA_API_KEY=YOUR_API_KEY
```

`INDRAVA_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:

```bash
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.json
```

Values 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](https://indrava.forumulate.com/docs/operations).

These commands have a shorter form of their own:

| Command | What it does | Scope |
| --- | --- | --- |
| `indrava login` | Sign in in the browser with a device code |  |
| `indrava login --key` | Store an API key instead |  |
| `indrava logout` | Forget the stored credential |  |
| `indrava whoami` | The workspace, scopes, plan and timezone of the credential | none |
| `indrava commands` | Every command, one per API operation |  |
| `indrava posts list` | List posts: id, status, time, start of the text | `posts:read` |
| `indrava posts create` | Save a draft | `posts:write` |
| `indrava posts schedule` | Publish at a time | `posts:write` and `posts:publish` |
| `indrava posts publish` | Publish now | `posts:write` and `posts:publish` |
| `indrava posts submit <id>` | Send a draft on its way: for approval where the workspace asks for it | `posts:write` |
| `indrava posts enqueue <id>` | Schedule a draft at the next free slot of each channel | `posts:write` and `posts:publish` |
| `indrava posts delete <id>` | Delete a post | `posts:write` |
| `indrava posts retry <id>` | Retry the failed channels of a post | `posts:write` |
| `indrava media upload <file>` | Add an image or video; prints the id for `--media` | `media:write` |
| `indrava analytics overview` | Totals for a period: `--from <time> --to <time>` | `analytics:read` |
| `indrava help` | 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 |
| --- | --- |
| `--status <status>` | Only posts with this status. Repeat for several. One of `draft`, `pending_approval`, `scheduled`, `publishing`, `published`, `failed` |
| `--limit <n>` | At most this many, 1 to 500 |

### Options of `posts create`, `posts schedule` and `posts publish`

| Option | Meaning |
| --- | --- |
| `--text "<text>"` | The text. Required. Repeat it to make a thread |
| `--channel <id>` | A channel id from `channels list`. Repeat it to cross-post. Required for `schedule` and `publish`; a draft may be saved without channels |
| `--media <id>` | A file id from `media upload`. Repeat for several. Files are attached to the first part |
| `--at <time>` | When to publish, for `posts schedule` only, where it is required. An ISO 8601 time such as `2027-01-31T09:00:00Z` |
| `--idempotency-key <key>` | 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 |
| --- | --- |
| `--json` | Machine-readable output on standard output; errors as JSON on standard error |
| `--api-url <url>` | The API to talk to. Default: `$INDRAVA_API_URL`, then the one you logged in to, then `http://localhost:4000` |
| `--help`, `-h` | Show usage |

## Examples

```bash
# 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_ID
```

## Exit codes

| Code | Meaning |
| --- | --- |
| `0` | Success |
| `1` | The API refused the request or failed |
| `2` | Bad usage: an unknown command or option, or a missing value |
| `3` | Not signed in, or the sign-in expired |

---

## For AI agents

- This page for a human reader: https://indrava.forumulate.com/docs/cli
- The whole space as one Markdown file: https://indrava.forumulate.com/docs/llms-full.txt
- Live search + fetch over MCP: https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/mcp
  - Install (Claude CLI): `claude mcp add forumulate-docs --transport http https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/mcp`

This Markdown is the same content the page renders — safe to quote and to ground answers in.
