# codaid CLI (/docs/apps/codaid)

Install the codaid command-line client on Linux or Windows, sign in, keep it up to date and know where to go for environments.

`codaid` is the codai command line: chat with `codai`, list sessions and schedules, check usage and keys, and send issues to [Resolve](../resolve/index.mdx). The same binary is also the daemon that turns a machine into a [bring-your-own environment](../environments/byo-install.mdx). This page is the short version; the full reference is in [environments → codaid CLI](../environments/codaid.mdx).

## Install [#install]

<Tabs items={['Linux', 'Windows', 'macOS']}>
<Tab value="Linux">

```bash
curl -fsSL https://codai.ro/install-codaid.sh | sh
```

Builds exist for `x86_64` and `aarch64` (static, no extra libraries). The binary goes to `/usr/local/bin/codaid`; set `INSTALL_DIR` to choose another folder.

</Tab>
<Tab value="Windows">

```powershell
irm https://codai.ro/install-codaid.ps1 | iex
```

x64 only. The binary goes to `%LOCALAPPDATA%\codai\bin\codaid.exe`, and that folder is added to your user `PATH`. Open a new terminal afterwards.

</Tab>
<Tab value="macOS">

No macOS build is published yet, so the installer stops with a download error on a Mac. Use codai from a Linux machine or container for now.

</Tab>
</Tabs>

Both installers check the download against the release's `SHA256SUMS` and stop if anything does not match. To check a file by hand, see [verify downloads](./verify-downloads.mdx).

## Sign in [#sign-in]

```bash
codaid login     # opens auth.codai.ro/device with a one-time code
codaid whoami    # shows the account the stored key belongs to
codaid logout    # forgets the key on this machine
```

On a server without a browser, open `auth.codai.ro/device` on any device and type the code shown in the terminal. In CI, skip the sign-in and set `CODAI_API_KEY=codai_…`.

`codaid logout` only removes the key from this machine. To make the key useless everywhere, revoke the device in [hub.codai.ro](https://hub.codai.ro) under **Security → Devices**.

## Update [#update]

Run the install command again. It replaces the binary with the newest release. Check the version with:

```bash
codaid version
```

On Windows, stop a running `codaid run` first, because Windows cannot replace a file that is in use.

## Remove [#remove]

Delete the binary (`/usr/local/bin/codaid` or `%LOCALAPPDATA%\codai\bin\codaid.exe`) and revoke the device in the hub. If you run the daemon as a service, stop and disable that unit first; the unit names are in [run as a service](../environments/byo-install.mdx#run-as-a-service).

## Next [#next]

<Cards>
  <Card title="codaid reference" href="../environments/codaid.mdx" description="All commands, pinned versions and checksums." />
  <Card title="Your own server" href="../environments/byo-install.mdx" description="Run codaid as an environment daemon." />
  <Card title="Troubleshooting" href="../troubleshooting.mdx" description="Sign-in codes, 401 and 404 errors." />
</Cards>
