PHPackages                             xrash/twig-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. xrash/twig-cli

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

xrash/twig-cli
==============

CLI for the Twig template engine

20PHP

Since Apr 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/xrash/twig-cli)[ Packagist](https://packagist.org/packages/xrash/twig-cli)[ RSS](/packages/xrash-twig-cli/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Twig CLI
========

[](#twig-cli)

Installation:
-------------

[](#installation)

```
$ wget https://github.com/xrash/twig-cli/raw/master/bin/twig.phar -O /tmp/twig.phar
$ chmod +x /tmp/twig.phar
$ sudo mv /tmp/twig.phar /usr/local/bin/twig

```

One liner:

```
$ wget https://github.com/xrash/twig-cli/raw/master/bin/twig.phar -O /tmp/twig.phar && chmod +x /tmp/twig.phar && sudo mv /tmp/twig.phar /usr/local/bin/twig

```

Usage:
------

[](#usage)

Passing files as arguments:

```
$ twig file1.html.twig file2.html.twig > result.html

```

Processing the input through STDIN:

```
$ cat file.html.twig | twig > result.html

```

Using inline parameters:

```
$ cat file.html.twig | twig -p title="My Title" -p env=dev > result.html

```

TODO
----

[](#todo)

- Accept parameters from JSON and/or YAML files.
- Option to process every .twig file (recursively) inside a directory and outputting in another one.
- Option to load an internal Twig Environment (from a given directory), then processing the input as a template name instead of a filename.

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/xrash-twig-cli/health.svg)

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

###  Alternatives

[seld/cli-prompt

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

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.3k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71464.1k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20718.9k21](/packages/winbox-args)

PHPackages © 2026

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