# Install the CLI

## Install

1. Check:

   ```bash
   cofactor --version
   ```

2. Missing (command not found): install it, then check again.

   ```bash
   npm install -g @runcofactor/cli
   ```

   Needs Node 20 or later. If neither npm nor bun is available, tell the human what to install and stop.
3. Installed already (or just now): bring it up to date, since the guide always follows the latest API and an older CLI lacks commands it names.

   ```bash
   cofactor upgrade
   ```

   Safe to repeat; on the latest version it reinstalls the same one. If it fails, tell the human the error and stop.
4. Check that this CLI has signup:

   ```bash
   cofactor signup --help
   ```

Done when `cofactor --version` prints a version and `cofactor signup --help` prints usage.

Do not use npx. Do not install anything else.

Next: `cofactor setup guide account` (already signed in, meaning `cofactor setup status --json` succeeds: skip to `source`)
