Source: https://datafa.st/docs/cli-config
Markdown source: https://datafa.st/docs/cli-config.md
Description: View and manage CLI configuration including the default website and token using the DataFast CLI.

# CLI — Config

View and manage the local CLI config stored at `~/.config/datafast/config.json`.

## Show current config

Displays the active token, site key, API base URL, default website, and where the config file lives:

```sh
datafast config show
```

## Set a default website

Save a website ID so you don't have to pass `--website` on every analytics command:

```sh
datafast config set-website <websiteId>
```

## Remove the default website

```sh
datafast config clear-website
```

## whoami

Quick shorthand to print your account details:

```sh
datafast whoami
```

## Config via environment variables

Environment variables always take priority over the config file:

| Variable | Description |
|---|---|
| `DATAFAST_TOKEN` | Admin token (`dft_` prefix) |
| `DATAFAST_SITE_KEY` | Analytics-only site key (`df_` prefix) |
| `DATAFAST_API_BASE` | API base URL (default: `https://datafa.st`) |

```sh
# Run a single command against a local dev server
DATAFAST_API_BASE=http://localhost:3000 DATAFAST_TOKEN=dft_xxx datafast whoami
```
