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

# Lightdash CLI

> Develop your semantic layer locally, preview changes against real data, and deploy them to production

The Lightdash CLI is how you build and ship your semantic layer. It runs against your dbt project on your own machine, so you can write metrics and dimensions, see them working, and promote them to production without leaving your editor.

Start by [installing the CLI](/workflow/cli/install) and [authenticating](/workflow/cli/authenticate) against your instance.

## The development loop

Most work follows the same cycle.

**Write your semantic layer.** [`lightdash generate`](/workflow/cli/generate) writes a starting `schema.yml` for each model with an entry per column, so you edit rather than author from scratch. [`lightdash compile`](/workflow/cli/compile) builds your project locally to confirm the YAML resolves.

**Check your work before it ships.** [`lightdash preview`](/workflow/preview-projects) spins up a temporary project from your local changes so you can query real data without touching production. [`lightdash validate`](/workflow/cli/validate) reports content that your changes would break — a chart referencing a field you renamed, for instance — and [`lightdash lint`](/workflow/cli/lint) checks your Lightdash Code files against their schemas.

**Ship it.** [`lightdash deploy`](/workflow/cli/deploy) pushes the compiled project to production. In CI, the same commands run on every pull request — see [setting up CI/CD](/workflow/set-up-ci-cd).

## Managing content as code

Charts, dashboards, agents, and data apps can round-trip through the CLI as well as the UI. `lightdash download` pulls them into your repository as files and `lightdash upload` sends them back, which is how you version content, review it in a pull request, or copy it between projects. See [content as code](/workflow/content-as-code).

## Every command and flag

The [CLI reference](/workflow/cli/reference) documents every command, flag, and environment variable.
