---
title: Install Tinybird Classic CLI
meta:
  description: Install the Tinybird Classic CLI on Linux or macOS, or use the prebuilt Docker image.
---

# Install the Tinybird Classic CLI

You can install Tinybird on your local machine or use a prebuilt Docker image.

Read on to learn how to install and configure Tinybird CLI for use.

## Installation

Install Tinybird CLI locally to use it on your machine.

### Prerequisites

Tinybird CLI supports Linux and macOS 10.14 and higher.

Supported Python versions are {% $PYTHON_REQUIRES %}.

### Install tinybird-cli

Create a virtual environment before installing the `tinybird-cli` package:

```shell {% title="Creating a virtual environment for Python 3" %}
python3 -m venv .venv
source .venv/bin/activate
```

Then, install `tinybird-cli`:

```shell {% title="Install tinybird-cli" %}
pip install tinybird-cli
```

To update the `tinybird-cli` package, run the following command:

```shell {% title="Update tinybird-cli" %}
pip install --upgrade tinybird-cli
```

To uninstall the `tinybird-cli` package, run the following command:

```shell {% title="Uninstall tinybird-cli" %}
pip uninstall tinybird-cli
```

## Docker image

The official `tinybird-cli-docker` image provides a Tinybird CLI executable ready to use in your projects and pipelines.

To run Tinybird CLI using Docker from the terminal, run the following commands:

```shell {% title="Build local image setting your project path" %}
# Assuming a projects/data path
docker run -v ~/projects/data:/mnt/data -it tinybirdco/tinybird-cli-docker
cd mnt/data
```

## Authentication

Before you start using Tinybird CLI, check that you can authenticate by running `tb auth`:

```shell {% title="Authenticate" %}
tb auth -i
```

A list of available regions appears. Select your Tinybird region, then provide your admin Token. See [Tokens](/classic/administration/auth-tokens). 

You can also pass the Token directly with the `--token` flag. For example:

```shell {% title="Authenticate" %}
tb auth --token <your_admin_token>
```

See the API Reference docs for the [list of supported regions](/api-reference#regions-and-endpoints). You can also get the list using `tb auth ls`.

{% callout type="caution" %}
The `tb auth` command saves your credentials in a .tinyb file in your current directory. Add it to your .gitignore file to avoid leaking credentials.
{% /callout %}

## Integrated help

After you've installed the Tinybird CLI you can access the integrated help by using the `--help` flag:

```{% title="Integrated help" %}
tb --help
```

You can do the same for every available command. For example:

```{% title="Integrated command help" %}
tb datasource --help
```

## Telemetry

Starting from version 1.0.0b272, the Tinybird CLI collects telemetry on the use of the CLI commands and information about exceptions and crashes and sends it to Tinybird. Telemetry helps Tinybird improve the command-line experience.

On each `tb` execution, the CLI collects information about your system, Python environment, the CLI version installed and the command you ran. All data is completely anonymous.

To opt out of the telemetry feature, set the `TB_CLI_TELEMETRY_OPTOUT` environment variable to `1` or `true`.

## Configure your shell prompt

You can extract the current Tinybird Workspace and region from your .tinyb file and show it in your zsh or bash shell prompt.

To extract the information programmatically, paste the following function to your shell config file:

```shell {% title="Parse the .tinyb file to use the output in the PROMPT" %}
prompt_tb() {
if [ -e ".tinyb" ]; then
    TB_CHAR=$'\U1F423'
    branch_name=`grep '"name":' .tinyb | cut -d : -f 2 | cut -d '"' -f 2`
    region=`grep '"host":' .tinyb | cut -d / -f 3 | cut -d . -f 2 | cut -d : -f 1`
    if [ "$region" = "tinybird" ]; then
    region=`grep '"host":' .tinyb | cut -d / -f 3 | cut -d . -f 1`
    fi
    TB_BRANCH="${TB_CHAR}tb:${region}=>${branch_name}"
else
    TB_BRANCH=''
fi

echo $TB_BRANCH
}
```

When the function is available, you need to make the output visible on the prompt of your shell. The following example shows how to do this for zsh:

```shell {% title="Include Tinybird information in the zsh prompt" %}
echo 'export PROMPT="' $PS1 ' $(prompt_tb)"' >> ~/.zshrc
```

Restart your shell and go to the root of your project to see the Tinybird region and Workspace in your prompt.