# Quickstart

> Install the zidane library, add credentials and run a task.

This page sets up the library. For the apps, install the [terminal app](https://zidane.si/docs/tui.md) or the [desktop app](https://zidane.si/docs/desktop.md). On first launch, each app opens a setup wizard that connects a model provider.

```bash
curl -fsSL https://zidane.si/install | sh       # the terminal app, in ~/.local/bin
brew install tahul/tap/zidane                   # the terminal app, with Homebrew
brew install --cask tahul/tap/zidane            # the desktop app, with Homebrew
```

Every build for macOS and Linux is on the [download page](https://zidane.si/download), with its checksum. [Verify a download](https://zidane.si/docs/verify.md) shows how to check one.

## 1. Install

The library runs on Bun and on Node 20 or later.

**bun**

```bash
bun add zidane
```

**npm**

```bash
npm install zidane
```

**pnpm**

```bash
pnpm add zidane
```

## 2. Add credentials

Pass an API key to the provider:

```ts
anthropic({ apiKey: process.env.ANTHROPIC_API_KEY })
```

To sign in with a subscription, or to find a provider's environment variable, see [providers](https://zidane.si/docs/providers.md).

## 3. Run a task

```ts title="agent.ts"
import { createAgent } from 'zidane'
import { basic } from 'zidane/presets'
import { anthropic } from 'zidane/providers'

const agent = createAgent({
  ...basic,
  provider: anthropic({ apiKey: process.env.ANTHROPIC_API_KEY }),
})

const stats = await agent.run({ prompt: 'create a hello world app' })
console.log(stats.turns)
```

`run()` resolves with the run's stats once the model stops calling tools.

## Next

- [Core concepts](https://zidane.si/docs/concepts.md): how a run works.
- [Agents](https://zidane.si/docs/agents.md): presets, thinking, run control.
- [Providers](https://zidane.si/docs/providers.md): models, sign-in, fallbacks.
- [Hooks](https://zidane.si/docs/hooks.md): change each step of a run.

## Reference

- [`zidane/agent`](https://zidane.si/docs/reference/agent.md)
- [`zidane/providers/anthropic`](https://zidane.si/docs/reference/providers-anthropic.md)
- [`zidane/presets`](https://zidane.si/docs/reference/presets.md)
