Skip to content

feat: add global --no-color flag and NO_COLOR handling for CLI#18

Merged
fmueller merged 1 commit intomainfrom
codex/add-no-color-flag-to-cli
Feb 2, 2026
Merged

feat: add global --no-color flag and NO_COLOR handling for CLI#18
fmueller merged 1 commit intomainfrom
codex/add-no-color-flag-to-cli

Conversation

@fmueller
Copy link
Owner

Motivation

  • Provide a single, consistent way to disable colored CLI output for all commands and respect the common NO_COLOR environment variable.

Description

  • Add a global --no-color option to the Typer app callback in src/scribae/main.py and check NO_COLOR in os.environ to control coloring at runtime.
  • Use click.get_current_context(...).color = False to disable ANSI coloring when requested, and add import click and import os to support this behavior.
  • Add three unit tests in tests/unit/main_test.py to validate colored output, --no-color flag behavior, and NO_COLOR environment handling, and ensure tests unset NO_COLOR during setup with monkeypatch.delenv.

Testing

  • Ran linting with uv run ruff check src tests, which passed.
  • Ran type checks with uv run mypy src, which failed due to unrelated missing stubs for torch in src/scribae/translate/mt.py (2 errors reported).
  • Ran unit tests with uv run pytest, which passed: 163 passed.

Codex Task

@fmueller fmueller merged commit 5ea6a72 into main Feb 2, 2026
3 checks passed
@fmueller fmueller deleted the codex/add-no-color-flag-to-cli branch February 2, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant