Crate hugr_cli

Source
Expand description

Standard command line tools for the HUGR format.

This library provides utilities for the HUGR CLI.

§CLI Usage

Run cargo install hugr-cli to install the CLI tools. This will make the hugr executable available in your shell as long as you have cargo’s bin directory in your path.

The CLI provides two subcommands:

  • validate for validating HUGR files.
  • mermaid for visualizing HUGR files as mermaid diagrams.

§Validate

Validate and visualize a HUGR file

Usage: hugr validate [OPTIONS] [INPUT]

Options:
  -v, --verbose...  Increase logging verbosity
  -q, --quiet...    Decrease logging verbosity
  -h, --help        Print help (see more with '--help')
  -V, --version     Print version

Input:
      --no-std                   Don't use standard extensions when validating hugrs. Prelude is still used.
  -e, --extensions <EXTENSIONS>  Paths to serialised extensions to validate against.
      --hugr-json                Read the input as a HUGR JSON file instead of an envelope
  [INPUT]                    Input file. Defaults to `-` for stdin

§Mermaid

Write HUGR as mermaid diagrams

Usage: hugr mermaid [OPTIONS] [INPUT]

Options:
      --validate         Validate before rendering, includes extension inference.
  -o, --output <OUTPUT>  Output file '-' for stdout [default: -]
  -v, --verbose...       Increase logging verbosity
  -q, --quiet...         Decrease logging verbosity
  -h, --help             Print help (see more with '--help')
  -V, --version          Print version

Input:
      --no-std                   Don't use standard extensions when validating hugrs. Prelude is still used.
  -e, --extensions <EXTENSIONS>  Paths to serialised extensions to validate against.
      --hugr-json                Read the input as a HUGR JSON file instead of an envelope
  [INPUT]                    Input file. Defaults to `-` for stdin.

Modules§

extensions
Dump standard extensions in serialized form.
hugr_io
Input/output arguments for the HUGR CLI.
mermaid
Render mermaid diagrams.
validate
The validate subcommand.

Structs§

OtherArgs
Other arguments affecting the HUGR CLI runtime.

Enums§

CliArgs
CLI arguments.
CliError
Error type for the CLI.