The oxblade command converts PHP Blade views and language files, replays later view changes
and summarizes migration reports.
cargo install --locked oxblade-cli --version 0.2.0
Run oxblade --help or oxblade <command> --help for the argument list.
Commands reject symbolic links in destination directory paths and at output files. Updated files
replace regular outputs atomically. An explicit --report path selects its own destination and
is subject to the same checks.
Convert templates
oxblade migrate <src> --out <directory> [--config <file>] [--report <file>] [--diff <old>..<new>]
Pass a .blade.php file or a directory of views as <src>. The command writes .blade.html files
and initial .blade.rs view-model skeletons beneath the output directory. Review the TODO comments
before using the converted views. Existing skeletons are kept.
--config specifies the TOML mappings file. If you omit it, the command uses
oxblade-migrate.toml in the current directory when present. --report writes a JSON report.
A prop default supplies its value when omitted. For example, @props(['size' => 40]) becomes
@props(size = 40), so size="2rem" remains valid. The report notes untyped defaults. To declare a
scalar type when all callers agree, set the prop's name under [types] in oxblade-migrate.toml.
A generated php:: call must exist in the engine's built-in function table. Missing functions
produce a php-function TODO and count as pending. The built-in php::preg_match(pattern, subject)
returns PHP's match status. Calls that use PHP's by-reference captures argument also produce a
TODO so the match and its captures can be supplied by the view model. The current PCRE adapter
reports an error for the A and D modifiers.
oxblade migrate legacy/views --out resources/views --report migration.json
In a Git checkout, pass --diff OLD..NEW to replay the upstream PHP Blade changes between two
commits onto views you have already migrated. Use the source and output directories for that
migration. The command exits unsuccessfully if the replay has conflicts.
Export language files
oxblade lang <src> --out <directory>
Pass the Laravel language directory as <src>. The command exports the PHP group files at
<src>/<locale>/<group>.php to JSON dictionaries and copies the top-level locale JSON files.
Each PHP group file must return a static array.
oxblade lang legacy/lang --out langRead a migration report
oxblade report <json>
Pass the JSON file produced by migrate --report. The command prints a Markdown summary to
standard output.
oxblade report migration.json