Source: https://datafa.st/docs/cli-websites
Markdown source: https://datafa.st/docs/cli-websites.md
Description: Create, update, delete, manage KPIs, API keys, and team members for your websites using the DataFast CLI.

# CLI — Websites

Manage your DataFast websites from the terminal. Requires a `dft_` admin token.

You can use either `websites` or the singular alias `website`:

```sh
datafast websites
datafast websites list
datafast website list
```

Run `datafast websites` without a subcommand to choose a website command interactively.

## List all websites

```sh
datafast websites list
```

## Get a single website

```sh
datafast websites get <websiteId>
```

## Create a website

Run it without flags for an interactive prompt (domain, name, timezone picker):

```sh
datafast websites create
```

Or pass flags to skip the prompts:

```sh
datafast websites create --domain example.com --timezone America/New_York
datafast websites create --domain example.com --timezone Europe/Paris --name "My Blog"
```

## Update a website

Run without update flags for a guided editor. Choose one field, edit it, and the CLI saves it immediately. You can then choose whether to update another field:

```sh
datafast websites update
```

Or pass flags for non-interactive updates:

```sh
datafast websites update <websiteId> --name "New Name"
datafast websites update <websiteId> --domain new-domain.com
datafast websites update <websiteId> --timezone Europe/London
datafast websites update <websiteId> --kpi "signup"
datafast websites update <websiteId> --kpi-color-scheme blue
datafast websites update <websiteId> --cookieless true
datafast websites update <websiteId> --include-renewal-revenue false
datafast websites update <websiteId> --excluded-ips "1.2.3.4,5.6.7.8"
```

You can update one or many fields in one command.

`--include-renewal-revenue` only controls KPI calculations such as revenue per visitor. Raw revenue metrics still include new and renewal revenue.

## KPI setup (interactive)

Set your `#1 KPI` using a guided flow that mirrors the dashboard:

```sh
datafast websites kpi
```

The command guides you through:
- KPI type: `Revenue` or `Goal`
- Revenue metric: `revenue` or `mrr`
- Goal selection from tracked goals
- Optional KPI color scheme update

Every interactive picker includes a `Cancel` option. You can also press `Ctrl+C` to exit.

You can also run it non-interactively:

```sh
datafast websites kpi <websiteId> --type revenue --revenue-metric mrr
datafast websites kpi <websiteId> --type goal --goal "signup" --color-scheme green
```

## Website API keys (`df_`)

Manage website keys directly from CLI:

```sh
# Interactive session (list, create, roll, delete in a loop)
datafast websites apikeys

# Or one-off subcommands
datafast websites apikeys list <websiteId>
datafast websites apikeys create <websiteId> --name "Prod key"
datafast websites apikeys roll <websiteId> <apiKeyId>
datafast websites apikeys delete <websiteId> <apiKeyId>
```

When you create/roll keys, the raw `df_` key is copied to your clipboard automatically.

## Delete a website

```sh
datafast websites delete <websiteId>

# Skip the confirmation prompt
datafast websites delete <websiteId> --yes
```

## Team management

```sh
# List team members
datafast websites team list <websiteId>

# Invite a member by email
datafast websites team invite <websiteId> --email user@example.com

# Remove a member
datafast websites team remove <websiteId> <userId>
datafast websites team remove <websiteId> <userId> --yes
```
