# CLI Helpers

Shared command-line parsing and prompting for the name forge workspace. The crate builds a `GeneratorConfig` from CLI flags with interactive fallbacks so the binary stays lean.

## Usage

```rust,ignore
use name_cli::{build_config, parse_args};
use name_forge::{NameGenerator, NameStatus};

#[tokio::main]
async fn main() -> eyre::Result<()> {
    let args = parse_args();
    let config = build_config(args)?;

    let generator =
        NameGenerator::new(name_crates_io_client::CratesClient::new("https://crates.io"));
    let results = generator.generate(&config).await?;

    let available: Vec<_> =
        results.into_iter().filter(|res| matches!(res.status, NameStatus::Available)).collect();
    println!("available: {available:?}");

    Ok(())
}
```

## Flags

- `--min-len <N>` / `--max-len <N>` set the inclusive length bounds.
- `--limit <N>` caps how many available results are printed (defaults to 10); use `--no-limit` to disable.
- `--parallel` toggles bounded parallel checks while keeping deterministic ordering.
- Random order is the default; add `--alphabetical` to scan in deterministic lexicographic order.
- `--dictionary <path>` points at an alternate newline-delimited dictionary file; otherwise the combined embedded words and names are used.
- `--names-only` / `--words-only` restrict embedded data to one subset.

## API

- `CliArgs::parse()` returns parsed flags via `clap`.
- `build_config(args: CliArgs) -> GeneratorConfig` merges flags with prompts to produce a ready configuration for `NameGenerator`.
