PHPackages                             brzuchal/ansi-qr-code - 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. brzuchal/ansi-qr-code

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

brzuchal/ansi-qr-code
=====================

PHP library for creating QR codes in ANSI format for terminal

1.1.4(9mo ago)00MITPHPPHP ^8.3CI passing

Since Nov 19Pushed 9mo agoCompare

[ Source](https://github.com/brzuchal/ansi-qr-code)[ Packagist](https://packagist.org/packages/brzuchal/ansi-qr-code)[ RSS](/packages/brzuchal-ansi-qr-code/feed)WikiDiscussions 1.1 Synced 1w ago

READMEChangelog (5)Dependencies (4)Versions (9)Used By (0)

ANSI QR Code
============

[](#ansi-qr-code)

A PHP library for generating QR codes in the terminal using ANSI escape codes.

[![PHP Version](https://camo.githubusercontent.com/ef0054230522e542bc1f908ac005c6c75888dea255bac910f9015e12095e31d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e332d626c7565)](https://camo.githubusercontent.com/ef0054230522e542bc1f908ac005c6c75888dea255bac910f9015e12095e31d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e332d626c7565)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)

[![Terminal QR Demo](docs/demo.png)](docs/demo.png)

Command Line Tool
-----------------

[](#command-line-tool)

[![CLI Demo](docs/demo_cli.png)](docs/demo_cli.png)

Features
--------

[](#features)

- **ANSI Renderer**: Uses half-block characters (`▀`, `▄`, `█`) and ANSI colors to render high-resolution QR codes in the terminal.
- **ASCII Renderer**: Fallback renderer using full block characters (`██`) and spaces for broader compatibility.
- **Auto-detection**: Automatically selects the best renderer based on terminal capabilities (TTY, `NO_COLOR`, `TERM`).
- **Zero Dependencies**: Only requires `bacon/bacon-qr-code` for matrix generation.
- **Static Analysis**: Strict type checking with PHPStan (max level).
- **Coding Standard**: Adheres to `brzuchal/coding-standard`.

Installation
------------

[](#installation)

```
composer require brzuchal/ansi-qr-code
```

Installation
------------

[](#installation-1)

### One-liner (Recommended)

[](#one-liner-recommended)

Installs the `qr` command to `~/.local/bin`.

```
curl -s https://raw.githubusercontent.com/brzuchal/ansi-qr-code/1.1/install.sh | bash
```

### Composer

[](#composer)

```
composer global require brzuchal/ansi-qr-code
```

Usage
-----

[](#usage)

### Command Line

[](#command-line)

After installing the package globally or in a project, you can use the `qr` command:

```
# If installed globally
qr "https://github.com/brzuchal/ansi-qr-code"

# If installed in a project
vendor/bin/qr "Your text here"
```

### PHP Code

[](#php-code)

```
use Brzuchal\TerminalQr\TerminalQrCode;

$qr = new TerminalQrCode();

// Write directly to STDOUT
$qr->write('https://github.com/brzuchal/ansi-qr-code');

// Or get the rendered string
$output = $qr->render('https://github.com/brzuchal/ansi-qr-code');
echo $output;
```

### Customizing Renderer

[](#customizing-renderer)

You can choose between `AnsiRenderer` (default) and `AsciiRenderer`:

```
use Brzuchal\TerminalQr\TerminalQrCode;
use Brzuchal\TerminalQr\Renderer\AsciiRenderer;

// Use ASCII renderer (full blocks)
$qr = new TerminalQrCode(new AsciiRenderer());
$qr->write('https://example.com');
```

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

[](#requirements)

- PHP ^8.3
- bacon/bacon-qr-code ^2.0

License
-------

[](#license)

MIT

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance58

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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 ~0 days

Total

8

Last Release

272d ago

### Community

Maintainers

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

---

Top Contributors

[![brzuchal](https://avatars.githubusercontent.com/u/3149753?v=4)](https://github.com/brzuchal "brzuchal (14 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/brzuchal-ansi-qr-code/health.svg)

```
[![Health](https://phpackages.com/badges/brzuchal-ansi-qr-code/health.svg)](https://phpackages.com/packages/brzuchal-ansi-qr-code)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

24.3k69.5k](/packages/grumpydictator-firefly-iii)[statamic/cms

The Statamic CMS Core Package

4.9k3.8M1.2k](/packages/statamic-cms)[roundcube/roundcubemail

The Roundcube Webmail suite

7.1k3.2k3](/packages/roundcube-roundcubemail)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[jason-munro/cypht

Lightweight Open Source webmail written in PHP and JavaScript

1.7k160.6k](/packages/jason-munro-cypht)

PHPackages © 2026

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