PHPackages                             pxlbros/lightncandy-cli - 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. pxlbros/lightncandy-cli

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

pxlbros/lightncandy-cli
=======================

A PHP CLI wrapper for the mustache/handlebars PHP implementation lightncandy to aid build processes.

1.0.6(10y ago)480621PHP

Since Sep 1Pushed 9y ago12 watchersCompare

[ Source](https://github.com/PXLbros/LightnCandy-CLI)[ Packagist](https://packagist.org/packages/pxlbros/lightncandy-cli)[ Docs](https://github.com/PXLbros/LightnCandy-CLI)[ RSS](/packages/pxlbros-lightncandy-cli/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (8)Used By (1)

LightnCandy-CLI
===============

[](#lightncandy-cli)

LightnCandy-CLI is a CLI wrapper around the PHP implementation of mustache/handlebars [LightnCandy](https://github.com/zordius/lightncandy). This CLI tool can be used in your build process to compile mustache/handlebars templates to PHP to be used with the LightnCandy library or on their own.

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

[](#installation)

LightnCandy-CLI is meant to be used as a CLI tool and can be globally installed with composer like so: `composer global require pxlbros/lightncandy-cli`Make sure you have `~/.composer/vendor/bin/` in your path.

You can also install LightnCandy-CLI into your project directory and run it straight from the vendor folder if you want to.

Usage
-----

[](#usage)

### Basic

[](#basic)

The first and only unamed argument is a path to the template file that you wish to compile.

`$ lightncandy path/to/template.hbs`

If omitted, LightnCandy-CLI will use STDIN as the template. This is usefull because you can pipe input into the utility.

`$ echo 'Hello {{name}}!' | lightncandy`

By default LightnCandy-CLI will pipe the compiled template to STDOUT but you can also write the output to disk by providing a path.

`$ lightncandy path/to/template.hbs -o path/to/output.php`

### LightnCandy Options

[](#lightncandy-options)

LightnCandy supports many flags that can be used to configure how it compiles your templates. A list of these options and what they do can be found on the page for the [LightnCandy](https://github.com/zordius/lightncandy) library. You can toggle them like so:

`$ lightncandy path/to/template.hbs --FLAG_BARE --FLAG_HANDLEBARSJS`

You can also use `$ lightncandy --help` to see a list of availible options and their descriptions in your command line.

### Other Options

[](#other-options)

#### basedir

[](#basedir)

`-b/--basedir "path/to/partials/directory/ path/to/different/dir"`Space seperted list of directory paths containing partial templates.

#### helpers

[](#helpers)

`-p/--helpers "path/to/helpers/directory/ path/to/different/dir"`Space seperated list of directory paths containing helper functions.

#### blockhelpers

[](#blockhelpers)

`-k/--blockhelpers "path/to/blockhelpers/directory/ path/to/different/dir"`Space seperated list of directory paths containing block helper functions.

#### hbhelpers

[](#hbhelpers)

`-h/--hbhelpers "path/to/hbhelpers/directory/ path/to/different/dir"`Space seperated list of directory paths containing handlebars style helper functions.

#### fileext

[](#fileext)

`-e/--fileext ".tmpl .partial"`Space seperated list of file extensions for template files.

#### render

[](#render)

`-r/--render`If provided, will run the compiled template and will output the result instead.

#### data

[](#data)

`-d/--data`JSON string to pass to the rendering function if the render flag is provided.

#### compress

[](#compress)

`-c/--compress`Compress the output to reduce file size by around 30%.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 95.7% 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 ~1 days

Total

7

Last Release

3909d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35ebdcf2ebd4cbfa448b6164a6e6bb49f84519bc740cfbb3fd1948a4f8662fbb?d=identicon)[DennisNygren](/maintainers/DennisNygren)

---

Top Contributors

[![iwilliams](https://avatars.githubusercontent.com/u/5215799?v=4)](https://github.com/iwilliams "iwilliams (22 commits)")[![peter-sharp](https://avatars.githubusercontent.com/u/12944430?v=4)](https://github.com/peter-sharp "peter-sharp (1 commits)")

### Embed Badge

![Health badge](/badges/pxlbros-lightncandy-cli/health.svg)

```
[![Health](https://phpackages.com/badges/pxlbros-lightncandy-cli/health.svg)](https://phpackages.com/packages/pxlbros-lightncandy-cli)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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