# CLI

import Screenshot from "@docs/Screenshot.astro"
import SurfaceTabs from "@docs/SurfaceTabs.astro"
import { Steps } from "@astrojs/starlight/components"

The Ren CLI, `ren`, manages spaces, projects, tasks, and settings from a terminal or script, and coding agents with shell access can run it. The CLI supports more operations than the [MCP server](/docs/surfaces/mcp/).

Use the [web app](/docs/surfaces/web-app/) to chat with Ren and review its work. Use [MCP](/docs/surfaces/mcp/) for
AI tools that can't run shell commands, like chat websites.

## Install

The installer uses npm and needs Node.js 18 or later.

```sh
curl -fsSL https://useren.ai/install | bash
```

The installer runs `ren init` after installation. To skip initialization, use `curl -fsSL https://useren.ai/install | bash -s -- --no-init`. To install version `0.2.4`, use `curl -fsSL https://useren.ai/install | bash -s -- --version 0.2.4`. You can also install with npm:

```sh
npm install -g @renai-labs/cli
```

## Sign in

<Steps>

1. Run `ren init`. It opens Ren in your browser. Sign in to connect the CLI to your account. Use `ren init --no-browser`
   to print the sign-in URL instead.

2. Run `ren whoami` to confirm. It shows your user, your organization, and your role.

</Steps>

## Check it worked

Ask your coding agent:

```text
Summarize my Ren setup using the ren CLI.
```

Check that the answer names your organization and lists its spaces and projects.

## See active devices

<SurfaceTabs>
<Fragment slot="app">

Each connected CLI appears under **Settings → Preferences → Devices** as **CLI ·** followed by the computer's name.
Select **Remove** to revoke its access, which takes effect on its next request.

<Screenshot
  shot="cli/devices"
  alt="Settings Preferences Devices listing a CLI device row next to the current browser"
/>

</Fragment>
</SurfaceTabs>

## Switch profiles

A profile stores a signed-in account. `ren init` creates the first profile as `default`. To add another account, use a
different profile name:

```sh
ren init --profile work
```

Then list and switch between profiles:

```sh
ren auth profile list
ren auth profile switch work
```

To use a profile for a single command, add `--profile <name>` or set `REN_PROFILE`. To act in another organization with
the same account, run `ren org list`, then `ren org switch <org>`.

`ren auth logout` removes the active profile's sign-in from this computer. Profiles are stored in
`~/.config/ren/auth.json`.

## Limits

- The CLI can't send chat messages. `ren sessions create` creates an empty chat. Send messages through the web app or a
  channel.
- You can only invite people to your organization from the web app.
- Signing in to an app or a custom MCP with OAuth opens your browser.

For every command and flag, run `ren --help` or `ren <command> --help`. Run `ren upgrade` to update the CLI.