---
title: 'CLI'
description: 'The huli command-line interface — install, authenticate, and work against the Public FHIR R4 + R5 API.'
nav: 'CLI'
order: 0
version: v1
source: generated
updated: '2026-09-23'
---

# Huli CLI

The `huli` CLI wraps the Public FHIR API (both R4 and R5) — authentication, pagination, and output formatting from the command line.

## Install

```bash
brew install hulilabs/tools/huli-cli
```

The installed binary is named `huli`. Confirm it runs:

```bash
huli version
```

## Command groups

```
huli [command]

Available Commands:
  fhir        FHIR resource operations (patient, appointment, encounter, observation, …)
  auth        Authentication and token management
  config      Manage CLI configuration and profiles
  version     Print the CLI version

Flags:
  --help            Help for any command
  --profile         Config profile to use (default: "default")
  --output          Output format: json | table | yaml (default: "table")
  --fhir-version    FHIR release to target: r4 | r5 (default: "r4")
```

## FHIR version (R4 / R5)

Every `huli fhir` command works against both FHIR releases. Select the release with the global `--fhir-version` flag (default `r4`); the CLI routes requests to `/fhir/R4` or `/fhir/R5` accordingly:

```bash
# Default — FHIR R4
huli fhir patient get <id>

# Target FHIR R5 (e.g. for recurring appointments)
huli fhir appointment get <id> --fhir-version r5
```

Auth, scopes, and pagination are identical across releases. See [Choosing R4 vs R5](/v1/api/fhir-versions) for which to pick.

Authenticate next — see [Auth](/v1/auth) for bearer tokens, SMART Backend Services, and interactive OAuth.
