Repository navigation
CLI
One binary for deploys, cron jobs and CI; the same commands inside WordPress
through WP-CLI. Library resolution: HTML_PHP_LIB env β vendor/autoload.php
β dev autoload.php β the edition-matching bundle.
htmlphp <command> [arguments] [--options]
Global: --config=FILE β a PHP file that returns a v4 config array (the
same shape Engine::create() takes).
Exit codes: 0 ok Β· 1 lint errors / runtime failure Β· 2 usage error.
$ htmlphp version
5.0.0 (8.3 edition) Β· PHP 8.3.35Effective configuration as JSON β every group, enums resolved. The fastest
way to see what a --config file actually produced.
$ htmlphp lint templates/ --format=json --ignore=untranslated-message
templates/card.html:7 ERROR [unknown-filter] Unknown filter "uppr".
2 issue(s), 1 error(s). # exit code 1- files and directories (
.html .htm .txt .shtml .xhtml) -
--format=text|jsonβ JSON is pure on stdout (summary goes to stderr), pipe it straight into CI annotations -
--ignore=code,codebaselines known findings - 25 issue codes: structure, filters, expressions, includes/layouts, trans blocks, SSI directives/expressions, exec-policy notices β full table
Renders a file path or locator name to stdout (--var values are strings;
for structured data drive the engine from PHP).
SSI-only pass over a file, anchored at that file, contained by --root.
Empties the configured render cache + the in-memory parse memo.
@{key} + @Trans blocks β POT skeleton with #: file:line references.
Dynamic %{var|translate} usages are reported as warnings on stderr.
$ htmlphp i18n:audit templates/ --locale=de
Locale de: 41/52 messages translated (79%), 3 unused.
missing: checkout.total
unused: legacy.banner # exit code 1 (missing > 0)- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with: { php-version: '8.3', coverage: none }
- name: Template lint
run: |
php bin/htmlphp lint templates/ --format=json > lint.json || true
php -r '
$issues = json_decode(file_get_contents("lint.json"), true) ?: [];
foreach ($issues as $i)
printf("::%s file=%s,line=%d,title=%s::%s\n",
$i["severity"] === "error" ? "error" : "warning",
$i["file"], $i["line"], $i["code"], $i["message"]);
exit(array_any($issues, fn($i) => $i["severity"] === "error") ? 1 : 0);
'(Or use the planned htmlphp/lint@v1 action β ROADMAP.)
- run: php bin/htmlphp i18n:extract templates/ --out=/tmp/messages.pot
- run: php bin/htmlphp i18n:audit templates/ --locale=de --config=config/htmlphp.php
- run: php bin/htmlphp i18n:audit templates/ --locale=fr --config=config/htmlphp.phpphp bin/htmlphp lint templates/ && php bin/htmlphp cache:clear| Standalone | WP-CLI |
|---|---|
htmlphp version |
wp htmlphp info [--json] (adds WP/server/updates sections) |
htmlphp lint β¦ |
wp htmlphp lint [<path>] (theme roots by default) |
htmlphp render β¦ |
wp htmlphp render <template> [--var=k:v]β¦ |
htmlphp cache:clear |
wp htmlphp cache clear (object cache + transients registry) |
htmlphp i18n:extract/audit |
wp htmlphp i18n extract/audit β¦ |
| β |
wp htmlphp health (findings incl. engine diagnostics backlog) |
Note
Canonical spec: docs/CLI.md.
HTML.PHP 5.0.0 Β· MIT Β© Mikhail Deynekin Β· Repository Β· Releases Β· Report a security issue
Wiki pages mirror docs/ β found a mistake? Edit the page or open an issue.
π Home Problem Domain Getting Started
Template Syntax Expressions & Math SSI Guide I18n Guide WordPress Integration CLI
Configuration API Cheatsheet Diagnostics & Troubleshooting
Architecture Security Model Testing & CI
πΊοΈ ROADMAP Migration 4.x β 5.0 Migration 3.x β 4.0 Contributing Repository β