> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aieev.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use aircloud CLI

> Install and use the aircloud CLI for container operations

The `aircloud` CLI lets you inspect endpoints, open container shells, connect over SSH, and manage local CLI configuration.

## Install the CLI

```bash theme={null}
pip install aircloud-cli
```

## Verify installation

```bash theme={null}
aircloud --help
```

Expected commands include:

* `config`
* `endpoints`
* `exec`
* `ssh`
* `whoami`

## Configure the CLI

### Common commands

```bash theme={null}
aircloud config set <key> <value>
aircloud config get <key>
aircloud config list
aircloud config --help
```

### Initial setup

```bash theme={null}
aircloud config set api-base-url https://external.aieev.cloud:5000
aircloud config set api-key sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
aircloud config list
```

<Note>
  The CLI stores configuration in `~/.aircloud/config.json`.
</Note>

## Check authentication context

```bash theme={null}
aircloud whoami
```

Example output:

```json theme={null}
{
  "organization_id": "org-xxxxxxxxx",
  "project_id": "proj-yyyyyyyy",
  "api_key_id": "123456fs-4fb4-455a-b951-612df2acaafc",
  "user_id": "abc123da-85c3-4a46-asbb-4egfgc4df187",
  "authenticated_via": "api_key"
}
```

## Inspect and manage endpoints

### Available commands

```bash theme={null}
aircloud endpoints list
aircloud endpoints get
aircloud endpoints start
aircloud endpoints stop
aircloud endpoints scale
aircloud endpoints patch
aircloud endpoints replicas
aircloud endpoints logs
```

### List endpoints

```bash theme={null}
aircloud endpoints list
aircloud endpoints list --search jupyter --active
aircloud endpoints list --page 2 --size 20
```

### Get endpoint details

```bash theme={null}
aircloud endpoints get <endpoint_id>
```

### Start, stop, and scale

```bash theme={null}
aircloud endpoints stop <endpoint_id>
aircloud endpoints start <endpoint_id>
aircloud endpoints scale <endpoint_id> --replicas 3
```

### Patch a stopped endpoint

```bash theme={null}
aircloud endpoints patch <endpoint_id> --command "python main.py --port 8080"
aircloud endpoints patch <endpoint_id> --port 8080
aircloud endpoints patch <endpoint_id> --health-check-path /healthz --health-check-timeout 30
aircloud endpoints patch <endpoint_id> --env MODEL_NAME=llama3 --env CUDA_VISIBLE_DEVICES=0
```

<Note>
  Patching is supported only when the endpoint is stopped.
</Note>

### Check replicas

```bash theme={null}
aircloud endpoints replicas <endpoint_id>
```

### View logs

```bash theme={null}
aircloud endpoints logs <endpoint_id>
aircloud endpoints logs <endpoint_id> --replica-id <replica_id>
aircloud endpoints logs <endpoint_id> --start-line 1 --end-line 500
aircloud endpoints logs <endpoint_id> --list-files
```

## Open a shell with `aircloud exec`

`aircloud exec` opens an interactive shell inside a running container without requiring `sshd`.

### Open a shell

```bash theme={null}
aircloud exec <endpoint_id>
```

### Pin to a replica

```bash theme={null}
aircloud exec <endpoint_id> -r <replica_id>
```

### Use a different shell

```bash theme={null}
aircloud exec <endpoint_id> -c "/bin/sh"
```

### End the session

Type `exit` or press `Ctrl + D`.

## Use `aircloud ssh`

For SSH-based access workflows, use `aircloud ssh`.

Read [Connect with SSH](/docs/air-container/connect-with-ssh) for image preparation, SSH key registration, and examples.
