---
title: Quick start
meta:
    description: Get started with Tinybird CLI as quickly as possible. Ingest, query, and publish data in minutes.
---

# Quick start for Tinybird command-line interface

With Tinybird, you can ingest data from anywhere, query and transform it using SQL, and publish your data as high-concurrency, low-latency REST API endpoints.

After you've [familiarized yourself with Tinybird](/classic/get-started/quick-start), you're ready to start automating and scripting the management of your Workspace using the Tinybird command-line interface (CLI). The Tinybird CLI is essential for all [CI/CD workflows](/classic/work-with-data/organize-your-work/continuous-integration).

Read on to learn how to download and configure the Tinybird CLI, create a Workspace, ingest data, create a query, publish an API, and confirm your setup works properly.

## Step 1: Create your Tinybird account

[Create a Tinybird account](https://www.tinybird.co/signup). It's free and no credit card is required. See [Tinybird pricing plans](/classic/pricing) for more information.

{% button
  icon="isotype"
  variant="primary"
  href="https://www.tinybird.co/signup"
  children="Sign up for Tinybird"
/%}

## Step 2: Download and install the Tinybird CLI

[Follow the instructions](/classic/cli/install) to download and install the Tinybird command-line interface (CLI).

Complete the setup and authenticate with your Tinybird account in the cloud and region you prefer.

## Step 3: Create your Workspace

A [Workspace](../administration/workspaces) is an area that contains a set of Tinybird resources, including Data Sources, Pipes, nodes, API Endpoints, and Tokens.

Create a Workspace named `customer_rewards`. Use a unique name.

```shell
tb workspace create customer_rewards
```

## Step 4: Download and ingest sample data

Download the following NDJSON sample data from a fictitious online coffee shop:
{% button
  icon="docs"
  variant="ghost"
  href="https://www.tinybird.co/docs/assets/sample-data-files/orders.ndjson"
  children="Download data file"
/%}

The following Tinybird CLI commands infer the schema from the datafile, generate and push a .datasource file and ingest the data.

```shell
tb datasource generate orders.ndjson        # Infer the schema
tb push orders.datasource                   # Upload the datasource file
tb datasource append orders orders.ndjson   # Ingest the data
```

## Step 5: Query data using a Pipe and Publish it as an API

In Tinybird, you can create [Pipes](/classic/work-with-data/query/pipes) to query your data using SQL.

The following commands create a Pipe with an SQL instruction that returns the number of records Tinybird has ingested from the data file:

```shell
tb pipe generate rewards 'select count() from orders'
tb push rewards.pipe
```

When you push a Pipe, Tinybird publishes it automatically as a high-concurrency, low-latency API Endpoint.

## Step 6: Call the API Endpoint

You can test your API Endpoint using a curl command.

First, create and obtain the read Token for the API Endpoint.

```shell
tb token create static rewards_read_token --scope PIPES:READ --resource rewards
tb token copy rewards_read_token
```

Copy the read Token and insert it into a curl command.

```shell
curl --compressed -H 'Authorization: Bearer your_read_token_here'  https://api.us-east.aws.tinybird.co/v0/pipes/rewards.json
```

You have now created your first API Endpoint in Tinybird using the CLI.

## Next steps

- Learn about datafiles and their format. See [Datafiles](/classic/cli/datafiles).
- Learn how advanced templates can help you. See [Advanced templates](/classic/cli/advanced-templates).
- Browse the full CLI reference. See [Command reference](/classic/cli/command-ref).