feat: Terminal output auto-detection and adaptive formatting (v0.22.1) #75
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.
Summary
This PR implements automatic terminal capability detection and adaptive output formatting for SpecFact CLI. The CLI now automatically detects terminal capabilities and adjusts output formatting for optimal user experience across different environments (full terminals, embedded terminals, CI/CD pipelines).
Changes
Added
get_configured_console()function provides Rich Console instances configured for detected terminal capabilitiesget_progress_config()function provides appropriate Progress column configurations based on terminal modeNO_COLOR,FORCE_COLOR,CI,TEST_MODE,PYTEST_CURRENT_TEST)docs/guides/testing-terminal-output.mdChanged
runtime.pywith terminal mode managementFixed
progress.pyandruntime.pyusing lazy importsProgressinitialization to use positional arguments for columnsTesting
Documentation
Version
pyproject.tomlsetup.pysrc/__init__.pysrc/specfact_cli/__init__.pyRelated
enhance-cli-terminal-outputNotes
NO_COLORstandard (https://no-color.org/)