PHPackages                             sugarcraft/sugar-spark - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sugarcraft/sugar-spark

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sugarcraft/sugar-spark
======================

PHP port of charmbracelet/sequin — ANSI escape-sequence inspector. Decodes SGR / CSI / OSC / DCS / APC / SS3 sequences into human-readable labels.

10PHP

Since Jun 1Pushed 1w agoCompare

[ Source](https://github.com/sugarcraft/sugar-spark)[ Packagist](https://packagist.org/packages/sugarcraft/sugar-spark)[ RSS](/packages/sugarcraft-sugar-spark/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![sugar-spark](.assets/icon.png)](.assets/icon.png)

SugarSpark
==========

[](#sugarspark)

[![CI](https://github.com/detain/sugarcraft/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/detain/sugarcraft/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/aabc94c5e41dde3707ab4aa2b7fb44fcb039d545926b90fec897dc85fe81f005/68747470733a2f2f636f6465636f762e696f2f67682f64657461696e2f737567617263726166742f6272616e63682f6d61737465722f67726170682f62616467652e7376673f666c61673d73756761722d737061726b)](https://app.codecov.io/gh/detain/sugarcraft?flags%5B0%5D=sugar-spark)[![Packagist Version](https://camo.githubusercontent.com/eb96b73d7a5f170be291175939951d9d71b3532ee0b78569ff38a15f02edda73/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737567617263726166742f73756761722d737061726b3f6c6162656c3d7061636b6167697374)](https://packagist.org/packages/sugarcraft/sugar-spark)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/e78ffc83837c0d12647811a7fd1910c3cbeae04988de94bb4fd5b67e0874696a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d254532253839254135382e312d3838393262662e737667)](https://www.php.net/)

[![demo](.vhs/inspect.gif)](.vhs/inspect.gif)

PHP port of [charmbracelet/sequin](https://github.com/charmbracelet/sequin) — an ANSI escape-sequence inspector. Pipe styled output through it and each escape becomes a labelled line.

```
composer require sugarcraft/sugar-spark
```

CLI
---

[](#cli)

```
$ printf '\e[31mhello\e[0m world\n' | sugarspark
ESC[31m  SGR foreground red
hello
ESC[0m   SGR reset
 world
```

```
$ printf '\e]0;new title\e\\' | sugarspark
ESC]0;new title  set window title to "new title"
```

```
$ printf '\e[?2026h' | sugarspark
ESC[?2026h  enable synchronized output
```

Library
-------

[](#library)

```
use SugarCraft\Spark\Inspector;

foreach (Inspector::parse("\e[1;31mboom\e[0m") as $segment) {
    echo $segment->describe(), "\n";
}

// One-shot report:
echo Inspector::report($capturedTerminalOutput);
```

What it decodes
---------------

[](#what-it-decodes)

- **SGR** — foreground / background (16, 256, 24-bit truecolor) + bold / italic / underline / blink / reverse / strikethrough / faint.
- **CSI** — cursor moves, erase, scroll region (DECSTBM), scroll up/down, insert/delete line/char, tab forward/backward, DECSCUSR cursor shape, DECRQM mode query, DECRPM mode reply, request cursor position, XTVERSION query, kitty keyboard query/push/pop.
- **CSI ~ keys** — Home / End / Delete / PgUp / PgDn / F1-F12 / bracketed paste markers.
- **DEC private modes** — cursor visibility, mouse modes (1000/1002/1003/ 1006/1015), focus reporting (1004), alt screen (47/1047/1049), bracketed paste (2004), **synchronized output (2026)**, **unicode grapheme mode (2027)**.
- **OSC** — title (0/2), icon (1), palette (4), cwd (7), hyperlink (8), iTerm2 (9), taskbar progress (9;4), terminal colour set (10/11/12), clipboard (52), reset terminal colour (110/111/112).
- **DCS** — XTVERSION reply (`>| `), DECRPSS, sixel.
- **APC** — CandyZone markers (`candyzone:S/E:`), kitty graphics (`G…`).
- **SS3** — F1-F4 / cursor / Home / End.
- **2-byte ESC** — DECSC / DECRC / keypad mode / index / reverse-index / reset.

Anything unrecognised falls back to a generic `CSI/OSC/...` descriptor — nothing is silently swallowed.

Test
----

[](#test)

```
cd sugar-spark && composer install && vendor/bin/phpunit
```

###  Health Score

21

↑

LowBetter than 18% of packages

Maintenance64

Regular maintenance activity

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 97.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1036e0717211b8030b83cbe729e8ba6ba442fdbd5285fb97a39d7dcfe339342?d=identicon)[detain](/maintainers/detain)

---

Top Contributors

[![detain](https://avatars.githubusercontent.com/u/1364504?v=4)](https://github.com/detain "detain (95 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

ansiansi-inspectorcandycorecsi-decoderdebuggingdecodedevelopmentdiagnosticsescape-codesosc-decoderreadablesequence-parsersequinsequin-portsgr-parserterminalterminal-debugtoolingtui

### Embed Badge

![Health badge](/badges/sugarcraft-sugar-spark/health.svg)

```
[![Health](https://phpackages.com/badges/sugarcraft-sugar-spark/health.svg)](https://phpackages.com/packages/sugarcraft-sugar-spark)
```

###  Alternatives

[xj/yii2-lazyload-widget

yii2-lazyload-widget

175.4k](/packages/xj-yii2-lazyload-widget)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
