diff --git a/hugr-cli/Cargo.toml b/hugr-cli/Cargo.toml
index 49927c72b..1bded9844 100644
--- a/hugr-cli/Cargo.toml
+++ b/hugr-cli/Cargo.toml
@@ -29,3 +29,7 @@ assert_cmd = { workspace = true }
assert_fs = { workspace = true }
predicates = { workspace = true }
rstest.workspace = true
+
+[[bin]]
+name = "hugr"
+path = "src/main.rs"
diff --git a/hugr-cli/README.md b/hugr-cli/README.md
index 1c08dcac8..f096f746a 100644
--- a/hugr-cli/README.md
+++ b/hugr-cli/README.md
@@ -8,12 +8,40 @@ hugr-cli
[![msrv][]](https://github.com/CQCL/hugr)
[![codecov][]](https://codecov.io/gh/CQCL/hugr)
-This crate provides tooling used by the `hugr` CLI tool.
-Refer to the [main crate](http://crates.io/crates/hugr) for more information.
+`hugr` CLI tool for common tasks on serialised HUGR (e.g. validation,
+visualisation).
+
+Refer to the [main HUGR crate](http://crates.io/crates/hugr) for more information.
## Usage
-Add the dependency to your project:
+Install using `cargo`:
+
+```bash
+cargo install hugr-cli
+```
+
+This will install the `hugr` binary. Running `hugr --help` shows:
+
+```
+Validate a HUGR.
+
+Usage: hugr [OPTIONS]
+
+Arguments:
+
+
+Options:
+ -m, --mermaid Visualise with mermaid.
+ -n, --no-validate Skip validation.
+ -v, --verbose... Increase logging verbosity
+ -q, --quiet... Decrease logging verbosity
+ -h, --help Print help
+ -V, --version Print version
+```
+
+
+To extend the CLI you can also add the project as a library dependency:
```bash
cargo add hugr-cli
diff --git a/hugr-cli/src/lib.rs b/hugr-cli/src/lib.rs
index 07982b589..d7f41d695 100644
--- a/hugr-cli/src/lib.rs
+++ b/hugr-cli/src/lib.rs
@@ -1,10 +1,10 @@
//! Standard command line tools, used by the hugr binary.
+use clap::Parser;
use clap_stdin::FileOrStdin;
+use clap_verbosity_flag::Level;
use clap_verbosity_flag::{InfoLevel, Verbosity};
use thiserror::Error;
-/// We reexport some clap types that are used in the public API.
-pub use {clap::Parser, clap_verbosity_flag::Level};
use hugr_core::{extension::ExtensionRegistry, Hugr, HugrView};
diff --git a/hugr/src/main.rs b/hugr-cli/src/main.rs
similarity index 78%
rename from hugr/src/main.rs
rename to hugr-cli/src/main.rs
index 2febb3baf..07b953ed1 100644
--- a/hugr/src/main.rs
+++ b/hugr-cli/src/main.rs
@@ -1,15 +1,18 @@
//! Validate serialized HUGR on the command line
-use hugr::std_extensions::arithmetic::{
+use hugr_core::std_extensions::arithmetic::{
conversions::EXTENSION as CONVERSIONS_EXTENSION, float_ops::EXTENSION as FLOAT_OPS_EXTENSION,
float_types::EXTENSION as FLOAT_TYPES_EXTENSION, int_ops::EXTENSION as INT_OPS_EXTENSION,
int_types::EXTENSION as INT_TYPES_EXTENSION,
};
-use hugr::std_extensions::logic::EXTENSION as LOGICS_EXTENSION;
+use hugr_core::std_extensions::logic::EXTENSION as LOGICS_EXTENSION;
-use hugr::extension::{ExtensionRegistry, PRELUDE};
+use hugr_core::extension::{ExtensionRegistry, PRELUDE};
-use hugr_cli::{CmdLineArgs, Level, Parser};
+use hugr_cli::CmdLineArgs;
+
+use clap::Parser;
+use clap_verbosity_flag::Level;
fn main() {
let opts = CmdLineArgs::parse();
diff --git a/hugr/tests/cli.rs b/hugr-cli/tests/cli.rs
similarity index 97%
rename from hugr/tests/cli.rs
rename to hugr-cli/tests/cli.rs
index 1df2199a8..beb1e19f2 100644
--- a/hugr/tests/cli.rs
+++ b/hugr-cli/tests/cli.rs
@@ -1,4 +1,3 @@
-#![cfg(feature = "_cli")]
use assert_cmd::Command;
use assert_fs::{fixture::FileWriteStr, NamedTempFile};
use hugr_cli::VALID_PRINT;
@@ -15,7 +14,7 @@ use rstest::{fixture, rstest};
#[fixture]
fn cmd() -> Command {
- Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap()
+ Command::cargo_bin("hugr").unwrap()
}
#[fixture]
diff --git a/hugr/Cargo.toml b/hugr/Cargo.toml
index cf765186f..19049eafc 100644
--- a/hugr/Cargo.toml
+++ b/hugr/Cargo.toml
@@ -24,28 +24,16 @@ path = "src/lib.rs"
[features]
extension_inference = []
-# Definitions used by the `hugr` binary
-_cli = ["dep:hugr-cli"]
-
[dependencies]
hugr-core = { path = "../hugr-core", version = "0.1.0" }
hugr-passes = { path = "../hugr-passes", version = "0.1.0" }
-hugr-cli = { path = "../hugr-cli", version = "0.1.0", optional = true }
[dev-dependencies]
rstest = { workspace = true }
lazy_static = { workspace = true }
criterion = { workspace = true, features = ["html_reports"] }
serde_json = { workspace = true }
-assert_cmd = { workspace = true }
-assert_fs = { workspace = true }
-predicates = { workspace = true }
[[bench]]
name = "bench_main"
harness = false
-
-
-[[bin]]
-name = "hugr"
-required-features = ["_cli"]