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

# Reason CLI

> Run Reason from your terminal: on this computer by default, on a cloud computer with --cloud, or on any connected machine with --on.

The `reason` CLI starts Sessions, follows and continues them, connects your computer so Sessions can run on it, and signs you in. Every command is listed by `reason help all`.

> [!NOTE]
>
> Building an app or editor integration (e.g. T3 Code)? Start at [Build an ACP editor](https://docs.reasonmachines.com/docs/build/editor-app-acp.md).
>
> Agents: [https://reasonmachines.com/llms.txt](https://reasonmachines.com/llms.txt)

## Install

One command installs the CLI on macOS and Linux:

```bash theme={null}
curl -fsSL https://reasonmachines.com/install.sh | bash
```

On Windows, run in PowerShell:

```powershell theme={null}
irm https://reasonmachines.com/install.ps1 | iex
```

Check it:

```bash theme={null}
reason --version
reason whoami
```

If `whoami` says you are not signed in, run `reason login`. It opens your browser and asks you to choose a Workspace. A paired setup code skips the choice: `reason login --pair CODE` signs in to the Workspace the code names.

Pass `--no-login` to install without signing in, or `--minimal` to skip the desktop components (files, shell and terminal only).

> [!NOTE]
>
> Updates: `reason update` installs the latest version. `reason update --check` only checks (it exits with code 10 when an update is available).

## Run a task

```bash theme={null}
reason "PROMPT"
```

By default this runs on this computer, in the current folder. The agent thinks in Reason's cloud and its commands run here, on your files, with your user permissions. The first run connects this computer, so Sessions keep running after the terminal closes.

| You want | Command |
| - | - |
| This computer, this folder | `reason "PROMPT"` |
| This computer, another folder | `reason "PROMPT" --dir PATH` |
| Reason's cloud computer | `reason "PROMPT" --cloud` |
| A cloud computer on a repository | `reason "PROMPT" --cloud --repo OWNER/REPO` |
| A cloud computer without a repository | `reason "PROMPT" --cloud --no-repo` |
| A named machine | `reason "PROMPT" --on NAME` |
| Print the Session ID and return | add `-d` (with `--cloud` or `--on`) |

`--model ID`, `--reasoning-effort LEVEL` and `--output-format text|json` set the run's model and output. `--workspace SLUG|ID` picks a signed-in Workspace for one command.

## Connect this computer

```bash theme={null}
reason connect                    # keep this computer connected in the background
reason connect --folder PATH      # where Sessions may run (default: your home folder)
reason connect --name NAME        # this computer's name in Reason
reason connect --once             # only while this command runs; nothing is saved
reason disconnect                 # stop and remove the connection
```

Installing connects the computer. Run `reason connect` again to change its settings. A folder outside your home folder is added to the connection first.

To connect a computer from the app, open **Settings > Your computers > Add computer**. The dialog shows a fresh pairing code each time it opens, so an older command is not reused.

Your computer's Sessions can also use your own Chrome (macOS, through the Reason extension). Turn that off with `reason connect --user-chrome off`.

## Follow and steer a Session

```bash theme={null}
reason ls                          # recent Sessions
reason watch ID                    # follow until it finishes
reason send ID "MESSAGE"           # send a follow-up
reason queue ID "MESSAGE"          # run it after the current turn
reason resume ID ["MESSAGE"]       # continue a finished or stopped Session
reason cancel ID [--hard]          # cancel it; --hard stops now
```

Add `--wait --json` to `send`, `steer`, `queue` or `resume` to wait for that turn and print its result as JSON. A Session that runs on this computer keeps running after the terminal closes.

## Machines and cloud work for scripts

```bash theme={null}
reason run "TASK" --repo OWNER/REPO --wait --json   # cloud work; prints the final answer as JSON
reason machines                                     # machines, their workers, and queued work
reason serve                                        # share this computer as a machine, for --on NAME
```

`reason run` is the scriptable form of `reason "PROMPT" --cloud`, with every option. Use `reason serve --token rmt_…` on a server with no login (get the token from `reason machines token NAME`).

## Desktop components

```bash theme={null}
reason desktop status      # which desktop components are ready
reason desktop install     # install or repair desktop, computer use and browser use
reason desktop minimal     # installs and updates skip desktop components on this computer
reason permissions         # macOS: list privacy permissions; `reason permissions allow` asks for missing ones
```

## Sign in and out

```bash theme={null}
reason login               # sign in and choose a Workspace in your browser
reason login --pair CODE   # sign in to the Workspace a Settings pairing code names
reason login --workspace SLUG|ID   # use a saved Workspace (signs in first if it is not saved)
reason login --switch      # open a new sign-in to pick another Workspace or account
reason whoami              # the signed-in account, organization and saved Workspaces
reason status              # account, this computer's connection, and automatic updates
reason logout              # sign this machine out everywhere
```

Without a terminal, such as an agent's shell, `reason login` prints the link and finishes in the background once you use it. Running it again says where it stands.

### Switch Workspace

Reason keeps every Workspace you sign in to on this computer. Other saved Workspaces stay signed in when you switch.

* At a terminal, `reason login` lists the saved Workspaces and asks `Switch workspace?`. Press Enter to stay on the current one, choose a number to select a saved Workspace, or choose the last number to sign in to another Workspace.
* Without a terminal, `reason login --workspace SLUG|ID` selects a saved Workspace. If it is not saved here, the command signs you in to it first.
* `reason login --switch` opens a new browser sign-in where you pick another Workspace or account.

`reason whoami` shows the organization and lists the saved Workspaces. The selected one is marked `[selected]`.

## Other commands

* `reason secrets` lists secret names. `reason secrets set NAME` stores a value piped on stdin; the value is never printed.
* `reason acp` runs Reason as an editor's agent. See [Use Reason in your editor (ACP)](https://docs.reasonmachines.com/docs/acp.md).
* `reason mcp` connects a coding agent over MCP. See [Connect an agent over MCP](https://docs.reasonmachines.com/docs/mcp.md).
* `reason network` joins a Reason Network of agents. See [Reason Network](https://docs.reasonmachines.com/docs/network.md).
* `reason feedback "NOTE"` sends a bug report or a note to the Reason team.

Run `reason help all` for the full list, or `reason help PROMPT` for the flags of `reason "PROMPT"`.


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