Skip to content

fix(cli): resolve common UX papercuts in the CLI - #38

Open
usehoplite[bot] wants to merge 2 commits into
mainfrom
hoplite/samothrake-e8dc9fcf
Open

fix(cli): resolve common UX papercuts in the CLI#38
usehoplite[bot] wants to merge 2 commits into
mainfrom
hoplite/samothrake-e8dc9fcf

Conversation

@usehoplite

@usehoplite usehoplite Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Audited the main CLI user flows (init, ingest, synthesize, export, validate, status, jobs, config) for common UX papercuts and fixed the highest-impact, verifiable ones. All fixes are small and CLI-scoped.

What changed

  • distill-align init now works without the run subcommand. The README and CLI reference document distill-align init (with --path/--name), but the bare command previously exited with code 2 and printed nothing. init run is preserved for compatibility.
  • The documented global --config flag is now honored. It was silently ignored (config was always auto-discovered); a missing explicit file now errors cleanly.
  • Invalid --mode (synthesize) and --status (jobs list) values now produce a helpful message listing valid choices instead of a raw ValueError traceback.
  • export --format preference no longer crashes. The README quick start documents this command, but preference was missing from the ExportConfig format literal, so it died with a Pydantic ValidationError. Unknown formats now get a clean error listing supported formats.
  • Non-array JSON inputs to synthesize/export/validate are rejected with a clear message instead of a TypeError; empty inputs emit a warning.
  • ingest fails loudly on empty input (empty dir or no supported files) instead of silently writing an empty chunks.json that poisons the downstream pipeline.
  • status reports provider keys for all documented providers (Anthropic, Gemini, Azure, generic DISTILL_) instead of only OpenAI — previously it said "Not set" even when ANTHROPIC_API_KEY was configured.
  • config show reports unparseable config files gracefully instead of a raw traceback.
  • Fixed an invalid tab character in the generated config template that made every distill-align init config unparseable YAML (the initconfig show flow was broken end-to-end).

Verification

  • 11 new regression tests in tests/unit/test_cli.py covering each fix.
  • Full suite: 201 passed, 8 skipped (unit + integration + property).
  • ruff check and ruff format --check clean on all changed files; mypy clean on src/distill_align/cli/main.py.
  • Manually smoke-tested the previously-broken initconfig show flow and the --config flag.

Open in Hoplite

@usehoplite
usehoplite Bot marked this pull request as ready for review September 2, 2026 21:23
@usehoplite
usehoplite Bot force-pushed the hoplite/samothrake-e8dc9fcf branch from 3051f05 to e745f9c Compare September 2, 2026 21:58
usehoplite Bot and others added 2 commits September 3, 2026 01:08
- `distill-align init` now works without the `run` subcommand, matching the
  README and CLI reference; `init run` is preserved for compatibility
- honor the documented global `--config` flag (was silently ignored) and
  error cleanly when the file is missing
- reject invalid `--mode` (synthesize) and `--status` (jobs list) values with
  a helpful message listing valid choices instead of a raw traceback
- `export --format preference` (documented in the README) no longer crashes;
  unknown formats get a clean error listing supported formats
- reject non-array JSON inputs to synthesize/export/validate with a clear
  message instead of a TypeError
- `ingest` fails loudly on empty input instead of silently writing an empty
  chunks.json
- `status` now reports provider keys for all documented providers (Anthropic,
  Gemini, Azure, generic) instead of only OpenAI
- `config show` reports unparseable config files gracefully
- fix invalid tab character in the generated config template that made every
  `distill-align init` config unparseable YAML

Adds 11 regression tests covering each fix.

Co-authored-by: Omar <omr.omr163@gmail.com>
Co-authored-by: Omar <omr.omr163@gmail.com>
@usehoplite
usehoplite Bot force-pushed the hoplite/samothrake-e8dc9fcf branch from e745f9c to 568404e Compare September 3, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants