# Install the CLI

> Install the nodus CLI on macOS, Linux or Windows, verify the download, turn on shell completion and sign in.

Source: https://www.nodus-compute.ai/docs/getting-started/install/
Build revision: 53bfc045e800bf7bb44fa18623013c7aa9c9971e

The `nodus` CLI is one self-contained binary for macOS, Linux and Windows on x86-64 and ARM64. Pick one way to install it.

**pip**

Terminal window

```sh
pip install nodus-compute
```

The Python package (Python 3.10 or newer) includes the CLI, so `nodus` is on your `PATH` wherever the package is installed. Use this if you also want the Python SDK.

**Homebrew**

Terminal window

```sh
brew install --cask nodus-compute/tap/nodus
```

**macOS and Linux**

Terminal window

```sh
curl -fsSL https://nodus-compute.ai/install | sh
```

The script installs to `~/.local/bin` and checks the archive against the release’s `checksums.txt` first. `NODUS_VERSION=1.2.3` pins a release and `NODUS_INSTALL_DIR` picks another directory.

**Windows**

Terminal window

```powershell
irm https://nodus-compute.ai/install.ps1 | iex
```

Check that it works:

Terminal window

```console
$ nodus version
nodus v1.0.0
```

## Sign in

Terminal window

```sh
nodus login
```

Your browser opens to confirm the sign-in. If you belong to several orgs, pick the ones this machine should use: the CLI stores one API key per org in the OS keychain and creates one **context** per org. Switch between them with `nodus config use-context <org>`, or pass `--org <org>` to a single command.

|Where you are|Command|
|-|-|
|A laptop with a browser|`nodus login`|
|An SSH session or a machine without a browser|`nodus login --device`, then approve the code from any device|
|CI, with a key in a secret|`echo "$NODUS_API_KEY" \| nodus login --with-token`, or just set `NODUS_API_KEY`|

`nodus whoami` shows who you are signed in as, your role, the current project and your available credit. `nodus logout` revokes this machine’s key and removes the context.

Environment variables

The CLI reads six variables, all optional: `NODUS_API_KEY`, `NODUS_API_URL`, `NODUS_ORG`, `NODUS_PROJECT`, `NODUS_CONTEXT` and `NODUS_CONFIG`. A variable wins over the config file for that invocation.

## Shell completion

Terminal window

```sh
nodus completion zsh > "${fpath[1]}/_nodus"          # zsh
nodus completion bash > /etc/bash_completion.d/nodus # bash (or ~/.local/share/bash-completion/completions/nodus)
nodus completion fish > ~/.config/fish/completions/nodus.fish
```

Completion covers every command and flag.

## Verify a download

Every release publishes `checksums.txt`, a keyless cosign signature over it, and an SBOM per archive. To verify an archive you downloaded yourself:

Terminal window

```sh
cosign verify-blob checksums.txt \
  --bundle checksums.txt.sigstore.json \
  --certificate-identity-regexp '^https://github.com/nodus-compute/nodus-platform/' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com
shasum -a 256 --ignore-missing -c checksums.txt
```

## Where the CLI keeps things

|Path|What it holds|
|-|-|
|`~/.nodus/config`|Contexts: API server, org and project. It is a kubeconfig, so `KUBECONFIG=~/.nodus/config kubectl get jobs.nodus.dev` works too|
|OS keychain (`~/.nodus/credentials`, mode 0600, where there is none)|One API key per context|
|`~/.nodus/cache/`|The cached list of resource kinds; `nodus api-resources` refreshes it|

If you used Nodus before 1.0, its `~/.nodus/config.toml` is renamed to `config.0x.bak` the first time the new CLI runs; sign in again with `nodus login`. A 0.x `nodus.toml` converts into a manifest you can review and apply:

Terminal window

```sh
nodus convert nodus.toml > job.yaml   # fields that do not carry over are listed on stderr
nodus apply -f job.yaml --dry-run=server -o estimate
```

## Upgrade and uninstall

Upgrade the same way you installed (`pip install -U nodus-compute`, `brew upgrade --cask nodus`, or run the install script again). To uninstall, run `nodus logout`, remove the binary, and delete `~/.nodus`.

## Next steps

* [Quickstart](https://www.nodus-compute.ai/docs/getting-started/quickstart/): run your own code on a GPU and download its results.
* [Nodus for kubectl users](https://www.nodus-compute.ai/docs/getting-started/kubectl-users/): the verbs you already know.
* [CLI reference](https://www.nodus-compute.ai/docs/reference/cli/): every command and flag.

### Creating your first organization

Verify your email and card in the console before creating an organization. Card verification does not collect a payment or turn on auto-recharge. Each card can belong to one account. If you begin with `nodus login`, use the onboarding link, then return to the CLI authorization tab and refresh your organizations. Run the login command again if its code expires. You can accept an invitation to an existing team without adding a personal card.
