Repository navigation
feature: expand the CLI's commands, UX and packaging (#1) - #2
Merged
Merged
Conversation
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
force-pushed
the
feature/issue-1-cli
branch
from
August 28, 2026 04:27
ceeb5ce to
76b8049
Compare
- 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Works through the checklist in #1.
Structure
The single-file binary becomes a module per concern:
src/cli.rs(wascommands.rs)claptree; dependency-light sobuild.rsshares itsrc/ui.rsanstream/anstyle, decoupled fromtracing; honours--quiet/NO_COLOR;indicatifspinnersrc/changes.rsbuildanddiffsrc/error.rsCliError+ stable exit codes (0ok /1failure /2precondition)src/watch.rs--watchloop (notify-debouncer-mini)src/commands/*build.rsclap_mangen) + 5-shell completions intoOUT_DIRsrc/main.rsExitCode; SIGPIPE resetCommands
diff <old> <new>— walks the CAS commit chain and reusesanalyze_schema_changes; args are a version, a commit hash, orHEADclean [--dry-run]— removes.comline/and generated filescheck— real validate-only path viacomline_core::package::build::compile_package(no CAS writes, no versionbump); depends on feature: compile_package() — validate a package without CAS writes core#21 (merged)
generate --target <lang>— select one configured generatornew— richer scaffold (src/main.ids,.gitignore,code_generationblock) +
--git; thecongregationname is derived from the project name socomline new my-apiscaffolds a config that parsescompletions <shell>UX
-q/--quiet,--watchforbuildandgenerate, progress spinner, stableCI exit codes, and a
long_aboutwith examples on every subcommand.Packaging & docs
Cargo.tomlmetadata fixed (repository,description,keywords,categories);tokiodropped;comline-corepinned to the mergedcompile_package()commitREADME.mdrewritten;docs/cli.mdadded as the full guide (commands,versioning model, output/exit codes, watch mode, packaging)
fmt+clippy -D warningsjobTests
tests/cli_tests.rsrewritten for the new stderr / exit-code contract, 6 → 17.cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo testall green.