wazum/composer-fanfare
Composer 安装命令:
composer require wazum/composer-fanfare
包简介
Display a colored ASCII banner after composer install/update.
README 文档
README
Display a colored ASCII banner after composer install / composer update.
Every composer install ends the same boring way: autoload files generated, then silence.
composer-fanfare replaces that with a project-specific full-stop — a colored ASCII banner that confirms which project just finished and lets you convey your own message: "Made with ❤️ by the maintainers".
Useful when you're proud of your work, juggle multiple repos, or just want a little fun after the thousandth composer install.
Stays respectful: silent in CI, plain in non-TTY shells, suppressed under --quiet.
Install
composer require wazum/composer-fanfare
Important
Composer 2.2+ asks for plugin approval on first run. Interactive shells prompt you; in CI or non-interactive setups, allow it explicitly:
composer config allow-plugins.wazum/composer-fanfare true
Configure
Drop a plain-text template anywhere in your project (e.g. art/banner.txt) and reference it from composer.json:
{
"extra": {
"fanfare": {
"template": "art/banner.txt",
"colors": "sunset"
}
}
}
template— path to the template, relative to the project root.colors— one of:- a hex string (
"#ff6ec7") - an array of hex stops (
["#ff6ec7", "#7873f5"]) — colors interpolate smoothly between stops - a preset name:
aurora,catppuccin,doom,dracula,fire,gruvbox,iceberg,matrix,monokai,nord,ocean,pride,solarized,sunset,synthwave "random"— picks a random preset on each install/update- omit for plain output
- a hex string (
direction— controls how the gradient flows:"vertical"(default) — one color per line, top to bottom"horizontal"— color per character, left to right (whitespace stays uncolored)"diagonal"— flows top-left to bottom-right across the whole banner
transform— optional palette transform applied after color resolution:"reverse"— reverses the stop order (e.g.sunsetreversed → sunrise)
animation— optional reveal animation:"typewriter"— types each visible character with a small per-character delay"shimmer"— slides the gradient across the banner; vertical/horizontal rotate the static colors, diagonal does a smooth phase shift across the whole plane"drip"— reveals cells in random order in small bursts, like raindrops landing on the banner- omit for an instant render. Skipped automatically in non-TTY / non-decorated terminals.
footer—true(default) prints a dim line below the banner with project name + version, PHP version, and locked package count. Set tofalseto hide.
Note
The banner falls back to plain text when NO_COLOR is set or output isn't a TTY. Composer's --quiet mode suppresses it entirely via the IO layer. If any banner line is wider than the current terminal, the banner is skipped silently to avoid wrapping artefacts.
Disabling
Skip the banner for a single run by setting COMPOSER_FANFARE=0 inline:
COMPOSER_FANFARE=0 composer install
Or disable it globally for the current shell or CI environment:
export COMPOSER_FANFARE=0
Setting values from the CLI
If you'd rather not hand-edit composer.json, every key can be set with composer config:
composer config extra.fanfare.template art/banner.txt composer config extra.fanfare.colors synthwave composer config extra.fanfare.direction diagonal composer config extra.fanfare.transform reverse
Booleans and arrays need --json so the value is stored with the right type:
composer config --json extra.fanfare.colors '["#ff6ec7","#7873f5"]' composer config --json extra.fanfare.footer false
Remove a key with --unset:
composer config --unset extra.fanfare.transform
Color depth
Truecolor escapes are emitted by default. The renderer downgrades automatically based on COLORTERM and TERM:
| Detected support | Trigger | Output |
|---|---|---|
| 24-bit | COLORTERM=truecolor / 24bit, or any modern terminal |
\033[38;2;R;G;Bm |
| 256-color | TERM matching *-256color |
\033[38;5;Nm (xterm 6×6×6 cube + 24-step grayscale ramp) |
| 16-color | TERM=ansi / vt100 / linux |
nearest-neighbor mapping to the standard ANSI palette |
| Plain | NO_COLOR=1, TERM=dumb, or non-TTY |
banner content rendered without escapes |
Preset gallery
plain![]() |
aurora![]() |
catppuccin![]() |
doom![]() |
dracula![]() |
fire![]() |
gruvbox![]() |
iceberg![]() |
matrix![]() |
monokai![]() |
nord![]() |
ocean![]() |
pride![]() |
solarized![]() |
sunset![]() |
synthwave![]() |
Preview
Pick a preset without running an install:
composer fanfare:preview --gallery # render every preset composer fanfare:preview --preset=fire # render just one composer fanfare:preview --preset # list preset names composer fanfare:preview --gallery --direction=diagonal --transform=reverse # combine
--direction and --transform accept the same values as the matching extra.fanfare keys. The preview uses your project's configured extra.fanfare.template if there is one, otherwise it falls back to a small built-in banner.
Creating a template
The template is any plain-text file. For large ASCII letters from a word, the classic tool is figlet:
brew install figlet # macOS sudo apt-get install -y figlet # Debian / Ubuntu figlet -f standard "your project" > art/banner.txt
Try other fonts with -f slant, -f big, -f small, etc.; figlist lists what's installed. Prefer a browser? patorjk.com/software/taag is a popular generator with the same fonts.
Another option is toilet, which offers its own font set and can be useful for compact banner styles:
brew install toilet # macOS sudo apt-get install -y toilet # Debian / Ubuntu toilet -f pagga "composer-fanfare" > art/banner.txt
Note
Banner output relies on the font your terminal renders monospaced text in. Block-shading glyphs (█▀▄░ from pagga/smblock/block) and box-drawing glyphs (┏━┓┃ from future/emboss) are covered by every modern terminal font (JetBrains Mono, Fira Code, Cascadia, Hack, Menlo). Sparser ranges like braille (⡠⢀⣀ from smbraille) are not — if a glyph shows up as □, switch to a font with wider Unicode coverage (DejaVu Sans Mono, Cascadia Code, Iosevka).
License
MIT.
Footnotes
-
The company names, project names, and email addresses shown in the demo (Atelier Prime, harbor sync, Neon District, meridian labs, lumen forge, etc.) are fictional — invented to illustrate the kind of personal banner you might write for your own project. ↩
wazum/composer-fanfare 适用场景与选型建议
wazum/composer-fanfare 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 05 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cli」 「banner」 「ascii」 「ansi」 「composer-plugin」 「fanfare」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wazum/composer-fanfare 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wazum/composer-fanfare 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wazum/composer-fanfare 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Add a configurable cookie consent banner to the website.
Sets of digits or characters that may be used for base conversions, encoding and decoding tasks, and input validation
Site-wide banners activated through the CMS
Makes the ASCII Bell sound or flashes terminal
Slug Generator
PHP Cli Image - This library converts a given image to ASCII string.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 49
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-08
















