# Command line (CLI)

Source: https://heyeveryone.ai/docs/cli

> Run every heyeveryone tool from a terminal, a script or an agent's shell, with the same permissions as MCP and the API.

## Install and log in

The CLI runs on Node 22 or later. It's coming to npm as `heyeveryone`; until then, build it from `packages/cli` (see its README), or use the same tools over MCP and the REST API. Log in with a personal access token from Settings > Agents. The CLI checks it, saves it readable only by you, and never prints it.

## Every tool is a command

Each REST operation is a command with one flag per input field, generated from the OpenAPI document, so the CLI always matches the API. `heyeveryone tools` lists them; `heyeveryone <tool> --help` shows the flags. Pass the whole input as JSON with `--json` when that’s easier.

## The top flows in one command

`draft` creates content with a version per channel, `upload` adds an image or video to the media library, `schedule` puts a channel version at a time or in the queue, `publish` publishes it, and `results` shows how published posts did.

## Publishing stays with your permissions

A person confirms before anything goes live, unless a workspace owner lets this agent publish on its own (Autopilot). Without Autopilot, `publish` asks a person to confirm and says so; it never goes around the check, which heyeveryone makes on every call.

## Made for scripts and agents

Output is JSON when piped and a table on a terminal. Every write that can take an idempotency key gets one, so a retry never does it twice. Exit codes say what happened, and a rate-limited call says how many seconds to wait.

## Usage

The `heyeveryone` CLI (npm package `heyeveryone`, Node 22 or later; its
first npm release is waiting, so until then it runs from
`packages/cli` in the repository) calls the same REST operations as any
other agent. Every tool is a command, generated from the OpenAPI document:

```sh
heyeveryone login                       # paste a hey_pat_ token; saved readable only by you
heyeveryone whoami                      # the agent, its workspaces, Autopilot on or off
heyeveryone tools schedule              # tools whose name or summary matches
heyeveryone create_content --title "Launch week" --master-text "Monday we launch."
heyeveryone get_results --platform linkedin --limit 10
heyeveryone update_post --json @post.json   # the whole input as JSON (or --json -)
```

Five commands cover the main flows:

```sh
heyeveryone draft --title "Launch week" --text "Monday we launch." --post sandbox
heyeveryone draft --title "Launch week" --text "The original draft" \
  --post linkedin="A longer LinkedIn version" \
  --post x="First post of a thread
---
Second post"
heyeveryone upload ./launch.png         # prints a media id for --media
heyeveryone schedule <postId> --at 2026-11-20T09:00   # or --at +2h, or --queue
heyeveryone publish <postId>            # asks a person unless the agent has Autopilot
heyeveryone results --channel linkedin
```

- **Channels.** A `--post` names a channel by its platform (`sandbox`,
  `linkedin`, or `x` for a Sandbox account that behaves like X), its handle
  (`@acme`), its display name or `platform:handle`, ignoring case; without
  `=text` the version follows the original draft. A new workspace's Sandbox
  answers to `sandbox`, so the first line works there as is.
  `heyeveryone list_channel_accounts` shows the names, and a name that
  matches none or several lists the choices.
- **A person confirms.** Without Autopilot, `schedule` and `publish` only
  request: the post waits in **Updates** for a person, and the CLI says so.
  heyeveryone checks this on every call; the CLI can't go around it.
- **Workspace.** `--workspace <id or name>`, or `HEYEVERYONE_WORKSPACE`, or
  `heyeveryone login --workspace …` to save a default. A token with one
  workspace needs none.
- **Token.** `heyeveryone login`, `HEYEVERYONE_TOKEN`, or `--token` for one
  call. It is never printed.
- **Output.** A table on a terminal, JSON when piped (`--output json|table`).
  Errors go to stderr (JSON with `--output json`).
- **Retries.** Every write that takes an idempotency key gets one
  (`--idempotency-key` to choose it); a failed write prints the key to retry
  with. A 429 says how many seconds to wait.
- **Exit codes.** 0 done, 1 unexpected, 2 usage, 3 not logged in, 4 not
  allowed, 5 not found, 6 refused (a conflict or a rule), 7 rate limited,
  8 heyeveryone or the network unavailable.

## Request limits

| Limit | Default | Counts |
|---|---|---|
| `agent` | 120 a minute | every request of one agent (the agent a token belongs to, so refreshing a token doesn't reset it) |
| `heavy` | 30 a minute | on top, per agent: calls of tools that cost credits or reach outside heyeveryone (publishing, URL fetches, platform checks; `tools/list` marks them with `openWorldHint` or a credit note) |
| `account` | 600 a minute | every agent request of one account, all its agents together |
| `ip` | 600 a minute | every request from one address (an IPv6 /64), signed in or not |

A refused request returns HTTP 429 with `Retry-After` in seconds. Wait that long, then retry.
