Skip to content

Add --no-color flag to disable all terminal colors #11

@kavix

Description

@kavix

Description

Currently kurl always outputs with syntax highlighting and colors. Users piping output to files or using terminals without color support need a way to disable colors globally.

Proposed Implementation

kurl https://api.example.com --no-color

Also respect the NO_COLOR environment variable (https://no-color.org/).

Why this matters

Color codes break when piping to less, grep, or saving to files. Standard CLI tools support --no-color or NO_COLOR.

Acceptance Criteria

  • Add --no-color CLI flag
  • Respect NO_COLOR environment variable
  • Disable all ANSI escape codes when flag/env is set
  • Works across JSON, HTML, and header output
  • Add test coverage

Getting Started

Look at the formatter/color package. The colorization logic likely wraps fmt.Printf or uses a color library. Add a global toggle that returns plain strings when disabled.


Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions