# Zernio CLI

Install the Zernio CLI, authenticate, choose the right command, and verify results from your terminal or an AI agent.

Use the Zernio CLI to manage posts, messages, analytics, and accounts from your terminal. API commands return JSON for shell scripts and agents.

## First command

Install with npm, then check the installed version:

```bash
npm install -g @zernio/cli
zernio --version
```

Authorize this machine in your browser, then make a read-only request:

```bash
zernio auth:login
zernio accounts:list --pretty
```

The account list contains the IDs used by posting and inbox commands. An empty list means no accounts are visible to this key; [connect an account](/guides/connecting-accounts) before publishing.

For CI or agents without a browser, supply `ZERNIO_API_KEY` through your secret manager. See [authentication](/cli/authentication) before running commands.

## Commands

Choose by the result you need. These pages cover common tasks, not every API operation.

| Task | Start here | Effect |
|---|---|---|
| Create, schedule, edit, or remove a post | [Posting](/cli/posting) | Read, write, or destructive |
| Read conversations or send a reply | [Inbox](/cli/inbox) | Read or customer-visible write |
| Read post metrics or inbox volume | [Analytics](/cli/analytics) | Read |
| Inspect campaigns, audiences, or leads | [Ads](/cli/ads) | Read; writes can affect spend |
| Use a platform-specific feature | [Platforms](/cli/platforms) | Depends on command |
| Manage keys, webhooks, or team settings | [Management](/cli/management) | Read, write, or destructive |

For the complete command list and the flags supported by your installed version:

```bash
zernio --help
zernio posts:create --help
```

## Update the CLI

```bash
npm install -g @zernio/cli@latest
zernio --version
```

Pin a tested package version in automation. Check command help after an update rather than assuming every new API field has a CLI flag.

## Use with agents

Read [CLI for agents](/cli/agents) for credential setup, ID discovery, JSON handling, and safe retries. Open **Open → View Markdown** for this page's plain-text version, without an AI-provider account.

## How it behaves

- Successful API commands print response bodies to stdout as JSON. `--pretty` indents them.
- Help, version output, and parser errors are text, not API response JSON.
- Authentication uses your Zernio API key, not the social account's access token.
- Commands combine hand-written conveniences and generated operations. The CLI does not guarantee coverage of every API operation or field.
- A successful command is not proof every target finished publishing. Inspect the returned state and verify with `posts:get`.

## Related

- [Authentication](/cli/authentication): browser login, existing keys, and CI
- [Options and output](/cli/options): global flags, pagination, and errors
- [CLI for agents](/cli/agents): a read-first execution workflow
- [GitHub source](https://github.com/zernio-dev/zernio-cli)
- [npm package](https://www.npmjs.com/package/@zernio/cli)