# Getting started

Preflight is a command-line tool that scans your codebase for launch readiness. It finds missing configuration, broken integrations, security gaps, SEO metadata that isn't there, and the other mistakes that are easy to ship and embarrassing to find in production.

It runs on your machine or in CI. Your code never leaves it, and you don't need an account.

## Install

Pick whichever fits your machine:

```bash
# Homebrew
brew install preflightsh/preflight/preflight

# npm
npm install -g @preflightsh/preflight

# Go
go install github.com/preflightsh/preflight@latest

# Docker
docker pull ghcr.io/preflightsh/preflight

# curl
curl -fsSL https://preflight.sh/install.sh | sh
```

Or download a binary for your platform from [GitHub Releases](https://github.com/preflightsh/preflight/releases). Each archive carries signed build provenance, so you can check that a download was built by the project's release workflow:

```bash
gh attestation verify preflight_<version>_<os>_<arch>.tar.gz --repo preflightsh/preflight
```

## Set up a project

Run `preflight init` in your project's root. It detects your stack and the services you use, asks for your staging and production URLs, and writes what it learned to `preflight.yml`.

```bash
cd your-project
preflight init
```

`init` asks questions, so it needs a terminal. In a script or a CI job, pass `--yes` to accept the detected defaults; without it, `init` stops and writes nothing when its input ends before the questions do. It asks before replacing an existing `preflight.yml`, and `--force` skips that question.

Commit `preflight.yml`. Everyone on the project, and your CI, then scans with the same settings. [Configuration](https://preflight.sh/docs/configuration/) covers every key in it.

## Run a scan

```bash
preflight scan
```

Each check prints one line: `✓ OK`, `⚠ WARN`, or `✗ FAIL`, followed by what it found and how to fix it. A check with nothing to verify, such as a network check with no URL, is counted as skipped, never as passed. The last line says whether the project is ready to launch. A scan that finds only warnings exits `1`, and one that finds an error exits `2`, so a CI step fails exactly when it should. [Scanning](https://preflight.sh/docs/scanning/) has every flag and exit code.

## Where next

- [Checks](https://preflight.sh/docs/checks/): what each check looks for, and its ID.
- [Ignoring checks](https://preflight.sh/docs/ignoring/): silence a check that doesn't apply, or allow one known secret.
- [CI](https://preflight.sh/docs/ci/): run Preflight on every pull request.
- [Agent skill](https://preflight.sh/docs/agent-skill/): let your coding agent run scans and fix what they find.
- [Dashboard](https://preflight.sh/docs/dashboard/): keep a history of runs and get AI fix suggestions.

## Questions and false positives

Preflight tries hard to be right, but a check can misread an unusual project. If one does, or you have a question, [write to us](https://preflight.sh/contact/) or [open an issue on GitHub](https://github.com/preflightsh/preflight/issues).
