# Zefily CLI

> Install the zefily command on Linux, macOS or Windows, put it on your PATH, sign it in with an API token and deploy from your terminal.

`zefily` is a single program with no dependencies. It lists your servers, sites and jobs, deploys and rolls back sites, and runs the [MCP server](/docs/mcp) that lets AI agents work with Zefily. It talks to the [REST API](/docs/api-and-cli) with an API token.

## 1. Download it

Pick the file for your computer. The [download page](https://dl.zefily.com/cli/index.html) lists the same files with their checksums.

| System | File |
| --- | --- |
| Linux, Intel/AMD (most PCs and servers) | [zefily-linux-amd64](https://dl.zefily.com/cli/zefily-linux-amd64) |
| Linux, ARM (Raspberry Pi 4/5, ARM servers) | [zefily-linux-arm64](https://dl.zefily.com/cli/zefily-linux-arm64) |
| macOS, Apple silicon (M1 and newer) | [zefily-darwin-arm64](https://dl.zefily.com/cli/zefily-darwin-arm64) |
| macOS, Intel | [zefily-darwin-amd64](https://dl.zefily.com/cli/zefily-darwin-amd64) |
| Windows 10 and 11 | [zefily-windows-amd64.exe](https://dl.zefily.com/cli/zefily-windows-amd64.exe) |

Not sure which one? On macOS, Apple menu → **About This Mac** says *Chip Apple M…* (Apple silicon) or *Processor Intel…*. On Linux, `uname -m` prints `x86_64` (amd64) or `aarch64` (arm64).

## 2. Put it on your PATH

The PATH is the list of folders your terminal searches for commands. Once `zefily` is in one of them, you can type `zefily` in any folder, and AI apps can start it as well.

### Linux and macOS

The commands below download the file, check it against the published checksum, make it executable and move it to `~/.local/bin`, a folder for your own programs that needs no administrator rights. Replace `zefily-linux-amd64` with your file from the table:

```bash
cd /tmp
curl -fsSLO https://dl.zefily.com/cli/zefily-linux-amd64
curl -fsSL https://dl.zefily.com/cli/SHA256SUMS | grep ' zefily-linux-amd64$' | sha256sum -c -
chmod +x zefily-linux-amd64
mkdir -p ~/.local/bin
mv zefily-linux-amd64 ~/.local/bin/zefily
```

On macOS, use `shasum -a 256 -c -` instead of `sha256sum -c -`. The check must print `OK`.

Many Linux systems already have `~/.local/bin` on the PATH. Check it with `zefily version` in a **new** terminal window. If the answer is *command not found*, add the folder to your shell's startup file once, then open a new terminal:

```bash
# bash (most Linux systems)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc

# zsh (macOS, and Linux if you use zsh)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
```

Prefer a folder every user of the computer can reach? Use `sudo mv zefily-linux-amd64 /usr/local/bin/zefily` instead; `/usr/local/bin` is on the PATH everywhere.

On macOS, a file downloaded **in a browser** is quarantined and macOS refuses to open it ("cannot be opened because the developer cannot be verified"). Files downloaded with `curl` as above are not affected. If you used a browser, remove the quarantine once: `xattr -d com.apple.quarantine ~/.local/bin/zefily`.

### Windows

In **PowerShell** (no administrator rights needed), this creates the folder `%LOCALAPPDATA%\Programs\zefily`, downloads the program into it as `zefily.exe` and adds the folder to your user PATH:

```powershell
$dir = "$env:LOCALAPPDATA\Programs\zefily"
New-Item -ItemType Directory -Force -Path $dir | Out-Null
Invoke-WebRequest https://dl.zefily.com/cli/zefily-windows-amd64.exe -OutFile "$dir\zefily.exe"
(Get-FileHash "$dir\zefily.exe" -Algorithm SHA256).Hash.ToLower()
$path = [Environment]::GetEnvironmentVariable('Path', 'User')
if ($path -notlike "*$dir*") { [Environment]::SetEnvironmentVariable('Path', "$path;$dir", 'User') }
```

The fourth line prints the file's checksum: compare it with the `zefily-windows-amd64.exe` line of [SHA256SUMS](https://dl.zefily.com/cli/SHA256SUMS). Then close PowerShell, open a new window and run `zefily version`.

Without PowerShell: download the file, rename it to `zefily.exe` and put it in a folder such as `C:\Users\<you>\AppData\Local\Programs\zefily`. Open **Settings → System → About → Advanced system settings → Environment Variables**, select **Path** under *User variables*, **Edit → New**, paste the folder and confirm with **OK**. If Windows SmartScreen warns about the download, choose **More info → Run anyway** after checking the checksum.

## 3. Give it an API token

Create a token under **Settings → API tokens** (see [API tokens](/docs/api-and-cli)). For deploying from your terminal, pick `servers:read`, `sites:read`, `sites:deploy` and `jobs:read`. The CLI reads the token from the `ZEFILY_TOKEN` environment variable.

For the current terminal window only:

```bash
export ZEFILY_TOKEN=zf_…          # Linux and macOS
```

```powershell
$env:ZEFILY_TOKEN = "zf_…"        # Windows PowerShell
```

To keep it for every new window, add the `export` line to `~/.bashrc` or `~/.zshrc`, or on Windows run `[Environment]::SetEnvironmentVariable('ZEFILY_TOKEN', 'zf_…', 'User')`. Anyone who can read those files or your user environment can use the token: give it only the scopes you need and an expiry, and revoke it in the panel when you stop using it.

Check that everything works:

```bash
zefily servers
```

## Commands

| Command | Does |
| --- | --- |
| `zefily servers` | Lists your servers with their state |
| `zefily sites [server]` | Lists sites, of every server or of one (name or id) |
| `zefily deploy <site> [--wait]` | Deploys a site (domain or id) |
| `zefily rollback <site> [--release YYYYMMDDhhmmss] [--wait]` | Switches a site back to its previous release, or to the given one |
| `zefily job <id> [--wait]` | Shows a job with its log |
| `zefily jobs <server> [--type site.deploy]` | Lists a server's recent jobs |
| `zefily mcp` | Runs the MCP server for AI agents (see [AI agents (MCP)](/docs/mcp)) |
| `zefily version` | Prints the version |

`--wait` follows the job until it ends and exits with status 1 when it does not succeed, so a script or CI pipeline stops when a deploy fails. For CI pipelines see [Deploy from CI](/docs/api-and-cli#deploy-from-ci).

`ZEFILY_API` changes the API address (default `https://app.zefily.com/api/v1`); you do not need it with Zefily's own panel.

## Updating

Download the file again and replace the old one, the same way you installed it. `zefily version` shows which build you have; the [download page](https://dl.zefily.com/cli/index.html) shows the newest.

---
Source: https://zefily.com/docs/cli
