Skip to content

feature: expand the CLI's commands, UX and packaging (#1) - #2

Merged
Kinflou merged 2 commits into
mainfrom
feature/issue-1-cli
Aug 28, 2026
Merged

Kinflou merged 2 commits into
mainfrom
feature/issue-1-cli

Conversation

@Kinflou

@Kinflou Kinflou commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Works through the checklist in #1.

Structure

The single-file binary becomes a module per concern:

file role
src/cli.rs (was commands.rs) full clap tree; dependency-light so build.rs shares it
src/ui.rs colored status on stderr via anstream/anstyle, decoupled from tracing; honours --quiet / NO_COLOR; indicatif spinner
src/changes.rs schema-change renderer shared by build and diff
src/error.rs CliError + stable exit codes (0 ok / 1 failure / 2 precondition)
src/watch.rs shared --watch loop (notify-debouncer-mini)
src/commands/* one handler per subcommand
build.rs generates man pages (clap_mangen) + 5-shell completions into OUT_DIR
src/main.rs thin dispatcher returning ExitCode; SIGPIPE reset

Commands

  • diff <old> <new> — walks the CAS commit chain and reuses
    analyze_schema_changes; args are a version, a commit hash, or HEAD
  • clean [--dry-run] — removes .comline/ and generated files
  • check — real validate-only path via
    comline_core::package::build::compile_package (no CAS writes, no version
    bump); depends on feature: compile_package() — validate a package without CAS writes core#21 (merged)
  • generate --target <lang> — select one configured generator
  • new — richer scaffold (src/main.ids, .gitignore, code_generation
    block) + --git; the congregation name is derived from the project name so
    comline new my-api scaffolds a config that parses
  • completions <shell>

UX

-q/--quiet, --watch for build and generate, progress spinner, stable
CI exit codes, and a long_about with examples on every subcommand.

Packaging & docs

  • Cargo.toml metadata fixed (repository, description, keywords,
    categories); tokio dropped; comline-core pinned to the merged
    compile_package() commit
  • README.md rewritten; docs/cli.md added as the full guide (commands,
    versioning model, output/exit codes, watch mode, packaging)
  • CI gains a fmt + clippy -D warnings job

Tests

tests/cli_tests.rs rewritten for the new stderr / exit-code contract, 6 → 17.
cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test
all green.

Restructures the single-file binary into a module per concern and works
through the checklist in #1.

Structure
- src/cli.rs (was commands.rs): full clap tree, self-contained so build.rs
  can share it
- src/ui.rs: colored status output on stderr via anstream/anstyle, decoupled
  from the tracing layer; honours --quiet and NO_COLOR; indicatif spinner
- src/changes.rs: schema-change renderer shared by build and diff
- src/error.rs: CliError + stable exit codes (0 ok / 1 failure / 2 precondition)
- src/watch.rs: shared --watch loop (notify-debouncer-mini)
- src/commands/*: one handler per subcommand
- build.rs: generates man pages (clap_mangen) and 5-shell completions into OUT_DIR
- main.rs: thin dispatcher returning ExitCode; SIGPIPE reset

Commands
- diff <old> <new>: walk the CAS commit chain, reuse analyze_schema_changes
- clean [--dry-run]: remove .comline/ and generated files
- check: real validate-only path via comline_core::package::build::compile_package
  (no CAS writes, no version bump)
- generate --target <lang>: select one configured generator
- new: richer scaffold (src/main.ids, .gitignore, code_generation block) + --git
- completions <shell>

UX
- -q/--quiet, --watch for build and generate, progress spinner, stable exit codes,
  every subcommand gets a long_about with examples

Packaging & docs
- Cargo.toml metadata fixed (repository, description, keywords, categories);
  tokio dropped; comline-core pinned to the merged compile_package() commit
- README rewritten; CI gains a fmt + clippy -D warnings job

Tests: cli_tests.rs rewritten for the new stderr/exit-code contract, 6 -> 16.
@Kinflou
Kinflou force-pushed the feature/issue-1-cli branch from ceeb5ce to 76b8049 Compare August 28, 2026 04:27
@Kinflou Kinflou changed the title feature: fill out the CLI toward 1.0 (#1) feature: expand the CLI's commands, UX and packaging (#1) Aug 28, 2026
@Kinflou Kinflou mentioned this pull request Aug 28, 2026
4 tasks
- docs/cli.md: full CLI guide (commands, versioning model, output/exit
  codes, watch mode, packaging); README links to it
- new: derive the `congregation` name from the project name by reducing it
  to a valid Comline identifier (letters/digits/`_`), so `comline new
  my-api` produces a config.idp that parses (dir stays `my-api`, package
  becomes `my_api`, with a note). Adds a test.
- cli: fix the `--verbose` help text to match main.rs (-v info, -vv debug,
  -vvv trace)
@Kinflou
Kinflou merged commit 552127c into main Aug 28, 2026
2 checks passed
@Kinflou
Kinflou deleted the feature/issue-1-cli branch August 28, 2026 05: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.

1 participant