# The Quelvio CLI: set up agents, ask from a terminal

Docs · Human page: https://quelvio.com/docs/cli · Machine view: https://quelvio.com/ai/docs/cli

## The CLI

`quelvio` sets up an agent where the agent runs, and lets a person ask Knowledge from a terminal.

## In twelve sentences

1. `quelvio` is Quelvio's command-line program. It sets up an agent where the agent runs, and it lets a person ask Knowledge from a terminal.
2. It is one small Python program with no dependencies: `pipx install quelvio`, or one file with a published SHA-256.
3. For an agent, it uses a key made on Keys in the Lab: a person's own key for a registered agent, or a service key that a steward makes. The key lives in the keychain or in `QUELVIO_KEY`. The program never takes it as an argument, never prints it and never writes it anywhere.
4. `quelvio setup claude-code` writes Claude Code's hooks and the MCP entry, and stores the key where there is a keychain. `quelvio check` shows whether the program, the server, the agent and each product are ready.
5. For a person, `quelvio login` opens the browser once, and the person signs in as themselves, as they do for their own assistant, where an organisation owner has allowed the CLI. The sign-in lasts until the person ends it, or leaves it unused for 90 days.
6. `quelvio ask` prints Knowledge's answer as an agent receives it: the outcome, then the passages that answer, in the source's own words, each with its source, date and status. Nothing is reworded. `quelvio search` prints the passages that match.
7. A question reads what the signed-in person may read, checked at every call. Only that person sees it again, on Past answers.
8. `ask` and `search` each count as one run, as a question from an assistant does. `login`, `logout`, `check`, `setup` and `key` are free.
9. Exit codes: 0 answered; 1 a refused argument; 2 no key, a refused key, or signed out; 4 too many calls; 6 another agent's name; 7 no answer; 8 the plan; 9 an old client; 10 Quelvio is off for this key; 64 a wrong command.
10. It talks to `api.quelvio.com` and to the MCP server at `https://mcp.quelvio.com/http`, or to the address in `QUELVIO_URL` where that is set, and to the sign-in service that address names. It sends no usage data and looks for no updates.
11. It writes no question and no answer to the machine. A sign-in's tokens live in the keychain.
12. It has no command for memories: each person sees theirs in the Lab.

## Install

A Python package with no dependencies, from Python 3.8.

```sh
pipx install quelvio
```

An agent's "Set up" part in the Lab shows, after its key line:

```sh
quelvio setup claude-code --agent {agent}
```

For an agent without hooks the line is `quelvio setup mcp --agent {agent}`. No line names an address: the program holds `https://api.quelvio.com` for the HTTP routes and `https://mcp.quelvio.com/http` for the MCP server.

## What each command does

| Command | Arguments | Credential | Prints on stdout | Runs |
| --- | --- | --- | --- | --- |
| `setup claude-code` | `--agent`, `--user`, `--dry-run`, `--remove` | The key | The files written, then check's lines | 0 |
| `setup mcp` | `--agent` | The key | The MCP entry to add by hand, then check's lines | 0 |
| `check` | `--agent` | The key, and the sign-in where one is stored | Up to six lines | 0 |
| `key set` | `--agent` | The key | "Stored for {agent}." | 0 |
| `key remove` | `--agent` | None | "Removed from this machine. The key still works elsewhere." | 0 |
| `hook EVENT`, `mcp [--hooks]` | The hook event | The key | What the agent's runtime reads | 0 |
| `login` | None | None, then the sign-in | "Signed in as {name} in {organisation}." | 0 |
| `logout` | None | None | "Signed out here." | 0 |
| `ask "QUESTION"` | `--repo ID`, `--as-of DATE`; the question from stdin when none is given | The sign-in | The tool's text | 1 |
| `search "QUERY"` | `--repo`, `--as-of`, `--limit` | The sign-in | The tool's text | 1 |

The text is printed byte for byte, tags and escaping included. Nothing else goes to stdout: no colour, no footer. `--help` and `--version` print and exit 0.

## Errors and exit codes

| Case | On stderr | Tries again | Exit |
| --- | --- | --- | --- |
| An answer, whatever its outcome, "not found" included | Nothing |  | 0 |
| 413, 415, 422 | `quelvio:` and the body's error word, with its field | No | 1 |
| No key for the agent | `quelvio: no key for {agent}. Make one on Keys, then: quelvio key set` |  | 2 |
| Not signed in | `quelvio: not signed in. Run quelvio login.` |  | 2 |
| 401 on a key | `quelvio: the key was refused. It is unknown or was ended.` | No | 2 |
| 401 on the sign-in, or a renewal refused | `quelvio: signed out. Run quelvio login.` The tokens are deleted. | No | 2 |
| 429 | The server's sentence, or `quelvio: too many calls.` | Once, after 1 s | 4 |
| 403 | `quelvio: the key belongs to another agent than QUELVIO_AGENT names.` | No | 6 |
| No answer: DNS, TLS, a timeout, a redirect, an unreadable body | `quelvio: no answer from {address}.` | No | 7 |
| 500 | The sentence, or `quelvio: server.` | Once, after 2 s | 7 |
| 503 | `quelvio: unavailable.` | After 2 s, 4 s and 8 s | 7 |
| 402 | The server's own words, and over the sign-in "The person can still ask in the Lab." | No | 8 |
| 426 | `quelvio: upgrade. Install the newer client.` | No | 9 |
| Memory or Knowledge is off for this key | Nothing; the sentence goes to stdout |  | 10 |
| An unknown command or argument | One usage line |  | 64 |

## Related

- [Human view of this page](https://quelvio.com/docs/cli)
- [Everything for agents: llms.txt](https://quelvio.com/llms.txt)
