# CLI reference (oxblade)

> The oxblade command converts PHP Blade views and language files, replays later view changes and summarizes migration reports.

- Package: oxblade (Laravel for Rust, alpha), crates: `oxblade`, `oxblade-laravel`, `oxblade-macros`, `oxblade-mail`, `oxblade-cli`
- Maintenance: active; Latest release: 0.2.0 (2026-12-05); Framework: laravel-rust 0.2.x; MSRV: Rust 1.99 or later; Licence: MIT
- Links: [Repository](https://github.com/bowerbird-si/oxblade), [crates.io](https://crates.io/crates/oxblade/0.2.0), [docs.rs](https://docs.rs/oxblade/0.2.0), [Changelog](https://oss.bowerbird.si/oxblade/docs/changelog/), [Contributing](https://github.com/bowerbird-si/oxblade/blob/c7fab7e68e7ad4df560796ee140e438944d26598/CONTRIBUTING.md), [Security policy](https://github.com/bowerbird-si/oxblade/blob/c7fab7e68e7ad4df560796ee140e438944d26598/SECURITY.md)
- Based on: [Laravel Blade](https://github.com/illuminate/view): The template language this package implements: Blade's markup, directives and rendered HTML (illuminate/view, MIT).
- Community package, not affiliated with Laravel.
- HTML version: https://oss.bowerbird.si/oxblade/docs/cli/
- Source: https://github.com/bowerbird-si/oxblade/blob/c7fab7e68e7ad4df560796ee140e438944d26598/docs/cli.md

The `oxblade` command converts PHP Blade views and language files, replays later view changes
and summarizes migration reports.

```shellscript
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.

```shellscript
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.

```shellscript
oxblade lang legacy/lang --out lang
```

## Read a migration report

```
oxblade report <json>
```

Pass the JSON file produced by `migrate --report`. The command prints a Markdown summary to
standard output.

```shellscript
oxblade report migration.json
```
