> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install and configure the 0 Finance CLI

## Install with curl

```bash theme={null}
curl -fsSL https://zerofinance.ai/install | bash
```

<Info>This installs Bun if needed, then installs `agent-bank` globally.</Info>

## Install with Bun

```bash theme={null}
bun add -g agent-bank
```

Verify the installation:

```bash theme={null}
zero --version
```

<Tip>The CLI binary is `zero` (alias: `zero-bank`).</Tip>

***

## Run from the repo

The CLI lives in `packages/cli` and can be run directly from source:

```bash theme={null}
bun install
bun --cwd packages/cli run dev -- auth connect --no-browser
```

<Tip>Use `zero --debug auth whoami` to print the resolved base URL.</Tip>

***

## Authenticate

### Step 1: Get your API key

1. Log in to [0.finance](https://www.0.finance)
2. Go to **Settings → API Keys**
3. Click **Create API Key**
4. Copy the key (it starts with `sk_live_` or `sk_test_`)

<Warning>
  Store your API key securely. It provides full access to your workspace.
</Warning>

### Step 2: Connect the CLI

**Option A: Browser connect (recommended)**

```bash theme={null}
zero auth connect
```

This opens a secure connection page on [www.0.finance](http://www.0.finance) and stores the API key for you. If the automatic handoff fails, the page shows a copyable key for manual paste.

**Option B: API key**

```bash theme={null}
zero auth login --api-key sk_live_your_api_key_here
```

This stores your credentials in `~/.zero-finance/config.json`.

### Step 3: Verify

```bash theme={null}
zero auth whoami
```

```json theme={null}
{
  "workspace_id": "ws_xxx",
  "workspace_name": "My Company",
  "key_id": "key_xxx",
  "key_name": "Production Key",
  "align_customer_id": "align_xxx"
}
```

***

## Configuration

The CLI stores configuration in `~/.zero-finance/config.json`:

```json theme={null}
{
  "apiKey": "sk_live_xxx",
  "baseUrl": "https://www.0.finance"
}
```

### Custom base URL

For self-hosted deployments or local development:

```bash theme={null}
zero auth login --api-key sk_test_xxx --base-url http://localhost:3050
```

<Tip>
  The base URL should be the root (e.g. `https://www.0.finance`), not
  `.../api/cli`. The CLI will normalize if you include `/api/cli`.
</Tip>

***

## Log out

Remove stored credentials:

```bash theme={null}
zero auth logout
```

***

## Next steps

<CardGroup cols={3}>
  <Card title="CLI Reference" icon="book" href="/cli/reference">
    Complete command reference with examples.
  </Card>

  <Card title="Check balance" icon="wallet" href="/cli/reference#balance">
    Your first CLI command.
  </Card>

  <Card title="CLI QA" icon="check-circle" href="/cli/testing">
    Functionality coverage and smoke-test results.
  </Card>
</CardGroup>
