# Command Line Interface

URL: /docs/cli

Source: https://github.com/easypanel-io/monorepo/blob/main/apps/website/content/docs/cli.mdx

Manage Easypanel servers, projects, and services from your terminal.



The Easypanel CLI lets you manage one or more Easypanel servers from a terminal.
It is available as both `easypanel` and the shorter `ep` command.

The available commands come from the connected server, so the CLI stays aligned
with that server's Easypanel version. Use `--help` at any level to see the
commands, arguments, and flags currently available to you.

## Install the CLI [#install-the-cli]

<Tabs items="[&#x22;macOS&#x22;, &#x22;Linux&#x22;, &#x22;Windows&#x22;]" groupId="cli-install">
  <Tab value="macOS">
    ```shell
    curl -fsSL https://get.easypanel.io/cli | sh
    ```
  </Tab>

  <Tab value="Linux">
    ```shell
    curl -fsSL https://get.easypanel.io/cli | sh
    ```
  </Tab>

  <Tab value="Windows">
    ```powershell
    irm https://get.easypanel.io/cli.ps1 | iex
    ```
  </Tab>
</Tabs>

Confirm the installation:

```shell
easypanel version
```

The installers select the correct AMD64 or ARM64 binary and verify its SHA-256
checksum. Set `EASYPANEL_CLI_VERSION` before running an installer when you need
a specific release.

## Connect an Easypanel server [#connect-an-easypanel-server]

The CLI authenticates with a user API key.

1. In Easypanel, open **Settings → Server → Users**.
2. Select **Generate API Key** for the user that will run CLI commands.
3. Select **Connect → CLI** to see a connection command for the current server.
4. Run the command and paste the API key when prompted:

```shell
easypanel server add production https://panel.example.com
```

`production` is a local profile name. You can choose another name containing
letters, numbers, dashes, or underscores. The new profile becomes the current
server and the API key is read without echoing it.

Persistent API keys are stored in macOS Keychain, Linux Secret Service, or
Windows Credential Manager. The CLI configuration and cached command manifest
do not contain the key.

<Callout type="warn">
  An API key acts as its Easypanel user and can modify or delete resources that
  user is allowed to manage. Keep it private and revoke it from **Settings →
  Server → Users** if it is exposed.
</Callout>

## Run commands [#run-commands]

Start by listing projects:

```shell
easypanel projects list
```

Inspect the available command tree or a specific command:

```shell
easypanel --help
easypanel projects --help
easypanel app inspect --help
```

Commands that operate on a project accept its name as a positional argument.
Service commands use `<project>/<service>`:

```shell
easypanel projects inspect my-project
easypanel app inspect my-project/web
```

In an interactive terminal, you can omit that argument and choose a project or
service from a list:

```shell
easypanel app inspect
```

Command and flag names are shown in dash-case. Camel-case aliases also work for
compatibility, but dash-case is preferred in scripts and documentation.

### Provide input [#provide-input]

Simple input fields are exposed as flags. Run the command with `--help` to see
which flags are required and their accepted values.

For larger inputs, pass JSON directly, read it from a file with `@`, or read it
from standard input:

```shell
easypanel projects update-env my-project --input '{"env":"NODE_ENV=production"}'
easypanel projects update-env my-project --input @project.json
easypanel projects update-env my-project --input - < project.json
```

Required string secrets are requested without echoing when possible. Sensitive
fields returned by Easypanel are redacted by default; use `--show-secrets` only
when you intentionally need their values.

### Destructive commands [#destructive-commands]

Commands that can delete, overwrite, restore, revoke, or otherwise disrupt a
resource ask for confirmation in an interactive terminal. In scripts and CI,
you must explicitly pass `--yes` or `-y`:

```shell
easypanel projects destroy old-project --yes
```

Review the selected server and exact resource before bypassing confirmation.

## Work with multiple servers [#work-with-multiple-servers]

Each server is stored as a local profile:

| Command                           | Purpose                                          |
| --------------------------------- | ------------------------------------------------ |
| `easypanel server list`           | List configured server profiles                  |
| `easypanel server current`        | Print the default profile                        |
| `easypanel server use <name>`     | Change the default profile                       |
| `easypanel server check [name]`   | Verify the server, API key, and command manifest |
| `easypanel server refresh [name]` | Reload commands from the server                  |
| `easypanel server set-key <name>` | Replace a profile's API key                      |
| `easypanel server remove <name>`  | Remove the local profile and stored key          |

Use `--server` or `-s` to run a single command against a profile without
changing the default:

```shell
easypanel --server staging projects list
```

You can also set `EASYPANEL_SERVER` for the current process.

## Use the CLI in scripts [#use-the-cli-in-scripts]

Pass `--format json` for machine-readable output and `--yes` for an intentionally
approved destructive operation:

```shell
easypanel projects list --format json
easypanel --server production app deploy my-project/web --format json
```

For CI, supply the API key through `EASYPANEL_API_KEY` instead of saving it in a
credential manager:

```shell
EASYPANEL_SERVER=production \
EASYPANEL_API_KEY="$CI_EASYPANEL_API_KEY" \
easypanel projects list --format json
```

Alternatively, pipe a secret into `server add` without displaying it:

```shell
printf '%s' "$EASYPANEL_API_KEY" | \
  easypanel server add production https://panel.example.com --api-key-stdin
```

The default request timeout is 30 seconds. Change it with `--timeout` or
`EASYPANEL_TIMEOUT`, using a Go duration such as `2m`.

## Enable shell completion [#enable-shell-completion]

Install dynamic completion for Bash, Zsh, Fish, or PowerShell:

```shell
easypanel completion install
```

Completion uses the current server's command manifest and suggests available
commands, flags, enum values, projects, and services. Start a new shell after
installing it.

## Update the CLI [#update-the-cli]

Update the CLI executable and verify the downloaded release checksum:

```shell
easypanel self-update
```

Check for an update without installing it:

```shell
easypanel self-update --check
```

Linux installations made from a `.deb`, `.rpm`, or `.apk` package should be
updated through the same package format. Set `EASYPANEL_NO_UPDATE_CHECK=1` to
disable the automatic daily update check.
