PHPackages                             chemaclass/phel-cli-gui - 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. [CLI &amp; Console](/categories/cli)
4. /
5. chemaclass/phel-cli-gui

ActiveLibrary[CLI &amp; Console](/categories/cli)

chemaclass/phel-cli-gui
=======================

Phel functions to render in the terminal. It uses the Cursor from the Symfony Command module.

0.10.0(1mo ago)52251MITPHPPHP &gt;=8.3CI passing

Since Oct 21Pushed 2w ago2 watchersCompare

[ Source](https://github.com/Chemaclass/phel-cli-gui)[ Packagist](https://packagist.org/packages/chemaclass/phel-cli-gui)[ Docs](https://phel-lang.org/)[ RSS](/packages/chemaclass-phel-cli-gui/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (10)Versions (13)Used By (1)

Phel CLI GUI
============

[](#phel-cli-gui)

Build rich terminal interfaces in [Phel](https://phel-lang.org/) — render text at arbitrary coordinates, draw framed boxes, paint regions, read raw keypresses, and style output with named formatters.

Powered by Symfony's [Console Cursor](https://symfony.com/doc/current/console/coloring.html), exposed behind a small, data-first Phel API.

- Works with any TTY (ANSI-capable).
- Zero globals — one managed `TerminalGui` singleton per process.
- Pure helpers (`parse-key`) are easy to test without a real terminal.
- Diff rendering writes only the cells that changed each frame — see [docs/api.md](docs/api.md#diff-rendering).

Requirements
------------

[](#requirements)

- PHP 8.4+
- `ext-pcntl`, `ext-posix`, `ext-readline`
- Phel `^0.44`

Install
-------

[](#install)

```
composer require chemaclass/phel-cli-gui
```

Require the namespace in your Phel file:

```
(ns my-app.main
  (:require phel-cli-gui.terminal-gui :refer [render read-key draw-box clear-screen]))

```

Quick start
-----------

[](#quick-start)

Draw a bordered box, render text inside it, wait for a key, quit.

```
(ns my-app.hello
  (:require phel-cli-gui.terminal-gui
            :refer [clear-screen draw-box render read-key cleanup-gui]))

(defn main []
  (clear-screen)
  (draw-box {:x 2 :y 1 :width 30 :height 5 :fill-char \space})
  (render 4 3 "Press any key to exit")
  (loop []
    (if (read-key)
      (cleanup-gui)
      (do (php/usleep 10000) (recur)))))

(main)

```

Run:

```
vendor/bin/phel run src/phel/hello.phel
```

Docs
----

[](#docs)

- [API reference](docs/api.md) — every public function, grouped by concern.
- [Recipes](docs/recipes.md) — copy-paste patterns (diff loop, bordered UI, …).

Example projects
----------------

[](#example-projects)

- [phel-snake](https://github.com/Chemaclass/phel-snake) — classic Snake built with this library.

Development
-----------

[](#development)

```
composer install
composer test     # Phel tests + PHPUnit (test:phel / test:php to scope)
composer format   # phel format
```

Layout: `src/phel/` public API · `src/php/` rendering core (Symfony Console wrapper + pure helpers) · `tests/` Phel, PHPUnit &amp; bashunit suites · `tools/`release automation.

Cut a release with `tools/release.sh ` (add `--dry-run` to preview) — it gates, rolls the CHANGELOG, tags, pushes, and publishes the GitHub release.

AI-assistant config is managed with [agnostic-ai](https://github.com/Chemaclass/agnostic-ai): edit the source under `.agnostic-ai/`, run `agnostic-ai sync`; the per-tool files (`CLAUDE.md`, `.claude/…`) are generated and git-ignored.

License
-------

[](#license)

MIT © [Jose M Valera Reales](https://chemaclass.com)

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance93

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~92 days

Recently: every ~53 days

Total

11

Last Release

57d ago

PHP version history (4 changes)0.1.0PHP ^8.0

0.2.0PHP ^8.2

0.3.1PHP &gt;=8.2

0.5.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d166420c6770c5941e10bd68b2d26501eabb432e280d8e6eba0a344bcc1e5ae?d=identicon)[Chemaclass](/maintainers/Chemaclass)

---

Top Contributors

[![Chemaclass](https://avatars.githubusercontent.com/u/5256287?v=4)](https://github.com/Chemaclass "Chemaclass (97 commits)")

---

Tags

cliphelphpterminallanguagefunctionallispphel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chemaclass-phel-cli-gui/health.svg)

```
[![Health](https://phpackages.com/badges/chemaclass-phel-cli-gui/health.svg)](https://phpackages.com/packages/chemaclass-phel-cli-gui)
```

###  Alternatives

[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

5186.0k18](/packages/phel-lang-phel-lang)

PHPackages © 2026

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