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

# CLI

> Install the Nuon CLI.

## Installation

### Homebrew

We publish an official tap you can install with [Homebrew](https://brew.sh/).

```sh theme={null}
brew install nuonco/tap/nuon
```

After installation, you may need to refresh your shell session.

```sh theme={null}
source ~/.bashrc # or ~/.zshrc, etc.
```

You can also enable autocomplete for you shell. Run `nuon completion` to see what shells we support.

```sh theme={null}
source <(nuon completion <your-shell>)
```

<Note>
  The Nuon CLI changes frequently. To ensure you have the latest version, run `brew upgrade nuonco/tap/nuon` regularly. If you encounter any CLI command errors, please check you are using the latest version.
</Note>

### Install Script

If you are not using Homebrew, you can use our install script to automatically download and install the correct binary
for your platform (macOS or Linux):

```sh theme={null}
bash <(curl -sSL https://nuon-artifacts.s3.us-west-2.amazonaws.com/cli/install.sh)
```

The script automatically detects your OS and architecture, downloads the latest version, and installs it to your path.

### Manual Binary Download

You can also download binaries directly for macOS or Linux:

* `darwin_amd64`
* `darwin_arm64`
* `linux_arm`
* `linux_arm64`
* `linux_386`
* `linux_amd64`

Binaries are published to [https://nuon-artifacts.s3.us-west-2.amazonaws.com/cli](https://nuon-artifacts.s3.us-west-2.amazonaws.com/cli), and versioned by release. To download a
binary, first look up the current API version, and then download the current binary for your platform.

To look up the current API version:

```sh theme={null}
curl https://api.nuon.co/version
```

To download the binaries for a specific version, substitute the version and platform into the following URL:
`https://nuon-artifacts.s3.us-west-2.amazonaws.com/cli/$VERSION/nuon_${PLATFORM}`

An example of downloading version `0.19.421` of the CLI for `darwin_arm64`:

```sh theme={null}
wget -O nuon https://nuon-artifacts.s3.us-west-2.amazonaws.com/cli/0.19.421/nuon_darwin_arm64
```

Once the binary has been downloaded remember to make it executable.

```sh theme={null}
chmod +x nuon
```

### Updates

You can update the CLI using Homebrew:

```sh theme={null}
brew update
brew upgrade nuonco/tap/nuon
```

Or, if you installed via the install script, simply run it again to get the latest version. For manual binary installs,
download the latest version from the S3 bucket as described above.

### Debug Mode

In the case that something goes wrong, you can set the environment variable `NUON_DEBUG` to print verbose logs. These
can be helpful to share with us, while debugging any issues.

```sh theme={null}
NUON_DEBUG=true nuon apps list
```

### Using the CLI against a BYOC Instance

If you are using a Nuon BYOC instance, i.e., a self-hosted Nuon control plane running in your own infrastructure, you
can use the CLI to interact with it.

To do this, you can:

```sh theme={null}
NUON_API_URL=https://api.your-byoc-instance.com nuon auth login

# or

export NUON_API_URL=https://api.your-byoc-instance.com
nuon auth login #or other nuon CLI commands.
```

By default, the CLI will use api.nuon.co as the API URL.

`nuon auth login` also prompts the user to either use Nuon Cloud (api.nuon.co) or BYOC Nuon where the user can enter
their Nuon control place URL

<img src="https://mintcdn.com/nuoninc/l1xOeqOMK9hEo3iD/images/resources/cli/cli-auth-login.png?fit=max&auto=format&n=l1xOeqOMK9hEo3iD&q=85&s=675e9354a27753f73c301427eb9a1e04" alt="Nuon auth login" width="1244" height="132" data-path="images/resources/cli/cli-auth-login.png" />

## Nuon Preview Features

We are working on a number of TUIs for the CLI. These include contextual TUIs for object selection and full-page TUIs
for workflows and actions. These features can be enabled by setting `NUON_PREVIEW=true`.

<img src="https://mintcdn.com/nuoninc/jvitiYaP4mvn2f7m/images/resources/cli/workflow.png?fit=max&auto=format&n=jvitiYaP4mvn2f7m&q=85&s=4a302526ba6b4b2daeee3e4fce66c91f" alt="Nuon CLI TUI" width="1920" height="966" data-path="images/resources/cli/workflow.png" />

At the time of writing, we have experimental TUIs for actions, workflows, and for creating new installs.

### Nuon CLI Extensions

The `nuon` cli has support for extensions. You can browse nuon-authored extensions with `nuon ext browse` and author
your own. At the time of writing, we have published a handful of extensions for public consumption. Try our api
extension with `nuon install api`.

<img src="https://mintcdn.com/nuoninc/BZqGN-HJbuXp-0U2/images/resources/cli/extensions.png?fit=max&auto=format&n=BZqGN-HJbuXp-0U2&q=85&s=7c1c74947a09d71178c2895bbef43538" alt="Nuon Extensions" width="1984" height="806" data-path="images/resources/cli/extensions.png" />
