Download the PHP package tivins/tui without Composer

On this page you can find all versions of the php package tivins/tui. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tui

tivins/tui

Small PHP helpers for terminal user interfaces: cursor and screen control, Unicode bordered frames, side-by-side layout of multiline blocks, text progress bars, ANSI colors (16-color and 256-color foregrounds), a lightweight ASCII banner renderer, ANSI-aware string utilities, and a spinner with optional rotating grayscale on messages.

Requires PHP 8.1+ (typed enum). The mbstring extension is recommended for correct Unicode handling in banners and width calculations.

Install

There are no Composer runtime dependencies.

Highlights

Area Classes What they do
Screen & cursor Terminal Clear/move cursor, CPR, eraseLine, alternate screen, screenSize(), carriageReturn(), lineOverwritePrefix() (réécrire une ligne), cursorPreviousLine() (CPL, colonne 1).
Boxes Frame Multiline bordered panels: presets single, double, rounded, heavy, optional titles, padding, independent border/content/title colors, colored content with correct alignment.
Layout Layout horizontal(array $blocks, int $gap = 1) — place blocks side by side; each row is padded using Ansi::displayWidth so borders stay aligned.
Progress ProgressBar render($percent, $width, ...) — Unicode-filled bar (█ / ░) without a spinner; complements Throbber’s {bar} placeholder.
Banners AsciiText Three-line glyphs (Future Smooth subset) via AsciiText::get() and AsciiText::toString().
Colors TermColor TermColor::*->fmt(string) wraps text in SGR sequences.
ANSI & 256-color Ansi stripSgr(), displayWidth(), fmtForeground256(int $code, string) for \e[38;5;nm foregrounds (e.g. grayscale 232–255).
Text effect RotatingColors Shifting palette along a string: render($text, $offset, $palette); default grayscale uses smooth 256-color steps; palette entries may be TermColor or 256-color indices (int).
stdin Console stdinIsTty() and readLine() for interactive pauses without mixing stdin with terminal inquiries.
Activity Throbber Spinner (styles: braille, pipe, dots, line), template placeholders including {message}, {rotating_message} (grayscale wave; offset advances every tick() via internal rotatingColorOffset, independent of spinner wrap), {bar}, percent, elapsed, registerStyle(), barWidth().

Quick examples

Rotating colors

RotatingColors::render() applies a repeating palette along each UTF-8 character. The offset usually increases by one per animation frame. With Throbber, use {rotating_message} so the wave stays smooth when the spinner loops (the library uses a monotonic color offset, not the spinner frame index).

Framed panel

Use render() explicitly when you need a string inside another expression:

Side-by-side blocks and progress bar

Terminal size and fullscreen demo

ASCII banner

Only characters listed in AsciiText::CHARSET have glyphs (others render as blanks). Typical flow:

Runnable demos

From the repository root:

Command Description
php examples/showcase.php Full-screen demo (alternate buffer, banners, framed panels). Waits for Enter when stdin is a TTY.
php examples/fullscreen_demo.php Full-screen animated dashboard: Layout::horizontal, nested Frames, Throbber, RotatingColors, ProgressBar; cursorHome refresh; Enter when stdin is a TTY; short loop if not.
php examples/frame.php Frame variants and edge cases.
php examples/ascii_text.php Banner sample.
php examples/throbber.php Throbber : défilement, une ligne puis deux lignes mises à jour en place (\r/\e[2K, \e[1A).
php examples/rotating_colors.php RotatingColors and {rotating_message} : static output and a short live demo.

Tests

Scripts under tests/ are plain PHP assertions (no PHPUnit):

Tooling

The glyph map for AsciiText is generated from tools/Future_Smooth.flf:

See CHANGELOG.md for release notes.

License

MIT.


All versions of tui with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tivins/tui contains the following files

Loading the files please wait ...