# Commands

> Everyday vantuly commands: deployments, logs, rollback, environment variables, domains.

Source: https://vantuly.com/docs/cli/commands

Commands that act on a site use `--site ID`, else the folder's linked site. Every command takes `--json`.

## Deployments, logs and rollback

```sh
vantuly deployments              # history: ID, status, trigger, time
vantuly logs                     # the latest build log (follows a running deploy)
vantuly logs DEPLOYMENT_ID       # a given deployment's log
vantuly rollback                 # put the release before the live one back
vantuly rollback DEPLOYMENT_ID   # put that deployment's release back
```

## Environment variables

You only ever see names; values are write-only. Deploy again to use them.

```sh
vantuly env                                       # names
vantuly env set API_URL=https://api.example.com KEY=secret
vantuly env unset KEY
```

## Domains

```sh
vantuly domains                  # each domain and whether DNS points at the server
vantuly domains add example.com
```

If the team [connected Cloudflare](/docs/domains/cloudflare), the DNS records are created for you. Otherwise the CLI prints the A (and AAAA) record to create. HTTPS is issued once DNS points at the server; run `vantuly domains` to check.

## Sites, servers and links

```sh
vantuly sites                   # ID, type, status, URL
vantuly sites --server web-1
vantuly servers                 # ID, name, status, IP
vantuly link --site ID          # link this folder to an existing site
vantuly open                    # open the site in the browser
vantuly open --panel            # open its page in the panel
vantuly help
```

## Exit codes

| Code | Meaning |
|---|---|
| `0` | ok |
| `1` | usage or API error |
| `2` | the deployment ran and failed |
| `3` | not signed in, or the token may not do this |
