# CLI

Read and change your records from the terminal, so you, your scripts, and your agents can work with your data without writing HTTP requests. Free with the JSON API add-on.

- Price: Included with the API add-on
- Gem: `gem "avo-cli"`
- Docs: https://docs.avohq.io/4.0/cli.html
- Web page: https://avohq.io/addons/cli
- Pricing: https://avohq.io/pricing.md

Requires the API add-on

The CLI is free, and it works only with an Avo app running the [API add-on](/addons/api). It talks to that API over HTTP, so without it there is nothing for the CLI to connect to.

Read and change your records from the terminal. You, your scripts, and your coding agents can list, inspect, create, update, and delete records with one command each, without writing a single HTTP request.

The CLI runs on your machine and talks to your app's API, so nothing extra gets installed in the app. Every call goes through the same policies as the UI: what a role cannot see in Avo, it cannot read from the terminal either.

## What it looks like

Install the gem, then log in with your app's API URL and an API token:

```
$ gem install avo-cli
$ avo login --host https://admin.example.com/api --token avo_xxxx

# List your resources, then inspect one's fields
$ avo schema
$ avo schema users
```

Work with records one command at a time. Results print as a readable table by default:

```
$ avo list users --sort name --dir desc --fields id,name,email --per-page 10
$ avo create users --data '{"name": "Ada Lovelace", "email": "ada@example.com"}'
$ avo update users 5 --data '{"name": "Ada King"}'
$ avo delete users 5
```

Add `--format json` to script it, or read the connection from the environment in CI:

```
$ avo get users 5 --format json | jq .record.email
"ada@example.com"

$ AVO_API_HOST=https://admin.example.com/api AVO_API_TOKEN=$TOKEN avo list orders
```

## What you get

- Commands for every resource your API exposes: `schema`, `list`, `get`, `create`, `update`, and `delete`
- Table output for people, `--format json` for scripts and agents
- Sorting, field selection, and pagination on `list`
- Data from a JSON string, a file with `@path`, or stdin
- Saved login, or `AVO_API_HOST` and `AVO_API_TOKEN` for CI
- Exit codes that separate a refused request (`1`) from a malformed command (`2`)

## Why it pays off

- Check or fix a record from the terminal in seconds, without opening the admin or writing a curl call.
- Give your coding agents a safe way into your data: they get one command per task, and your policies decide what they can touch.
- Included with the API add-on, and it tracks the API as Avo ships new releases.

Included in bundles: AI Bundle ($139/month)
