hen 0.20.2

Run protocol-aware API request collections from the command line or through MCP.
Documentation
---
sidebar_position: 2
title: CLI Reference
description: Formal reference for `hen`, `hen run`, `hen verify`, `hen inspect`, and `hen import`.
---

This page covers the command forms, arguments, and options exposed by the Hen CLI.

## Top-level command

```bash
hen [OPTIONS] [PATH] [SELECTOR]
hen run [OPTIONS] [PATH] [SELECTOR]
hen verify [OPTIONS] <PATH>
hen inspect [OPTIONS] <PATH>
hen import <SPEC_PATH> [SELECTOR] --output <OUTPUT_PATH>
```

The default `hen [PATH] [SELECTOR]` form behaves like `hen run [PATH] [SELECTOR]`.

## Common arguments

| Argument | Meaning |
| --- | --- |
| `PATH` | path to a `.hen` collection or a directory containing one |
| `SELECTOR` | request index or `all` |

## `hen import`

Use `hen import` to lower an OpenAPI 3.0.x or 3.1.x JSON or YAML spec into an editable `.hen` collection.

Supported schema lowering in this slice includes plain component aliases, object-shaped `allOf`, named `oneOf(...)` and `anyOf(...)` unions, scalar `const(...)` tags, and `discriminator(...)` unions when the source OpenAPI shape is representable in Hen.

### Arguments

| Argument | Meaning |
| --- | --- |
| `SPEC_PATH` | path to an OpenAPI JSON or YAML document |
| `SELECTOR` | optional operation selector: `all`, index, `operationId`, `METHOD /path`, or `tag:name` |

### Options

| Option | Meaning |
| --- | --- |
| `--output <OUTPUT_PATH>` | destination `.hen` file to write |

### Example

```bash
hen import ./examples/openapi_import.yaml --output ./examples/openapi_imported.hen
```

## `hen run`

Use `hen run` to execute a collection or a single request.

### Options

| Option | Meaning |
| --- | --- |
| `--env <ENV>` | select a named collection environment |
| `--input key=value` | provide a prompt value up front |
| `--non-interactive` | fail instead of prompting for collection or request selection |
| `--output <FORMAT>` | render output as `text`, `json`, `ndjson`, or `junit` |
| `--body <MODE>` | show response bodies in text output for `none`, `selected`, `failed`, or `all` requests |
| `--parallel` | execute independent requests concurrently |
| `--max-concurrency <N>` | limit concurrency when running with `--parallel` |
| `--continue-on-error` | keep unaffected dependency branches running after a failure |
| `--benchmark <N>` | benchmark a request instead of running it once |
| `--export` | render the selected request as a curl command |
| `--verbose`, `-v` | include more detail in text output and enable debug logging |

### Examples

```bash
hen run ./examples/lorem.hen 0
hen run ./examples/lorem.hen all --non-interactive --output json
hen run ./examples/environment_overrides.hen 0 --env local --input client_id=demo
```

## `hen verify`

Use `hen verify` to parse and validate a collection without executing shell substitutions or HTTP
requests.

### Options

| Option | Meaning |
| --- | --- |
| `--output <FORMAT>` | render output as `text`, `json`, `ndjson`, or `junit` |

### Example

```bash
hen verify ./examples/lorem.hen
```

## `hen inspect`

Use `hen inspect` when tooling needs collection summaries, declarations, symbols, request metadata,
and required inputs without executing the collection.

### Options

| Option | Meaning |
| --- | --- |
| `--output <FORMAT>` | render output as `text`, `json`, or `ndjson` |

### Example

```bash
hen inspect ./examples/lorem.hen --output json
```

## Output formats

| Format | Supported by |
| --- | --- |
| `text` | `run`, `verify`, `inspect` |
| `json` | `run`, `verify`, `inspect` |
| `ndjson` | `run`, `verify`, `inspect` |
| `junit` | `run`, `verify` |