---
title: "Command Line"
description: "Install and configure vcomp-crt-api-cli, and reference for every command it offers."
source: "Verifiable Compute"
---
`vcomp_cli_lite` provides two commands:

- `vcomp-cert-cli` creates the CA and operator certificates. See
  [Operator Certificates (mTLS)](./deployment/operator-certificates.mdx).
- `vcomp-crt-api-cli` drives a running CRT: it starts and stops jobs, reports their status,
  imports images and manages registry credentials.

## Install

1. Install Python 3 and `pip`:

   ```sh
   sudo apt update
   sudo apt install python3 python3-pip python3.12-venv
   ```

   Optionally, create and activate a virtual environment:

   ```sh
   python3 -m venv vcomp-env
   source vcomp-env/bin/activate
   ```

2. Install `vcomp_cli_lite`:

   ```sh
   wget http://node2.e-mesh.net/vcomp_cli_lite-0.0.4-py3-none-any.whl
   pip3 install vcomp_cli_lite-0.0.4-py3-none-any.whl
   ```

## Configure the connection

`vcomp-crt-api-cli` reads its connection settings from a `.env` file in the current directory.
Enter your CRT's public IP address to fill it in below:

<token-field name="VM_IP" label="CRT public IP address" placeholder="172.173.137.249"
  pattern='^(\d{1,3}\.){3}\d{1,3}$' pattern-message="Must be an IPv4 address"></token-field>

```sh
HOSTNAME="https://{{VM_IP}}:447"
CLIENT_CERT="./operator1.crt"
CLIENT_KEY="./operator1.key"
```

| Variable      | Meaning                                                      |
| ------------- | ------------------------------------------------------------ |
| `HOSTNAME`    | The CRT API address. The API listens on port 447.            |
| `CLIENT_CERT` | Your operator certificate, from [Operator Certificates (mTLS)](./deployment/operator-certificates.mdx). |
| `CLIENT_KEY`  | The private key for that certificate.                        |

Two global options override the file: `--env-file <path>` reads a different `.env` file, and
`--url <address>` overrides `HOSTNAME`. Both go before the command, for example
`vcomp-crt-api-cli --env-file crt2.env status ps`.

When the client certificate is loaded, every command first prints
`Client authentication certificate`.

<Alert variant="warning" title="The server certificate is not verified">
  The CRT presents a self-signed TLS certificate, and `vcomp-crt-api-cli` does not verify it. Make
  sure `HOSTNAME` points at the CRT you deployed.
</Alert>

## Commands

### Jobs

| Command                                 | What it does |
| --------------------------------------- | ------------ |
| `start <compose-file>`                  | Starts a job from a Docker Compose file and prints its `project_id`. Returns once images are pulled and containers started, which can take minutes for a large image. The job stops automatically when its containers exit. |
| `start --no-autostop <compose-file>`    | Starts a job that keeps running until you stop it. Use this for long-running services such as an API. |
| `stop`                                  | Stops the running job. Outputs and proofs stay available under its `project_id`. |
| `status ps`                             | Lists the job's containers, like `docker compose ps`. An empty table means nothing is running. |
| `status log`                            | Prints the job's container logs. |
| `status docker_compose`                 | Prints the compose file the runtime is running, including the folders and settings it injects. Secret values are shown. |
| `cid-compose-file <compose-file>`       | Prints the content identifier (CID) of a compose file, computed locally, so you can match it against a manifest. |

The CRT runs one job at a time. Stop the current job before starting the next.

### Images

| Command                       | What it does |
| ----------------------------- | ------------ |
| `images`                      | Lists the images loaded in the runtime. |
| `import <tarfile.tar>`        | Uploads a `docker save` tarball and loads it into the runtime. Uploads in 25 MB chunks with a progress bar. |
| `prune`                       | Deletes every image that no job is using. This cannot be undone. |

To upload a local image, export it first, then import it:

```sh
docker save -o test-docker-1.tar test-docker-1:latest
vcomp-crt-api-cli import test-docker-1.tar
```

After the upload finishes, the runtime still has to extract the image. For a large image the
progress can appear to stall at the end; wait for the command to return.

### Access

| Command                                                  | What it does |
| -------------------------------------------------------- | ------------ |
| `login <registry> <username> <password>`                 | Stores credentials for a private container registry, such as `ghcr.io`. They are not checked when stored, and are lost when the machine reboots. |
| `login-azure-keyvault <keyvault-name> <secret-name>`     | Stores registry credentials read from a secret in Azure Key Vault. |
| `filebrowser-password`                                   | Prints the password for the file browser on port 446. The username is `admin`. The password changes every time the runtime restarts. |
| `ssl <domain>`                                           | Requests a Let's Encrypt certificate for `<domain>`. The domain must already point at the CRT and be reachable on port 80, and a job must be running. |

For example, to pull private images from GitHub's `ghcr.io` as user `bobbyjoe` with a GitHub
token:

```sh
vcomp-crt-api-cli login ghcr.io bobbyjoe ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

Images from that registry can then be named in a compose file, as they can locally after
`docker login`.

## Files and results

Every container gets three folders: `/input` (shared by every job), `/output` and `/proof` (both
unique to each job). The command line has no download command; fetch results with the file browser
or the [web console](./web-console.mdx#files), or call the API directly with `curl` and your
operator certificate:

<token-field name="PROJECT_ID" label="Project ID" placeholder="5d29a963-97be-428e-b89b-fb82694c09e6"></token-field>

```sh
# List a job's output or proof files
curl -k --cert operator1.crt --key operator1.key \
  https://{{VM_IP}}:447/files/{{PROJECT_ID}}/output

# Download the signed manifest
curl -k --cert operator1.crt --key operator1.key \
  -X POST -o eqty_manifest.json \
  https://{{VM_IP}}:447/manifest
```

To upload a file to `/input` before starting a job:

```sh
curl -k --cert operator1.crt --key operator1.key \
  -F "file=@sample.wav" \
  https://{{VM_IP}}:447/files/input
```

## File browser

If the CRT was deployed with **Enable file browser**, a file browser runs on port 446. It is
handier than `curl` for moving many files or looking around.

1. Get the password. The username is always `admin`:

   ```sh
   vcomp-crt-api-cli filebrowser-password
   ```

2. Open the file browser and log in:

   ```text
   https://{{VM_IP}}:446
   ```

| Folder                         | Contents                                      |
| ------------------------------ | --------------------------------------------- |
| `input`                        | Files every job sees in `/input`              |
| `instance/<project_id>/output` | What that job wrote to `/output`              |
| `instance/<project_id>/proof`  | Its proof records: the sanitized compose file, attestation report and timestamp |

## Troubleshooting

### "Already running a project"

```json
{"msg":"Already running a project","project_id":"57be55c0-6d74-4de4-a645-36d5bb4c76cf","status":"error"}
```

A previous job is still running or did not shut down cleanly. Run `vcomp-crt-api-cli stop`
twice: the first run may return an error, and the second forces any remaining cleanup.

```sh
vcomp-crt-api-cli stop
vcomp-crt-api-cli stop
```