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

# cudoctl

> Configure cudoctl, the CUDO Compute command line interface

export const CliToolTable = () => {
  const getOsImageIcon = id => {
    const index = id.search('-');
    const brand = index > 0 ? id.substring(0, index) : id;
    if (brand !== 'cudo') {
      switch (brand) {
        case 'macos':
          return '/docs/images/os/macos.svg';
        case 'debian':
          return '/docs/images/os/debian.svg';
        case 'redhat':
          return '/docs/images/os/redhat.svg';
        case 'linux':
          return '/docs/images/os/linux.svg';
        case 'windows':
          return '/docs/images/os/windows.svg';
      }
    } else {
      switch (id) {
        case 'cudo-ubuntu2004-docker':
          return '/docs/images/os/docker.png';
        case 'cudo-ubuntu2004-blender':
          return '/docs/images/os/blender.png';
        case 'cudo-tensorflow-docker-gpu':
          return '/docs/images/os/tensorflow.svg';
        case 'cudo-ubuntu-nvidia':
          return '/docs/images/os/nvidia.svg';
        case 'cudo-ubuntu-focal':
          return '/docs/images/os/ubuntu.svg';
        default:
          return '/logo-mark-black.svg';
      }
    }
  };
  const cliBinaries = [{
    id: 'macos-amd64',
    name: 'macOS - amd64',
    platform: 'darwin',
    url: 'https://download.cudocompute.com/cli/cudoctl_darwin_amd64'
  }, {
    id: 'macos-arm64',
    name: 'macOS - arm64',
    platform: 'darwin',
    url: 'https://download.cudocompute.com/cli/cudoctl_darwin_arm64'
  }, {
    id: 'macos-universal',
    name: 'macOS - Universal',
    platform: 'darwin',
    url: 'https://download.cudocompute.com/cli/cudoctl_darwin_all'
  }, {
    id: 'debian-amd64',
    name: 'Debian - amd64',
    platform: 'debian',
    url: 'https://download.cudocompute.com/cli/cudoctl-amd64.deb'
  }, {
    id: 'debian-arm64',
    name: 'Debian - arm64',
    platform: 'debian',
    url: 'https://download.cudocompute.com/cli/cudoctl-arm64.deb'
  }, {
    id: 'redhat-amd64',
    name: 'RedHat (RPM) - amd64',
    platform: 'redhat',
    url: 'https://download.cudocompute.com/cli/cudoctl-amd64.rpm'
  }, {
    id: 'redhat-arm64',
    name: 'RedHat (RPM) - arm64',
    platform: 'redhat',
    url: 'https://download.cudocompute.com/cli/cudoctl-arm64.rpm'
  }, {
    id: 'linux-amd64',
    name: 'Other Linux - amd64',
    platform: 'linux',
    url: 'https://download.cudocompute.com/cli/cudoctl_linux_amd64.tar.gz'
  }, {
    id: 'linux-arm64',
    name: 'Other Linux - arm64',
    platform: 'linux',
    url: 'https://download.cudocompute.com/cli/cudoctl_linux_arm64.tar.gz'
  }, {
    id: 'windows-amd64',
    name: 'Windows',
    platform: 'windows',
    url: 'https://download.cudocompute.com/cli/cudoctl_windows_amd64.zip'
  }];
  return <Columns cols={3}>
      {cliBinaries.map(bin => <Card key={bin.id} href={bin.url}>
          <span className="flex flex-row items-center justify-center">
            <Icon icon={getOsImageIcon(bin.id)} size={24} color="transparent" alt={bin.name} />
            <span style={{
    marginLeft: '.6rem',
    fontSize: '0.8rem'
  }}>{bin.name}</span>
          </span>
        </Card>)}
    </Columns>;
};

<Note>
  You will need to **[Create an API key](/docs/api/authentication#create-an-api-key)** before you can use cudoctl.
</Note>

## Download

Download the latest release from the list below, binaries are available for Linux, macOS and Windows.

<CliToolTable />

<Note>
  If you have any issues with **cudoctl**, please reach out to our support team at [support@cudocompute.com](mailto:support@cudocompute.com)
</Note>

## Getting started

Run `cudoctl init` and follow the steps.

```sh theme={null}
cudoctl init
✔ api key: my-api-key
✔ project: my-project
✔ billing account: my-billing-account
✔ context: default
config file saved ~/.config/cudo/cudo.yml
```

A config file will be maintained in `$HOME/.config/cudo/cudo.yml`

```sh theme={null}
configVersion: v0
keys:
    - key: xxxyyyzzz
      name: my-first-api-key
    - key: aaabbbccc
      name: my-second-api-key
contexts:
    - name: cudo-demo
      key: my-first-api-key
      billing-account: xxxxxxxxx
      project: my-project
    - name: cudo-demo-2
      key: my-second-api-key
      billing-account: xxxxxxxxx
      project: my-other-project
current-context: cudo-demo
```

The file can be edited manually, and new contexts can be added using `cudoctl init`. Multiple contexts can be setup which are used like profiles when `cudoctl` runs. One context is selected at a time as the current context.

<Note>
  Show help at any level by using `-h` e.g `cudoctl -h`
</Note>

## Global options

Global options are used to set top level options that affect the rest of the execution of `cudoctl` . See `cudoctl -h` for more details.

```sh {{ title: 'Examples' }} theme={null}
# choose a config file
cudoctl --config /etc/config/cudo.yaml <group> [command]

# set context with an environment variable
CUDOCTL_CONTEXT=local cudoctl <group> [command]

# output in json
cudoctl --json <group> [command]
```

## Config

Show and set the current config context. See `cudoctl config -h` for more details.

```sh {{ title: 'Examples' }} theme={null}
cudoctl config current
local

cudoctl config use cudo-demo-2

cudoctl config current
cudo-demo-2

cudoctl config show
name: cudo-demo-2
key: my-second-api-key
billing-account: xxxxxxxxx
project: my-other-project
```
