Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Cli Color Laravel Package

wujunze/php-cli-color

wujunze/php-cli-color is a lightweight PHP library for adding ANSI colors and styles to command-line output. It supports foreground and background colors, 256-color terminals, and simple chained methods to make CLI scripts, logs, and console tools easier to read.

Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for console DX. This package exists to answer a very narrow question: "do we hand-roll ANSI escape codes for CLI output, or pull a dependency?" At ~41 stars, one maintainer, and no release since July 2018, it is best treated as a reference implementation rather than a dependency decision — the entire feature surface is a name-to-ANSI-code map plus a __callStatic wrapper.
  • Whether to invest in CLI/developer-experience polish at all. Colored output is a readability and diagnostics decision, not a product capability. It matters for internal tooling: artisan commands, deploy/seed/migration scripts, Docker entrypoints, cron wrappers, data-import CLIs. It is irrelevant to anything HTTP-facing.
  • Roadmap triage. If a roadmap item is "make our ops scripts easier to scan during incidents," the answer is measured in hours, not sprints. That framing helps you kill or right-size the ask before it becomes a mini-project.
  • Standards compliance as a requirement. The real product question this package surfaces is not "which colors" but "do we respect NO_COLOR, non-TTY output, and CI log capture?" This package emits raw escape sequences unconditionally — a genuine concern if output is piped into log aggregation or scheduler logs.
  • Dependency policy precedent. Adopting an unmaintained micro-dependency here sets a precedent for the rest of the codebase. Useful as a concrete test case when defining a "minimum maintenance bar" for third-party packages.

When to Consider This Package

Consider it when:

  • You have a short-lived or internal-only PHP script (a one-off migration runner, a scraper, a local seeder helper) where a 60-line color helper is genuinely faster than reading Symfony docs.
  • You are on PHP 7.x and pinned to that era's tooling anyway.
  • You want zero framework coupling — a bare PHP CLI script with no Laravel or Symfony bootstrap.
  • You are reading it for reference to implement your own success()/warning()/error() helpers behind an internal interface.

Look elsewhere when:

  • You are inside Laravel or Symfony already. $this->info(), $this->error(), $this->line('<fg=green>...</>'), and <options=bold> are already available via Symfony Console with zero added dependencies — plus automatic TTY detection and --ansi/--no-ansi handling this package does not provide.
  • You need tables, progress bars, spinners, or interactive prompts. That is Symfony Console, nunomaduro/termwind, or laravel/prompts — not a color map.
  • Output is redirected, piped, or shipped to a log aggregator. Unconditional escape codes corrupt plain-text logs and CI output.
  • You require PHP 8.1+, ongoing maintenance, security responsiveness, or a supported dependency in a compliance review. A package with no release in seven years will not survive that review.
  • You need accessibility guarantees (respecting NO_COLOR, colorblind-safe palettes, meaningful non-color signal like [OK]/[FAIL] prefixes).

How to Pitch It (Stakeholders)

To executives: This is a tiny, free, single-purpose utility for coloring terminal output. It is not a strategic dependency and requires no budget. My recommendation is not to adopt it — it has had no release since 2018, and the same result is available for free from the console component we already ship. The decision costs us nothing and avoids adding an unmaintained package to our dependency inventory.

To engineering: The functionality is ~50 lines: a color-name-to-ANSI-code map and a static accessor. Inside Laravel, use the built-in console helpers or Symfony's <fg=green> markup — they already handle TTY detection, --ansi/--no-ansi, and Windows terminals, which this package does not. If you want the ergonomics of success()/error()/warning(), add a three-method helper in our own codebase and wrap it so we control NO_COLOR and non-TTY behavior.

Bottom line: Low cost, low risk, low strategic value. Solve it in-house or with what's already installed; reserve the dependency slot for something that earns it.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package