# Quickstart

This page takes you from nothing to a working Solidafy project on your machine and a first query against your data, in about five minutes. You need a Solidafy account and a terminal.

## 1. Install the CLI

On macOS or Linux:

```bash
curl -fsSL https://github.com/solidafy/cli-releases/releases/latest/download/install.sh | sh
```

On Windows, in PowerShell:

```powershell
irm https://github.com/solidafy/cli-releases/releases/latest/download/install.ps1 | iex
```

The installer verifies the download against a published SHA-256 checksum and installs a single file under your home directory. It does not edit your shell profile, so if it prints an `export PATH=...` line, add that line to `~/.zshrc` (macOS) or `~/.bashrc` (most Linux) and open a new terminal. Then check it works:

```bash
solidafy --version
```

More detail, including Windows `PATH` setup and troubleshooting, is in [Installing the CLI](/docs/cli/installation).

## 2. Create a personal access token

The CLI talks to Solidafy with a personal access token (PAT), a secret that acts as you, with your permissions.

1. Sign in to [portal.solidafy.com](https://portal.solidafy.com) and switch to the environment you want to work in (for a first try, your Sandbox).
2. Open **Settings > API Keys**.
3. Under **Personal Access Tokens**, choose **Create Token**, give it a name such as "CLI on my laptop", and pick an expiration.
4. Copy the token. It starts with `sk_pat_` and is shown only once.

A token belongs to the environment you were in when you created it. To work with a second environment later, you create a second token there.

> **Warning:** Treat the token like a password. It can read and write data in its environment.

## 3. Create a project

In an empty directory:

```bash
mkdir my-solidafy-project
cd my-solidafy-project
solidafy init
```

`init` asks for a project name (default: the directory name), your token, and an API URL (press Enter to keep `https://api.solidafy.com`). You can skip the prompts by passing the token directly:

```bash
solidafy init --pat sk_pat_...
```

It then checks the token against the API, pulls the pipelines already in your environment, and writes the project:

```text
solidafy.json                  project config: environments and which one is active
CLAUDE.md                      orientation for an AI coding agent
.gitignore                     keeps environments/*/.env out of git
environments/default/
  .env                         your credentials
  pipelines/                   pipeline YAML pulled from your environment
  dashboards/
docs/                          the reference guides bundled with the CLI
examples/                      example pipelines, liveboards and reports to copy
shared/templates/
.claude/
  skills/                      knowledge packs for AI agents
  settings.json                MCP server entry for AI agents
```

The first environment is named `default` when you sign in with a personal access token. You can add more, with names of your choosing, later (see [Working with environments](/docs/cli/environments)).

Commit this directory to git. The `.gitignore` that `init` writes keeps every `environments/*/.env` file out of the repository.

## 4. Look around

```bash
solidafy env status          # which environment is active, and can we reach it
solidafy pipelines           # the pipelines in that environment
solidafy tables              # every table, grouped by namespace
```

Pick a table from the `tables` output and look at its columns:

```bash
solidafy schema <namespace>.<table>
```

## 5. Run your first query

```bash
solidafy dsl 'source("<namespace>.<table>").limit(10)'
```

That runs a read-only DSL query and prints the rows as a table. A slightly more useful one counts rows per value of a column:

```bash
solidafy dsl 'source("<namespace>.<table>").group_by([<column>]).agg([count() as n]).sort([n: desc]).limit(10)'
```

Queries are read-only unless you add `-x`. The DSL itself is covered in [DSL overview](/docs/dsl/overview).

## 6. Change a pipeline and ship it

Every pipeline command takes the path to a YAML file, not a pipeline name:

```bash
P=environments/default/pipelines/my-pipeline.yaml

solidafy validate "$P"               # check it locally, without pushing
solidafy pipelines push "$P"         # create or update it in the environment
solidafy pipelines run "$P" --watch  # start a run and wait for the result
solidafy logs "$P"                   # recent runs, with step counts and errors
```

If the YAML has no `id` yet, `pipelines push` creates the pipeline and writes the new `id` back into the file. If the pipeline has charts, `solidafy test "$P"` runs every chart query against live data, and `solidafy dashboard push "$P"` publishes the dashboard.

## Next steps

- Hand the project to an AI coding agent: [AI agents and MCP](/docs/cli/ai-agents).
- Add a production environment and switch between environments: [Working with environments](/docs/cli/environments).
- Every command and flag: [CLI command reference](/docs/cli/commands).
- The bundled guides work offline: `solidafy docs` lists them, `solidafy docs dsl` prints the DSL reference, and `solidafy docs search <text>` searches all of them.
