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

# Command line

> Use ic to launch, connect to, park and delete GPU servers from your terminal.

`ic` is the Infinite Compute command line. It uses the [API](https://docs.infinitecompute.ai/api/overview.md), with the same rules as the console.

## Install and sign in

`ic` needs Python 3.10 or later. Install it with [pipx](https://pipx.pypa.io):

```bash theme={null}
pipx install infinitecompute
```

Sign in with an [API key](https://docs.infinitecompute.ai/api/keys.md). `ic` checks it and stores it in your operating system's keychain:

```bash theme={null}
ic login --api-url https://<your-console-address>/api/public/v1
ic whoami
```

Set `INFINITECOMPUTE_API_URL` to your console address followed by `/api/public/v1` so you don't need `--api-url` each time. Your console address is in your welcome email. In CI, set `INFINITECOMPUTE_API_KEY` instead of running `ic login`; it takes precedence over the stored key. `ic logout` removes the stored key.

## Launch a server and connect

```bash theme={null}
ic server-types                     # what your project can launch
ic images --gpu <gpu model>         # images built for that GPU
ic ssh-keys add laptop ~/.ssh/id_ed25519.pub
ic servers create llm-finetune-01 --type <server type> --image <image> --ssh-key laptop --wait
ic ssh llm-finetune-01
```

`ic ssh` turns on SSH access for the server if it's off, then runs `ssh` for you. Anything after the server name goes to `ssh`, for example a port forward for Jupyter:

```bash theme={null}
ic ssh llm-finetune-01 -L 8888:localhost:8888
```

Use `-i ~/.ssh/<key>` if your key isn't the default one. `ic ssh llm-finetune-01 --close` turns SSH access off again.

## Commands

| Command | What it does |
| - | - |
| `ic whoami` | The project, person and key you're using. |
| `ic server-types` | Server types your project can launch, with their GPU and site. |
| `ic images [--gpu MODEL]` | Images, optionally only those built for a GPU model. |
| `ic ssh-keys list` / `add NAME FILE.pub` / `delete NAME` | Your SSH keys. Only ever give the `.pub` file. |
| `ic servers list` / `show SERVER` | Your project's servers. |
| `ic servers create NAME --type --image --ssh-key [--disk-gb] [--user-data FILE] [--keep-disk] [--wait]` | Launch a server. |
| `ic servers start` / `stop` / `reboot [--hard]` / `park` / `resume SERVER [--wait]` | Act on a server. |
| `ic servers delete SERVER [-y]` | Delete a server. Asks first unless you pass `-y`. |
| `ic ssh SERVER [ssh args]` | Connect, turning on SSH access if needed. |
| `ic volumes list` / `create NAME --size-gb --site` / `delete ID` | Volumes. |
| `ic volumes attach ID SERVER` / `detach ID` | Attach a volume to a server at the same site, or detach it. |
| `ic backups list VOLUME_ID` / `restore BACKUP_ID [--name]` | A volume's backups; restore one into a new volume. |
| `ic usage [--month YYYY-MM]` | GPU-hours per server, and charges, for a month. |

You can name a server or give its id. `ic --help` and `ic <command> --help` show every option.

## Scripting

Every command takes `--json` and prints JSON instead of a table:

```bash theme={null}
ic --json servers list | jq -r '.[] | select(.status == "parked") | .name'
```

Errors go to stderr with the API's message and request id, and `ic` exits with status 1. `ic servers create` sends an `Idempotency-Key`, so retrying a failed create in a script never launches two servers; pass `--idempotency-key` to choose it yourself.

## Park instead of stop

A stopped server keeps its GPU, so it stays billed. Park a server you won't use for a while: the GPU is released and GPU billing stops, and your disk is kept.

```bash theme={null}
ic servers park llm-finetune-01 --wait
ic servers resume llm-finetune-01 --wait
```

See [Park, stop or delete](https://docs.infinitecompute.ai/guides/park-stop-delete.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.