Skip to content

Conversation

@mphstudios
Copy link
Member

@mphstudios mphstudios commented Jan 20, 2026

Instrument progress reporting and add global --verbose and --debug flags for cli output.

Purpose

Output modes: debug, verbose

Reconcile program (bin/cli.js, main.js) and command flags that control cli output to present a consistent interface and address the requirements of the Quire user groups: non-technical (editors); technical (developers, maintainers); and programmatic use.

Semantic Model

Mode Flag Description Audience
Quiet -q, --quiet Suppress progress output programmatic use (CI/scripts)
Default (none) Show spinner with basic status General users
Verbose -v, --verbose Show detailed progress Users wanting more info
Debug --debug Enable debug output Developers/maintainers

See the CLI Output Modes documentation included in this pull-request.

Progress Indicators

The lib/reporter module provides and abstraction for commands that instrument progress output (such as a "spinner").

The Quire commands that instrument the reporter either have stages, such as new and build, or an extended delay without any terminal output, such as the pdf and epub commands. Instrumentation of a progress reporter addresses this issue, providing the user with information about slow or staged processes.

The reporter module is a thin façade around the chosen progress reporter library ora, which was chosen for its simplicity, stability, small bundle size (~30K), and out-of-the-box feature that benefit the four primary Quire user groups and use cases (non-technical/editors, developers, maintainers, programmatic).

The key features that ora provides are:

  • non-technical: support for text output of commands that have "stages"
  • developers: automatic detection of cli flags (--debug, --quiet)
  • maintainers: automatic detection of cli flags, simple API
  • programmatic: automatic detection of TTY (in CI environments for example)

@mphstudios mphstudios marked this pull request as ready for review January 20, 2026 19:00
@mphstudios mphstudios changed the title Feature: lib/reporter abstraction to display command progress Feature: command progress indicators Jan 20, 2026
@mphstudios mphstudios force-pushed the feature/cli-doctor-command branch from ce40331 to 7a20274 Compare January 21, 2026 05:06
@mphstudios mphstudios force-pushed the feature/lib-reporter branch from 4076c5f to b785111 Compare January 21, 2026 07:27
@mphstudios mphstudios force-pushed the feature/cli-doctor-command branch from 60c0f14 to 5ede249 Compare January 23, 2026 00:56
@mphstudios mphstudios changed the title Feature: command progress indicators CLI output modes and progress indicators Jan 23, 2026
@mphstudios mphstudios force-pushed the feature/lib-reporter branch 2 times, most recently from f7a805d to 52e304e Compare January 23, 2026 18:16
@mphstudios mphstudios force-pushed the feature/cli-doctor-command branch from f7f290e to 2c4421b Compare January 23, 2026 20:21
- Import reporter module in create.js and installer/index.js
- Add --quiet option to suppress progress output
- Add reporter.configure(), fail(), and succeed() calls
- Add reporter.start() and update() calls in installer

Preserves security fixes:
- DirectoryNotEmptyError for non-empty directory handling
- Array-based execa() to prevent command injection
- Auto-deletion disabled with Nota bene comments
* Rewrites calls to use execa with array-syntax for sub-process arguments
* Captures git command errors and calls the debug logger
* Captures npm command errors and calls the debug logger
The tests for quiet option and engine config override were failing
because mockReporter was referenced from t.context but never set up
in the beforeEach hook.
@mphstudios mphstudios force-pushed the feature/lib-reporter branch from 52e304e to 480d484 Compare January 23, 2026 23:46
@mphstudios mphstudios changed the base branch from feature/cli-doctor-command to main January 23, 2026 23:46
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.

2 participants