# CLI

> Sign in from your browser and call Clonvo’s tools from a terminal with the open-source Clonvo CLI.

The Clonvo CLI runs Clonvo’s [tools](https://clonvo.com/docs/tools.md) from a terminal. Sign in with your browser once, then call any tool as a command: `clonvo web_search "…"`. Results print as JSON, so you can pipe them into `jq`, a script or an agent. The source is on [GitHub](https://github.com/clonvodotcom/cli).

It needs Node.js 22 or later. Install it from npm, and the command is `clonvo`:

```bash
npm install -g @clonvo/cli
```

To run it without installing, use `npx @clonvo/cli` in place of `clonvo`.

## Sign in

```bash
clonvo login
```

Your browser opens Clonvo. Choose the organization and project the CLI works in, and approve. Calls bill to that project and appear in Activity under **Clonvo CLI**. Your organization needs Pay as you go or higher to call tools, which it gets when you first buy credits.

The sign-in is saved in `~/.config/clonvo/cli-credentials.json` (on Windows, `%APPDATA%\clonvo`), readable only by you, and renews itself. To see or disconnect it, go to **Settings → Connected apps**, or run `clonvo logout`.

On a server, in CI, or anywhere without a browser, use an API key instead. The CLI uses `CLONVO_API_KEY` when it’s set, before any saved sign-in:

```bash
export CLONVO_API_KEY="sk-cv-v1-…"
clonvo whoami
```

`clonvo login --with-key` saves a key instead of signing in. It reads the key from standard input, so it stays out of your shell history.

## Call a tool

Every tool is a command. Values without a flag fill the tool’s required arguments in order, and every other argument is a flag, written with dashes or underscores:

```bash
clonvo web_search "durable objects vs queues" --max-results 3 --time-range month
clonvo web_scrape https://clonvo.com/docs/quickstart
clonvo company_enrich --domain stripe.com
```

`clonvo tools` lists the tools you can call, and `clonvo <tool> --help` shows a tool’s arguments, built from the same schema as [`GET /v1/tools`](https://clonvo.com/docs/calling-tools.md#list-tools).

Flags take the type the schema gives them. Repeat a list flag to add items, or pass a JSON array. Object arguments take JSON inline, from a file with `@`, or from standard input with `-`:

```bash
clonvo web_search "vector databases" --include-domains github.com --include-domains arxiv.org
clonvo web_extract https://example.com/pricing --schema @pricing-schema.json
echo '{"query": "agent memory", "max_results": 3}' | clonvo web_search --args -
```

The tool’s result prints to standard output as JSON. In a terminal, a line on standard error shows the tool, who served it, what it was charged and its generation id. `--full` prints the whole response, with `usage` and `provider`, and `--compact` prints it on one line:

```bash
clonvo web_search "clonvo" --compact | jq -r '.results[].url'
```

`--provider` limits the call to the providers you name, the same as `provider.only` in the [REST API](https://clonvo.com/docs/tool-routing.md):

```bash
clonvo web_scrape https://example.com --provider clonvo
```

## Long-running tools

`web_crawl`, `web_research` and `browser_task` run as [jobs](https://clonvo.com/docs/jobs.md). The CLI waits for the job and prints its result. Press Ctrl-C to cancel the job and stop.

With `--no-wait`, the CLI prints the job at once instead, and you check it later:

```bash
clonvo web_research "state of browser agents" --no-wait
clonvo jobs get gen-…
clonvo jobs cancel gen-…
```

## Commands

| Command | What it does |
| --- | --- |
| `clonvo login` | Sign in with your browser |
| `clonvo login --with-key` | Save an API key instead, read from standard input |
| `clonvo logout` | Sign out and disconnect this computer |
| `clonvo whoami` | How you’re signed in, the plan and the balance (`--json` for JSON) |
| `clonvo balance` | The organization’s credit balance |
| `clonvo tools` | The tools you can call (`--json` for the full list with schemas) |
| `clonvo <tool> [args]` | Call a tool |
| `clonvo <tool> --help` | A tool’s arguments |
| `clonvo jobs get <id>` | Read a job |
| `clonvo jobs cancel <id>` | Cancel a job |
| `clonvo completion bash\|zsh\|fish` | Print a shell completion script |
| `clonvo help [command\|tool]` | Help for a command or a tool |

| Environment variable | Use |
| --- | --- |
| `CLONVO_API_KEY` | An API key to use instead of the saved sign-in |
| `CLONVO_API_URL` | The API to call. Defaults to `https://api.clonvo.com` |
| `CLONVO_CONFIG_DIR` | Where to keep the sign-in. Defaults to `~/.config/clonvo` |
| `CLONVO_DEBUG` | Set to `1` to log each HTTP request, like `--debug` |
| `CLONVO_NO_UPDATE_NOTIFIER` | Set to `1` to stop the daily check for a newer version |
| `NO_COLOR` / `FORCE_COLOR` | Turn color off or on |

`--debug` logs each HTTP request to standard error, with its method, URL, status and time, and never tokens or bodies. `--no-color` turns color off.

The CLI exits with `0` on success, `1` when a call fails, `4` when you need to sign in, and `130` when you cancel with Ctrl-C.

## Shell completion

`clonvo completion` prints a script that completes commands, tool names and each tool’s arguments. Tool names come from the last `clonvo tools` or tool call, so pressing Tab never waits on the network.

```bash
echo 'eval "$(clonvo completion zsh)"' >> ~/.zshrc
echo 'eval "$(clonvo completion bash)"' >> ~/.bashrc
clonvo completion fish > ~/.config/fish/completions/clonvo.fish
```

## Updates and telemetry

Once a day, in an interactive terminal, the CLI asks the npm registry for the latest version and tells you when there’s a newer one. It doesn’t check in CI. The CLI collects no telemetry; your calls appear in Activity like any other API call.
