# reveata config and completion

> Save a default website, see where the CLI reads its settings from, and turn on shell completion for bash, zsh and fish.

## Default website

`reveata config set-site example.com` saves a default website, so you can leave out `--site`. The CLI checks first that your token can reach it. `--site` and `REVEATA_SITE` still win over the saved default, and `reveata config clear-site` removes it. `reveata config show` prints the config file, the API URL, the token (masked) and the default website, each with where it came from.

## Shell completion

`reveata completion <bash|zsh|fish>` prints a script that completes commands, subcommands and each command's options:

```bash
# bash: add to ~/.bashrc
source <(reveata completion bash)

# zsh: add to ~/.zshrc
source <(reveata completion zsh)

# fish
reveata completion fish > ~/.config/fish/completions/reveata.fish
```

### `reveata config show`

Show the config file, the API URL, the token (masked) and the default website.

Also says where each value comes from: a flag, the environment or the config file.

No options beyond the global ones.

```bash
reveata config show
reveata config show --json
```

### `reveata config set-site <id|domain>`

Save a default website for commands run without --site.

Checks that the saved token can reach the website first. --site and REVEATA_SITE still win over the saved default.

No options beyond the global ones.

Calls [`GET /api/v1/websites/{website}`](https://reveata.com/api-reference/get-website) (`analytics:read`).

```bash
reveata config set-site example.com
```

### `reveata config clear-site`

Forget the default website.

No options beyond the global ones.

```bash
reveata config clear-site
```

### `reveata completion <bash|zsh|fish>`

Print a shell completion script for bash, zsh or fish.

bash: add `source <(reveata completion bash)` to ~/.bashrc. zsh: add `source <(reveata completion zsh)` to ~/.zshrc. fish: run `reveata completion fish > ~/.config/fish/completions/reveata.fish`.

No options beyond the global ones.

```bash
source <(reveata completion bash)
reveata completion fish > ~/.config/fish/completions/reveata.fish
```
