# Quickstart

> Install clai, configure your first model vendor, run terminal queries, and manage chats.

Canonical URL: https://www.clai.chat/docs/v0.1/quickstart/ · Version: 0.1 · Updated: 2026-10-21

Full site index: https://www.clai.chat/llms.txt

Get `clai` running in your terminal in under two minutes.

## 1. Install clai

Install the latest binary with Go (or see [Installation](/docs/v0.1/installation/) for Nix and source builds):

```sh
go install github.com/baalimago/clai@latest
```

## 2. Export a vendor API key

Set the API key for your preferred model provider (for example `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `GEMINI_API_KEY`):

```sh
export ANTHROPIC_API_KEY="sk-ant-..."
```

Run `clai setup` to select your default chat model, or pass `-cm` on any command.

## 3. Run your first query

Ask a question directly from the command line with `clai q`:

```sh
clai q "Write a jq filter that extracts all failing test names"
```

Pipe `stdin` and use `-i` to replace `{}` with the piped input:

```sh
git diff | clai -i q "Summarize this diff in three bullet points: {}"
```

## 4. Enable tools and continue conversations

Pass `-t` to let the model use builtin tools (`bash`, `rg`, `file_tree`, `web_search`) and configured MCP servers:

```sh
clai -t q "Check why the latest git commit changed internal/cli/cli.go"
```

Use `-r` to include the previous reply as context, or `-c` to continue the most recent conversation thread:

```sh
clai -c q "Now write a table-driven unit test for that case"
```

## Where to go next

- [Queries and unix pipes](/docs/guides/queries-and-pipes/)
- [Chats and multi-vendor import](/docs/guides/chats-and-vendors/)
- [Profiles and setup](/docs/guides/profiles/)
- [MCP servers and builtin tools](/docs/guides/mcp-and-tools/)
