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

# Installation

> Install the Kylon CLI, sign in, and run your first command.

<Steps>
  <Step title="Install the Kylon CLI">
    <Tabs>
      <Tab title="macOS/Linux">
        Install the Kylon CLI with the standalone installer for macOS and Linux — no Node.js required, nothing outside `~/.kylon` except a `PATH` line, no `sudo`.

        **Install Kylon**

        ```bash theme={null}
        curl -fsSL https://api.kylon.io/install.sh | sh
        ```

        **Update Kylon**

        Rerun the same command any time — it updates the installed CLI in place, or run `kylon upgrade`.

        ```bash theme={null}
        curl -fsSL https://api.kylon.io/install.sh | sh
        ```
      </Tab>

      <Tab title="Windows">
        One command in PowerShell (Node.js 22.15+ required — the script tells you how to get it if missing):

        ```powershell theme={null}
        powershell -c "irm https://api.kylon.io/install.ps1 | iex"
        ```

        It records the server, verifies Node.js, and opens your browser to sign in. Prefer the full macOS/Linux installer? Use WSL. The npm spelling also works:

        ```bash theme={null}
        npx --yes kylon-cli@latest login
        ```
      </Tab>

      <Tab title="npm">
        The CLI is published to npm as [`kylon-cli`](https://www.npmjs.com/package/kylon-cli). Prefer the installer script on macOS and Linux — it pins the exact build the local agent runtime executes instead of leaving a separate npm-global binary to drift.

        ```bash theme={null}
        npm install -g kylon-cli@latest
        ```
      </Tab>
    </Tabs>

    <Note>
      Installing from a non-production environment? Use that environment's API origin (for example `https://api.purework.ai/install.sh` for dev). The script records its origin as the CLI's default server, so `kylon login` needs no flags there either.
    </Note>
  </Step>

  <Step title="Sign in">
    The installer chains straight into the browser sign-in. On a machine that already has Kylon, run:

    ```bash theme={null}
    kylon login
    ```

    In the browser, confirm the code matches the one in your terminal, then approve the device. Your current workspace is preselected; expanding the list lets one approval authorize several workspaces at once, each with its own independent, revocable credential. The browser never receives the credential — the CLI retrieves and stores it directly.
  </Step>

  <Step title="Run your first command">
    ```bash theme={null}
    kylon status
    ```

    Then explore what your workspace exposes:

    ```bash theme={null}
    kylon workspace help
    ```
  </Step>
</Steps>

## Remote and headless machines

Both install commands work over SSH. Two ways to finish the sign-in when the machine cannot open a browser:

* **Approve from your own browser** — run the install command as usual. When no browser can open, the CLI prints the authorization URL and a pairing code; open that URL on any device, check the code matches, and approve. The remote CLI picks the credential up itself.
* **Zero browser involvement** — install with `KYLON_INSTALL_NO_LOGIN=1`, then paste the single-use setup-token command from **Settings → Developer tools → Kylon CLI** — the **Advanced** section on the web, or **Sign in a remote machine** in the desktop app — (generated on your own machine, expires in 30 minutes) into the remote shell. It authorizes the device with no browser step at all.

## Good to know

* **Verified downloads** — the installer checks the CLI package's integrity hash from the npm registry and, when it provisions Node.js, the official `SHASUMS256` manifest.
* **macOS/Linux: works without Node.js** — a machine without Node.js 22.15+ gets a private, checksum-verified runtime under `~/.kylon/runtime` that only Kylon uses. It never changes which `node` your own shell resolves.
* **Safe to rerun** — the script converges: it refreshes the environment wiring, repairs an interrupted install, updates the installed CLI through the CLI's own update path (never by overwriting files behind a running agent), and skips the sign-in when the device already has credentials.

### Script options

| Environment variable | Effect |
| - | - |
| `KYLON_INSTALL_NO_LOGIN=1` | Install only; print the next step instead of starting the sign-in. |
| `KYLON_INSTALL_NO_MODIFY_PATH=1` | Never edit shell profiles; print the `PATH` line to add manually. |

### Uninstall

Remove the credential from **Settings → Developer tools → Kylon CLI → Authorized devices**, then delete the directory and the `PATH` block it added:

```bash theme={null}
rm -rf ~/.kylon
```

(The `PATH` line lives between the `# >>> kylon >>>` markers in your shell profile, or in `~/.config/fish/conf.d/kylon.fish`.)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.