[package]
name = "shuflr-cli"
description = "Command-line interface for shuflr (produces the `shuflr` binary)"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation = "https://docs.rs/shuflr-cli"
readme = "README.md"
keywords = ["jsonl", "shuffle", "streaming", "training-data", "cli"]
categories = ["command-line-utilities", "data-structures"]

[lints]
workspace = true

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

[features]
default = ["zstd", "gzip"]
grpc = ["shuflr/grpc", "dep:tokio"]
prom = ["shuflr/prom"]
otlp = ["shuflr/otlp"]
uring = ["shuflr/uring"]
zstd = ["shuflr/zstd"]
gzip = ["shuflr/gzip"]
bzip2 = ["shuflr/bzip2"]
xz = ["shuflr/xz"]
# Parquet + HF Hub input for `shuflr convert`.
parquet = ["shuflr/parquet"]
# Canonical build presets. `serve` enables the HTTP transport
# (005 §2.1). Additional transports: `grpc` adds gRPC (PR-35), etc.
serve = ["shuflr/serve", "dep:tokio"]
full = ["serve", "grpc", "prom", "otlp", "uring", "zstd", "gzip", "bzip2", "xz", "parquet"]

[dependencies]
shuflr = { path = "../shuflr", version = "0.1" }
anyhow = "1"
clap = { version = "4", features = ["derive", "env", "wrap_help", "color"] }
clap_complete = "4"
clap_mangen = "0.2"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
indicatif = "0.17"
memchr = "2"
# Only pulled in when `serve` (or `grpc`) is enabled; otherwise the
# binary has no async runtime.
tokio = { version = "1", optional = true, features = ["rt-multi-thread", "macros", "signal"] }

[dev-dependencies]
assert_cmd = "2"
predicates = "3"
tempfile = "3"
flate2 = "1"
zstd = "0.13"
# Blocking HTTP client for serve tests. `tls-rustls-no-provider` =
# rustls with BYO crypto provider (we install ring at test startup).
ureq = { version = "2", default-features = false, features = ["json", "tls"] }
rustls = { version = "0.23", default-features = false, features = ["std", "tls12", "ring"] }
rcgen = "0.13"
# Used by the `serve_wire` integration tests to drive the wire codec
# over tokio TCP; the main CLI brings tokio in via --features serve.
shuflr-wire = { path = "../shuflr-wire", version = "0.1" }
tokio = { version = "1", features = ["rt-multi-thread", "net", "io-util", "macros"] }
# Raw-frame replay in tests: decompress zstd, reseed ChaCha20, Fisher-
# Yates — same pieces the Python client uses, checked independently
# on the Rust side.
memchr = "2"
rand = { version = "0.8", default-features = false, features = ["std", "std_rng"] }
rand_chacha = "0.3"
