Skip to content

Add CLI colour helpers. - #22

Merged
gwillz merged 6 commits into
masterfrom
feat/cli-colors
Jul 17, 2026
Merged

Add CLI colour helpers.#22
gwillz merged 6 commits into
masterfrom
feat/cli-colors

Conversation

@gwillz

@gwillz gwillz commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Enough to get by.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds ANSI colour/style helpers to karmabunny\kb\Cli and updates CLI output helpers to automatically emit (or strip) ANSI sequences depending on whether the target stream is a TTY.

Changes:

  • Introduces foreground/background/style ANSI constants plus helpers for merging/joining/stripping ANSI sequences.
  • Updates Cli::puts() / Cli::error() to auto-detect colour support and strip ANSI when unsupported.
  • Updates tests/cli.php to exercise the new colour output paths.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/Cli.php Adds ANSI constants and colour-aware output/utility helpers.
tests/cli.php Adds sample invocations to print coloured and normal output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Cli.php Outdated
Comment thread src/Cli.php Outdated
Comment thread src/Cli.php Outdated
Comment thread src/Cli.php Outdated
Comment thread src/Cli.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

Comment thread src/Cli.php Outdated
Comment thread src/Cli.php
Comment thread src/Cli.php Outdated
Comment thread src/Cli.php Outdated
Comment thread src/Cli.php Outdated
Comment thread tests/CliTest.php
@gwillz
gwillz merged commit b47e93f into master Jul 17, 2026
2 checks passed
@gwillz
gwillz deleted the feat/cli-colors branch July 17, 2026 05:13
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