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

# Install and sign in to the PPIO CLI

> Install the ppio-sandbox-cli package, point the CLI at the PPIO Agent Sandbox service, check the API key, and sign in through the browser.

The PPIO CLI manages sandboxes, runs commands, builds templates and performs common development tasks from the terminal. The command is `ppio`, installed from the `ppio-sandbox-cli` package. This page installs it, points it at PPIO, and signs it in.

## Install

**1. Install the CLI**

Install the package globally so the `ppio` command is on the path.

```bash theme={null}
npm i -g ppio-sandbox-cli
```

**2. Set the environment variables**

Set two environment variables before running any example. Replace `<your-api-key>` with a key from the **API Keys** page of the [console](https://console.ppio.ai/api-keys).

> [tab] macOS and Linux
>
> ```bash theme={null}
> export PPIO_API_KEY="<your-api-key>"
> export PPIO_DOMAIN="sandbox.ppio.ai"
> ```

> [tab] Windows (PowerShell)
>
> ```powershell theme={null}
> $env:PPIO_API_KEY = "<your-api-key>"
> $env:PPIO_DOMAIN = "sandbox.ppio.ai"
> ```

The SDK and the CLI read both variables from the environment.

**PPIO\_API\_KEY** `string`

Authenticates requests to Agent Sandbox.

**PPIO\_DOMAIN** `string`

Selects the Agent Sandbox service for ppio.ai. Without it, the SDK and the CLI connect to their built-in default service instead.

> [!NOTE]
>
> These commands set the variables for the current terminal session only.

**3. Check the API key**

The CLI reads `PPIO_API_KEY` and `PPIO_DOMAIN` from the environment. A list call confirms that the key reaches the PPIO Agent Sandbox service.

```bash theme={null}
ppio sandbox list
```

Authenticate before the CLI acts on sandboxes. The `ppio auth` command group manages the login session, the active team and the login stored at `~/.ppio/config.json`.

## Sign in

**1. Run the login command**

`ppio auth login` signs in to PPIO.

```bash theme={null}
ppio auth login
```

**2. Approve the request in the browser**

The CLI opens a browser-based authorization page. After approval, it stores the session, selects the default team, and writes the login to `~/.ppio/config.json`.

On success, the CLI prints the signed-in email and the selected team:

```text Output theme={null}
Logged in as you@example.com with selected team my-team
```

> [!NOTE]
>
> If a session already exists, the command reports the current session instead of signing in again. To sign in as a different user, run `ppio auth logout` first. To switch teams, run `ppio auth configure`.

## Sign out

`ppio auth logout` signs out. It deletes the local login file at `~/.ppio/config.json`.

```bash theme={null}
ppio auth logout
```

It prints `Logged out.` when a session exists, and `Not logged in, nothing to do` when there is no session.

## Show the current session

`ppio auth info` shows information about the current user, including the signed-in email and the selected team.

```bash theme={null}
ppio auth info
```

Example output:

```text Output theme={null}
You are logged in as you@example.com,
Selected team: my-team (team-id)
```

With no login stored, it prints `Not logged in`.

> [!NOTE]
>
> `ppio auth info` reads only the login configuration file. To check an API key that is set in the environment, use `ppio sandbox list`.

## Switch teams

`ppio auth configure` changes the active team for an existing session. The CLI fetches the teams the login belongs to and prompts for one. The chosen team's name, ID and API key are saved back to `~/.ppio/config.json`.

```bash theme={null}
ppio auth configure
```

> [!NOTE]
>
> A login is required first. With no user configuration, the CLI asks to run `ppio auth login` before configuring a team.

After the selection, it confirms the chosen team:

```text Output theme={null}
Team my-team (team-id) selected.
```


## Related topics

- [Agent Sandbox: secure cloud sandboxes for AI agents](https://docs.ppio.ai/sandbox/overview.md)
- [Download files from a sandbox](https://docs.ppio.ai/sandbox/filesystem/download.md)
- [Upload files to a sandbox](https://docs.ppio.ai/sandbox/filesystem/upload.md)


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