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

# CLI Quickstart

> Install the free CLI, generate and validate your first HL7 message, and wire the exit codes into CI. No account required.

The CLI is one binary that generates, validates, and de-identifies test messages from a terminal. It follows the Unix convention (`0` success, non-zero failure), so every command below drops into a CI pipeline as-is.

> [!NOTE]
>
> The free CLI (the community NuGet build) ships 12 commands: `generate`, `validate`, `deident`, `data`, `artifacts`, `lookup`, `find`, `path`, `run`, `session`, `completions`, and `capabilities`. `conform`, `flock`, `loft`, `migrate`, `ai`, `diff`, and `config` are delivered through the desktop apps. If you run only `dotnet tool install` and then type `pidgeon conform`, it won't be there; run those from the CLI bundled with the desktop apps, or from the matching app panel.

## Prerequisites

* [.NET 8 runtime or SDK](https://dotnet.microsoft.com/download/dotnet/8.0) for the `dotnet tool` install below
* The public NuGet package is the cross-platform beta install path. The current GitHub release also includes a signed Windows ZIP.

**1. Install the CLI**

```bash theme={null}
dotnet tool install --global Pidgeon.CLI --version 0.1.0-beta.2
```

Verify the installation:

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

**2. Generate your first message**

Generate a synthetic HL7 ADT admission message:

```bash theme={null}
pidgeon generate ADT^A01
```

Example output:

```
MSH|^~\&|PIDGEON|FACILITY|RECEIVING|DEST|20260222143021||ADT^A01|MSG00001|P|2.3
EVN|A01|20260222143021
PID|1||PAT98234^^^MRN||JOHNSON^MARIA^A||19870415|F||2106-3|123 OAK AVE^^AUSTIN^TX^78701
PV1|1|I|ER^101^A|||||||ER||||||A0||V0001^^^VISIT
DG1|1||J18.9^Pneumonia, unspecified organism^I10||20260222|A
```

The standard is inferred from the message type: `ADT^A01` is HL7 v2, `Patient` is FHIR R4. Generate multiple messages to a folder:

```bash theme={null}
pidgeon generate ADT^A01 --count 10 --output ./test-data/
```

**3. Validate a message**

```bash theme={null}
pidgeon validate --file ./test-data/msg_001.hl7 --mode strict
```

Example output:

```text theme={null}
Validating msg_001.hl7 with Strict mode...
Validation passed!
Warnings: 1
  HL7-REQ-002: Field EVN.1 (Event Type Code) is empty
    Location: EVN.1
    Tip:      pidgeon lookup EVN.1

Summary: 42 fields checked, 42 of 42 rules passed (100.0% conformance) in 2ms
```

Each issue includes expected/actual values, a fix suggestion, and a `pidgeon lookup` tip that opens the built-in standards reference. `--mode strict` checks against the published spec; `--mode compatibility` tolerates common real-world deviations.

**4. De-identify real messages**

If you have real messages to work with, de-identify them first:

```bash theme={null}
pidgeon deident --in ./real-messages --out ./safe-messages --date-shift 30d
```

All processing happens on your machine; nothing is uploaded.

**5. Discover the rest**

Help is built in at every level:

```bash theme={null}
pidgeon help
pidgeon help generate
pidgeon validate --help
```

## Running a conformance check

`pidgeon conform` probes a live FHIR endpoint against a published Implementation Guide (US Core and Da Vinci PAS 2.1 today) and returns a pass/fail with a non-zero CI exit code. It's delivered through the desktop apps, not the free `dotnet tool` package, so run it from the CLI bundled with an app or from Post's Conformance panel. See [Get started with Conform](https://docs.pidgeon.health/getting-started/conform.md).

## Exit codes

The free CLI emits exactly two exit codes, suitable for CI gates and shell scripting:

| Code | Meaning | Examples |
| - | - | - |
| `0` | Success | Message generated; validation passed |
| `1` | Failure | Validation issues found in strict mode; missing required argument; unknown command |

A minimal CI gate:

```bash theme={null}
pidgeon validate --folder ./messages --mode strict || exit 1
```

## Next steps

* Explore the full [CLI Reference](https://docs.pidgeon.health/cli/global-options.md)
* Try [FHIR and NCPDP generation](https://docs.pidgeon.health/post/message-generation.md)
* [Get started with Post](https://docs.pidgeon.health/getting-started/post.md) for the desktop experience


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.