gqls-cli 0.3.2

Fuzzy and semantic search over a GraphQL schema (SDL, introspection JSON, or a live endpoint), plus a field-to-resolver jump.
Documentation
[package]
name = "gqls-cli"  # crates.io name (`gqls` is taken); the binary is still `gqls`
version = "0.3.2"
edition = "2021"
rust-version = "1.82"  # `Option::is_none_or`
description = "Fuzzy and semantic search over a GraphQL schema (SDL, introspection JSON, or a live endpoint), plus a field-to-resolver jump."
license = "MIT"
repository = "https://github.com/dpep/gqls"
homepage = "https://github.com/dpep/gqls"
documentation = "https://github.com/dpep/gqls"
readme = "README.md"
keywords = ["graphql", "schema", "search", "cli"]
categories = ["command-line-utilities"]

# Keep the lib named `gqls` even though the crate publishes as `gqls-cli`, so
# `main.rs` (and any dependent) still says `gqls::…`.
[lib]
name = "gqls"

[[bin]]
name = "gqls"
path = "src/main.rs"

[dependencies]
clap = { version = "4", features = ["derive"] }
clap_complete = "4"
graphql-parser = "0.4"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
anyhow = "1"
ureq = { version = "2", features = ["json"] }  # URL introspection

# Semantic search (opt-in via the `semantic` feature): local all-MiniLM-L6-v2
# through ONNX Runtime, borrowed from ae (~/code/lib/rust/ae) with the same
# pins so the copied onnx.rs matches the ort API. `semantic` statically
# downloads ORT at build time; the model is fetched from the HuggingFace Hub
# on first run, then cached offline (falls back to a hash embedder if it can't).
ort = { version = "=2.0.0-rc.12", default-features = false, optional = true }
tokenizers = { version = "0.23", default-features = false, features = ["fancy-regex"], optional = true }
hf-hub = { version = "0.5", default-features = false, features = ["ureq"], optional = true }
log = { version = "0.4", optional = true }
rayon = { version = "1", optional = true }  # parallel cold embed pass

[features]
# Semantic search is on by default so `cargo install gqls-cli` includes it
# (downloads ONNX Runtime at build time). Opt out with `--no-default-features`
# for a lean fuzzy-only build; Homebrew uses `semantic-dynamic` instead.
default = ["semantic"]

# Internal: the semantic embedding code + deps, minus the ORT linking strategy.
# Not selected directly — pick `semantic` or `semantic-dynamic` below.
_semantic = [
  "dep:ort", "dep:tokenizers", "dep:hf-hub", "dep:log", "dep:rayon",
  "ort/std", "ort/ndarray", "ort/tracing", "ort/api-24",
]
# Semantic search with ONNX Runtime downloaded + statically linked at build
# time — the convenient default: `cargo install gqls-cli --features semantic`.
semantic = ["_semantic", "ort/download-binaries", "ort/tls-native", "ort/copy-dylibs"]
# Semantic search with ONNX Runtime dlopen'd from a system install at runtime:
# smaller binary, no build-time download. Used by the Homebrew formula, which
# `depends_on "onnxruntime"` (the same keg `ae` uses).
semantic-dynamic = ["_semantic", "ort/load-dynamic"]

[profile.release]
strip = true
lto = true
codegen-units = 1