# Install the CLI

> Install the Corfedo CLI on macOS or Linux, check the installed version and keep it up to date.

Source: https://docs.corfedo.ai/connect/cli/

The Corfedo CLI searches and reads code and asks Corfedo AI from your terminal and scripts. It is a single native executable named `corfedo`, installed separately from Corfedo itself on each machine you use it from. It needs no .NET runtime.

## Before you begin

- macOS on Apple silicon, or Linux on x64 with glibc at least as new as Ubuntu 24.04. Alpine and other musl distributions are not supported.

## Install

```sh
curl -fsSL https://raw.githubusercontent.com/corfedo/corfedo-cli/main/install.sh | sh
```

The CLI's install script verifies the release's checksum and links `corfedo` into `~/.local/bin` without sudo. Add `~/.local/bin` to your `PATH` if your shell does not find `corfedo`.

To change what is installed and where, set these variables on `sh`:

| Variable | Default | Purpose |
| --- | --- | --- |
| `CORFEDO_VERSION` | Latest release | Install a published tag such as `v1.2.3` |
| `CORFEDO_INSTALL_DIR` | `~/.local/share/corfedo/cli` | Directory that holds the installed versions |
| `CORFEDO_BIN_DIR` | `~/.local/bin` | Directory for the `corfedo` link |

```sh
curl -fsSL https://raw.githubusercontent.com/corfedo/corfedo-cli/main/install.sh | CORFEDO_VERSION=v1.2.3 sh
```

Both directories must be absolute paths.

## Check the installation

```sh
corfedo version
```

**Check:** it prints the installed version, the commit it was built from and the platform, for example `corfedo 1.2.3 (3f2a1c9e8b7d, osx-arm64)`.

## Update the CLI

```sh
corfedo update --check
corfedo update
```

`--check` reports whether a newer CLI is available. `corfedo update` installs it and keeps a custom install location. Only copies installed with the install script can update themselves. To update Corfedo itself, see [Update](https://docs.corfedo.ai/operate/single-host/update/).

## Next step

[Sign in and profiles](https://docs.corfedo.ai/connect/cli/sign-in-and-profiles/) connects the CLI to your workspace.
