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

# Getting Started

> Get started with the `pcb` CLI

Use this guide to install `pcb`, create a board repository, validate its Zener
source, and generate a KiCad layout.

## Requirements

* macOS or Linux. Windows support is experimental; use WSL2 for the most
  stable Windows environment.
* Git, which `pcb new board` uses to initialize a repository.
* KiCad 10.x for layout generation and editing. `pcb build` does not require
  KiCad.

## 1. Install `pcb`

The `pcb` launcher downloads and runs the `pcbc` toolchain selected by each
project. Run the installer for your platform:

<CodeGroup>
  ```bash bash theme={null}
  curl -fsSL https://raw.githubusercontent.com/diodeinc/pcb/main/install.sh | bash
  ```

  ```powershell powershell theme={null}
  powershell -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/diodeinc/pcb/main/install.ps1 | iex"
  ```
</CodeGroup>

The installer adds `pcb` to your user `PATH` when necessary. Restart the shell
if the command is not available, then verify the installation:

```bash theme={null}
pcb --version
```

<Accordion title="Install from source">
  Install Rust, then clone the [repository](https://github.com/diodeinc/pcb) and
  run the local installer:

  ```bash theme={null}
  git clone https://github.com/diodeinc/pcb
  cd pcb
  ./install.sh --local
  ```
</Accordion>

## 2. Create a board repository

Replace the example repository URL with the project repository URL:

```bash theme={null}
pcb new board Blinky github.com/your-org/blinky
cd Blinky
```

`pcb new board` creates `pcb.toml`, `Blinky.zen`, and a Git repository. The
generated design is empty but valid.

## 3. Build the board

Validate the board source and generate its netlist:

```bash theme={null}
pcb build Blinky.zen
```

A successful build exits without validation errors.

## 4. Generate the layout

Generate the KiCad files without opening KiCad:

```bash theme={null}
pcb layout --no-open Blinky.zen
```

This command writes the generated board under `layout/`.

## Troubleshooting

* If the shell cannot find `pcb` after installation, restart the shell or
  source the environment file printed by the installer.
* If `pcb layout` cannot find KiCad, install `kicad-cli` and `pcbnew`. Set
  `KICAD_CLI` or `KICAD_PCBNEW` if either executable is outside its default
  platform path.
* Run `pcb help` or `pcb help <command>` for the complete CLI reference.
