> ## Documentation Index
> Fetch the complete documentation index at: https://kavenio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

The Kavenio CLI lets you and your agents check setup, connect accounts, inspect
connected account groups, validate payloads, and publish posts from the
terminal.

It uses the same API and SDK objects as the rest of Kavenio, and prints JSON
responses so agents, scripts, and job runners can read the output directly.

## Installation

Install the CLI globally.

<CodeGroup>
  ```bash npm theme={null}
  npm install -g @kavenio/cli
  ```

  ```bash yarn theme={null}
  yarn global add @kavenio/cli
  ```

  ```bash pnpm theme={null}
  pnpm add -g @kavenio/cli
  ```

  ```bash bun theme={null}
  bun add -g @kavenio/cli
  ```
</CodeGroup>

Check that the command is available:

```bash theme={null}
kavenio --help
```

## Authenticate

Set an API key in the environment where the CLI runs.

```bash theme={null}
export KAVENIO_API_KEY="kvn_..."
```

`KAVENIO_API_TOKEN` is also supported. If both are set, the CLI uses
`KAVENIO_API_TOKEN`.

Use `health` when an agent or script needs to verify the same setup:

```bash theme={null}
kavenio health
```

## Get started

Choose a stable profile key from your app, start a hosted account connection,
then use the connected account to publish.

```bash theme={null}
kavenio connect begin \
  --profile-id customer_user_123 \
  --platform linkedin \
  --return-to https://yourapp.com/settings/integrations
```

The connection response includes an `authorizationUrl`. Open it for the user or
pass it into the browser flow your agent is controlling.

After the connection completes, Kavenio redirects to `returnTo` with query
parameters such as `accountId`, `profileId`, and `platform`.

```bash theme={null}
kavenio accounts list --profile-id customer_user_123
```

Create a post from inline fields:

```bash theme={null}
kavenio posts create \
  --profile-id customer_user_123 \
  --content "Shipping our first post with Kavenio." \
  --publish-now \
  --platform linkedin:acc_123
```

Omit `accountId` when you want to publish to every connected account for that
platform inside the profile key.

## What you can do

* Connect accounts: `kavenio connect begin`, `kavenio connect providers`.
* Connect Bluesky with App Password credentials:
  `kavenio connect bluesky --profile-id customer_user_123 --identifier name.bsky.social --app-password app-password`.
* Manage platform keys: `kavenio platform-keys list`,
  `kavenio platform-keys upsert`.
* Inspect accounts: `kavenio accounts list`, `kavenio accounts health`.
* Publish content:
  `kavenio posts create --profile-id customer_user_123 --content "Hello" --publish-now --platform linkedin:acc_123`.
* Validate content: `kavenio validate post --file post.json`.
* Upload and validate media: `kavenio media presign`, `kavenio media validate`.
* Manage Google Business: `kavenio accounts gmb-location-details`,
  `kavenio accounts gmb-reviews`.
* Read Google Business analytics:
  `kavenio analytics googlebusiness-performance`.
* Manage Bluesky text DMs: `kavenio accounts bluesky-conversations`,
  `kavenio accounts bluesky-messages`,
  `kavenio accounts bluesky-message-send`,
  `kavenio accounts bluesky-conversation-read`, and
  `kavenio accounts bluesky-conversation-archive`.
* Manage queues: `kavenio queue preview`, `kavenio queue next-slot`.
* Configure webhooks: `kavenio webhooks create --file webhook.json`.
* Work with ads: `kavenio ads list`, `kavenio ads create --file ad.json`.

Run `kavenio --help` for the full command list.

## Agent usage

The CLI is useful for AI agents because it gives them a narrow, structured way
to inspect and operate Kavenio without writing application code first.

Typical agent tasks:

* Verify credentials with `kavenio health`.
* Choose or derive the correct profile key from the customer app.
* Start a connection flow and return the `authorizationUrl`.
* Configure or inspect platform keys before starting provider connection flows.
* Read connected account IDs from `kavenio accounts list`.
* Validate a post payload before publishing.
* Inspect webhook delivery logs after an event fails.

## Platform key commands

Use platform keys when a workspace should connect, refresh, publish, or run ads
with its own provider app credentials.

```bash theme={null}
kavenio platform-keys catalog
kavenio platform-keys list
kavenio platform-keys upsert --platform youtube --values-file youtube-app.json
kavenio platform-keys test --platform youtube --credential-id aaaaaaaaaaaaaaaa
```

Lifecycle commands:

```bash theme={null}
kavenio platform-keys disable --credential-id aaaaaaaaaaaaaaaa
kavenio platform-keys reset --credential-id aaaaaaaaaaaaaaaa
kavenio platform-keys mark-accounts-needs-reconnect \
  --credential-id aaaaaaaaaaaaaaaa
```

Admins can manage system defaults with `--scope system`.

## Google Business commands

Use the standard connect command to start OAuth:

```bash theme={null}
kavenio connect begin --profile-id customer_user_123 --platform googlebusiness
```

Then select a location:

```bash theme={null}
kavenio connect googlebusiness-locations --account-id acc_123
kavenio connect googlebusiness-select-location \
  --account-id acc_123 \
  --profile-id customer_user_123 \
  --location-id 9281089117903930794
```

Google Business management commands are grouped under `accounts gmb-*`.

```bash theme={null}
kavenio accounts gmb-location-details --account-id acc_123
kavenio accounts gmb-reviews --account-id acc_123
kavenio accounts gmb-food-menus --account-id acc_123
kavenio accounts gmb-place-actions --account-id acc_123
```

Analytics commands are grouped under `analytics`.

```bash theme={null}
kavenio analytics googlebusiness-performance --account-id acc_123
kavenio analytics googlebusiness-search-keywords --account-id acc_123
```

## Bluesky commands

Bluesky uses credential connection with a Bluesky identifier and App Password,
not OAuth:

```bash theme={null}
kavenio connect bluesky \
  --profile-id customer_user_123 \
  --identifier name.bsky.social \
  --app-password xxxx-xxxx-xxxx-xxxx
```

Published Bluesky posts use the shared `posts` commands for creation,
validation, analytics, comments, and unpublish. Text-only Bluesky DMs are
account commands:

```bash theme={null}
kavenio accounts bluesky-conversations --account-id acc_123
kavenio accounts bluesky-messages \
  --account-id acc_123 \
  --conversation-id convo_123
kavenio accounts bluesky-message-send \
  --account-id acc_123 \
  --conversation-id convo_123 \
  --text "Thanks for the note."
kavenio accounts bluesky-conversation-read \
  --account-id acc_123 \
  --conversation-id convo_123
kavenio accounts bluesky-conversation-archive \
  --account-id acc_123 \
  --conversation-id convo_123
```

## Related docs

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/docs/">
    Connect an account and publish the first post.
  </Card>

  <Card title="Node SDK" icon="js" href="/docs/sdk/node">
    Use the SDK in application code.
  </Card>
</CardGroup>

## FAQ

### Should I use the CLI or SDK?

Use the SDK in application code. Use the CLI for agents, scripts, local checks,
and operational tasks.

### Does the CLI replace the dashboard?

No. Use the dashboard for visual account management and workspace settings. Use
the CLI when structured JSON output or automation is more useful.

### Where are all command options documented?

Run `kavenio --help`. The docs page stays short on purpose; the CLI itself is
the source of truth for command flags.
