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

# CLI

> Install the Tembo CLI and connect a machine to Tembo so sessions you start can run commands and work with files on it.

The Tembo CLI (`tembo`) is a command-line tool you install on your own machine. Use it to connect a laptop, server, or other machine to Tembo as a **device**. Once connected, sessions you start can run commands and read or write files on that machine.

> [!NOTE]
>
> Devices is rolling out gradually. If **Settings > Devices** says that Devices isn't available yet, it hasn't been enabled for your workspace.

This page covers the CLI you install yourself. Agents also have a `tembo` command inside their sandbox, which is a separate tool. See [Tembo CLI commands](https://docs.tembo.io/features/sandbox/built-in-skills-and-tools.md#tembo-cli-commands) for that reference.

## Install

```bash Install script theme={null}
curl -fsSL https://cli.tembo.sh | sh
```

```bash Homebrew theme={null}
brew install tembo/tap/tembo
```

The install script supports macOS and Linux on x64 and arm64. It verifies the download's checksum and installs `tembo` to `~/.local/bin`. If that directory isn't on your `PATH`, the script prints the line to add to your shell profile.

On Windows, download [tembo-x86\_64-pc-windows-msvc.zip](https://cli.tembo.sh/latest/tembo-x86_64-pc-windows-msvc.zip), extract it, and put `tembo.exe` on your `PATH`.

Check the installed version:

```bash theme={null}
tembo --version
```

### Install options

Set these environment variables on the `sh` side of the pipe to change what the script installs:

| Variable | Description | Default |
| - | - | - |
| `TEMBO_VERSION` | Release to install, for example `0.1.0`. | Latest release |
| `TEMBO_INSTALL_DIR` | Directory to install `tembo` into. | `~/.local/bin` |

```bash theme={null}
curl -fsSL https://cli.tembo.sh | TEMBO_INSTALL_DIR="$HOME/bin" sh
```

To update, run the install script again or run `brew upgrade tembo`.

## Connect a machine

If you use the [Tembo desktop app](https://tembo.io/download), you don't need the CLI on that computer. Open **Settings > Devices** in the desktop app and click **Connect this computer**. Use the CLI for machines without the desktop app, such as servers and Linux boxes.

### Prerequisites

* The Tembo CLI is installed on the machine you want to connect.
* Devices is enabled for your workspace.

**1. Get a pairing code**

In the [dashboard](https://app.tembo.io), open **Settings > Devices** and click **Add device**. The dialog shows two commands to run on your machine. The pairing code works once and expires after 10 minutes.

**2. Pair the machine**

Copy the first command from the dialog and run it on your machine. It includes your pairing code and your Tembo API URL:

```bash theme={null}
tembo devices pair <code> --api-url <api-url>
```

The device is named after the machine's hostname. Add `--name <name>` to choose a different name.

**3. Start the device**

```bash theme={null}
tembo devices start
```

Leave this command running. The device appears in **Settings > Devices** once it connects, and your sessions can use it while the command runs. Press `Ctrl+C` to stop it.

On a server, run `tembo devices start` under a process manager or terminal multiplexer, such as systemd or tmux, so it keeps running after you log out.

## Use a device in a session

Ask Tembo to work on your machine in a session, for example "Run the test suite in `~/code/app` on my laptop." The agent can:

* Run shell commands on the device in your login shell (PowerShell on Windows), starting in your home directory.
* Read, write, and list files on the device.
* Check the device's operating system, user, home directory, and shell.

Commands run on your real machine with your user's permissions. When more than one of your devices is online, mention the one you want by name.

### Access

* **Only you can use your devices.** Other members of your workspace can see your devices in **Settings > Devices**, but their sessions can't use them.
* **Devices work in sessions you start in the Tembo app**, for messages you type. Sessions started by agents or integrations can't use devices.
* **Disable a device to pause access.** Turn off the device's toggle in **Settings > Devices** to block requests without unpairing it. Workspace admins can also disable or remove any device.

### Limits

| Operation | Limit |
| - | - |
| Command timeout | 2 minutes by default, up to 10 minutes |
| Command output | 1 MB each for stdout and stderr; anything longer is truncated |
| File reads | Files up to 10 MB |
| Directory listings | Up to 2,000 entries |

## Manage a device

Show the device this machine is paired as:

```bash theme={null}
tembo devices status
```

Remove the device from Tembo and delete its local credentials:

```bash theme={null}
tembo devices unpair
```

You can also remove a device from **Settings > Devices**. If `tembo devices start` is running when you do, it stops and deletes the machine's local credentials.

The CLI stores credentials in `~/.config/tembo-device/device.json`, or `%APPDATA%\tembo-device\device.json` on Windows. To store them somewhere else, set `TEMBO_DEVICE_CONFIG_DIR` or pass `--config-dir <dir>` to every `tembo devices` command.

## Command reference

| Command | Description |
| - | - |
| `tembo devices pair <code> --api-url <url> [--name <name>]` | Pair this machine using a code from **Settings > Devices > Add device**. |
| `tembo devices start` | Connect to Tembo and handle requests from your sessions until stopped. |
| `tembo devices status` | Show the paired device's ID, name, and API URL. |
| `tembo devices unpair` | Remove this device from Tembo and delete local credentials. |
| `tembo --version` | Print the installed version. |
| `tembo --help` | Show help. Run `tembo devices --help` for device commands and options. |

## Troubleshooting

> **tembo: command not found**
>
> The install directory isn't on your `PATH`. Add the line the install script printed to your shell profile, then open a new terminal.

> **This pairing code is invalid, expired, or already used**
>
> Pairing codes work once and expire after 10 minutes. Click **Add device** again to get a new code.

> **This machine is not paired**
>
> `tembo devices start` needs a paired device. Run the `tembo devices pair` command from **Settings > Devices > Add device** first.

> **Connected, but requests are blocked**
>
> The device is disabled. Turn on its toggle in **Settings > Devices**.

> **A session says no device is online**
>
> Make sure `tembo devices start` is running on the machine and the device is enabled in **Settings > Devices**. Devices are only available in sessions you started in the Tembo app.


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