Skip to content
Brok UI

Loading…

No results

CLI

The ui:* Artisan commands fetch registry items, manage installed code, and keep your project in sync with upstream without overwriting your local edits. Run them from your Laravel application root after requiring jml/brok.

ui:install

Install the UI system into the current Laravel application.

Usage

terminal
php artisan ui:install [--alpine]

This command takes no arguments. Pass --alpine to write the Alpine.js bootstrap without prompting. It detects your project stack (Laravel version, Tailwind, Vite, Alpine, Livewire, dark-mode config) and then:

  • Writes ui.json and ui-lock.json if they do not already exist.
  • Copies resources/css/ui.css, resources/js/ui/index.js, and resources/views/components/ui/_styles.php into your project (existing files are preserved).
  • Appends the CSS and JS imports to your entrypoints when they can be detected (resources/css/app.css / resources/js/app.js).
  • Prints a manual step for any entrypoint it could not detect automatically.

Re-running the command is safe — existing files and imports are never overwritten or duplicated.


ui:list

List the components, blocks, pages, bundles, and themes available in the registry.

Usage

terminal
php artisan ui:list [<filter>] [--pro] [--type=<kind>] [--layer=<layer>] [--boundary=<boundary>] [--stability=<stability>] [--owner=<team>] [--json]

Arguments & options

  • filter — Optional text filter matched against item names, titles, and descriptions.
  • --pro — Include Pro registry items. Requires ui:auth or a JML_TOKEN environment variable.
  • --type= — Keep only one kind: component, block, page, bundle, or theme.
  • --layer= — Keep only one architecture layer: foundation, primitive, or pattern.
  • --boundary= — Keep only one package boundary: core, livewire, patterns, domain, tokens, icons, starter, or tooling.
  • --stability= — Keep only one stability level, such as stable, incubating, or experimental.
  • --owner= — Keep only items that use the specified stable owner identifier.
  • --json — Print the raw item list as JSON for scripts or custom tooling.

The default output groups items by kind: components, blocks, pages, bundles, and themes. Use this before ui:add when you know roughly what you need but not the exact registry name.


ui:build

Turn a natural-language intent into a ranked registry build kit.

terminal
php artisan ui:build "analytics dashboard with filters" [--type=page] [--limit=8] [--pro] [--json]

Searches authored registry knowledge as well as item names and descriptions. The first result is the recommended starting point; JSON mode returns matched terms, scores, alternatives, and exact install commands for agents and scripts.


ui:generate

Generate an approved Livewire screen or application pattern from local versioned templates.

terminal
php artisan ui:generate users.index [--dry-run] [--force] [--json]
php artisan ui:generate crud User [--dry-run] [--force] [--json]
php artisan ui:generate pattern settings-page [--dry-run] [--force] [--json]
php artisan ui:generate list [--json]
php artisan ui:generate show resource:crud [--json]
php artisan ui:generate resource:show User [--activity] [--attachments] [--related=team,projects]
php artisan ui:generate resource:crud User [--form=modal|page] [--filters=status,role] [--soft-deletes] [--bulk-actions] [--export] [--browser-test]
php artisan ui:generate admin:crud User
php artisan ui:generate pattern dashboard
php artisan ui:generate flow:import

The 17-blueprint catalog includes resource index, show, CRUD, and form screens; settings, dashboard, onboarding, wizard, command-palette, and notification-center patterns; admin CRUD, roles, and audit-log screens; and checkout, invitation, approval, and import flows. Use ui:generate list and ui:generate show <blueprint> for discovery.

Use --dry-run to inspect every target. Existing files stop the complete write unless --force is explicit. Use --json for the machine-readable plan. The generated class documents baseQuery(), rules(), prepareFormData(), and authorization extension points.

CRUD blueprints support modal or page forms, explicit field filters, soft-delete restore, confirmed bulk deletion, and CSV export. Resource detail screens support activity, attachments, and approved eager-loaded relations. Each blueprint rejects options outside its manifest.


ui:manifest

Discover the installed CLI's capabilities without scraping help text.

terminal
php artisan ui:manifest [--json]

Describes every ui:* command, argument, option, mutation flag, response type, example, and stable error code. Integrations should inspect this manifest before constructing commands.


ui:foundation

Three-way update shared tokens and component recipes without discarding local edits.

terminal
php artisan ui:foundation [--check] [--dry-run] [--yes] [--ours|--theirs]

Updates resources/css/ui.css and _styles.php from portable bases stored in ui-lock.json. Registry items declare a minimum compatible foundation version.


ui:theme

Install a custom Theme Generator export as an editable token layer.

terminal
php artisan ui:theme ./brok-theme.json [--name=custom] [--dry-run] [--force] [--json]

Validates token names and values, writes resources/css/themes/<name>.css, and maintains a deduplicated import in resources/css/ui.css. Registry presets use the normal ui:add themes/<name> flow.


ui:show

Inspect one registry item without installing it.

terminal
php artisan ui:show <item> [--skeleton] [--json]

Shows the item's type, license, stability, owner, current version, review dates, known issues, deprecation state, support links, dependencies, files, and usage. Prefix authenticated Pro names with pro/; use --skeleton for its compact regions, responsive contract, states, and composed primitives; combine it with --json for agents.


ui:add

Add a component or block from the registry.

Usage

terminal
php artisan ui:add [<item>] [--force] [--pin] [--accept-unstable] [--accept-deprecated] [--dry-run]

Arguments & options

  • item — Registry item name, for example button or blocks/pricing-usage. When omitted, interactive terminals open a searchable multi-select; non-interactive runs exit with an error.
  • --force — Overwrite locally modified files without prompting. Without this flag, the command asks before overwriting any file that already exists and differs from the incoming content.
  • --pin — Pin the selected root item or items at the installed version.
  • --accept-unstable — Install experimental or incubating items after you review their lifecycle warning and feedback URL.
  • --accept-deprecated — Install an item in the announce or migrate phase after you review its replacement and removal plan. A frozen item also requires an active exception for the project team.
  • --dry-run — Preview resolved items, files, JS imports, and npm dependencies without writing.

Fetches the item JSON from the registry, validates file hashes, writes the target files into your project, and records the installed version and hash in ui-lock.json. Registry dependencies declared by the item are resolved and installed recursively (with a cycle guard). Any JS files placed under resources/js/ui/ are automatically added as imports to resources/js/ui/index.js. Required npm packages declared by the item are printed as a warning at the end.

Requires ui.json to be present — run ui:install first. Pro items can be prefixed with pro/ (e.g. pro/data-table) and require a stored auth token from ui:auth.


ui:update

Update installed UI components and blocks safely.

Usage

terminal
php artisan ui:update [<item>] [--check] [--dry-run] [--interactive] [--yes] [--force] [--accept-unstable] [--major] [--allow-downgrade]

Arguments & options

  • item — Optional installed item name. When omitted, all items recorded in ui-lock.json are checked.
  • --check — Only check for available updates; no files are written. Implies --dry-run behaviour.
  • --dry-run — Show what would change without writing any files.
  • --interactive — Prompt for confirmation before applying each individual update.
  • --yes — Skip the full-plan confirmation and apply it.
  • --force — Include pinned items, which bulk updates otherwise skip.
  • --accept-unstable — Update experimental or incubating items that can include breaking changes before stabilization.
  • --major — Allow breaking updates. Without this flag, items flagged as breaking are skipped with a warning.
  • --allow-downgrade — Apply an item whose registry version is older than the one in your lock file. This means the registry is behind your project, not ahead of it: applying it reverts component code and can strip props your templates already use. Such items are skipped by default.

For each item, the command compares the installed file against both the cached upstream base and the latest registry version. Files you have not edited are updated automatically. Files you have edited are merged with a three-way merge when possible; when a merge has conflicts, the incoming file and a unified diff are written to .jml/updates for you to review — the local file is never silently overwritten.


ui:pin

Freeze or unfreeze an installed item at its current version.

terminal
php artisan ui:pin [<item>] [--unpin] [--list]

Pinned items are skipped by bulk updates. Pass --unpin with an item to resume updates, or --list without an item to show all pins.


ui:remove

Remove an installed item's tracked files and lock state.

terminal
php artisan ui:remove <item> [--force] [--dry-run]

Use --dry-run to preview deletion. The command refuses to remove an item that another installed item still depends on; --force skips the confirmation prompt, not dependency safety.


ui:resolve

Complete conflicts staged by ui:update.

terminal
php artisan ui:resolve [<item>] [--theirs|--ours|--edit|--list]

List pending conflicts, accept incoming files, keep local files, or open them in $EDITOR. A successful resolution records the incoming version as the next merge base and removes its staging files.


ui:diff

Show local changes and upstream differences for an installed item.

Usage

terminal
php artisan ui:diff [<item>]

Arguments

  • item — Optional installed item name. When omitted, all installed items are shown.

This command has no options. For each file it prints two unified diffs: one between the cached upstream base and your local file (your edits), and one between the cached base and the current registry version (what has changed upstream). Use this to understand what you would be merging before running ui:update.


ui:check

Lint application Blade views against the design system: tokens and classes, component contracts, accessibility, and Livewire usage. The full guide is Lint.

Usage

terminal
php artisan ui:check [--offline] [--fail-on=error|warning] [--format=console|json|sarif] [--path=*] [--exclude=*] [--new-deprecations-since=&lt;git-ref&gt;] [--since=&lt;git-ref&gt;] [--explain=&lt;rule&gt;] [--list-rules] [--fix] [--unsafe-fixes] [--stdin=&lt;path&gt;] [--watch] [--oracle] [--json]

Use --offline to read only ui-lock.json metadata. Use --fail-on to select the failure threshold. Use --format for console, JSON, or SARIF output. Repeat --path or --exclude to define the Blade files that CI scans. An explicit path with no Blade files fails the check. Use --new-deprecations-since with a Git ref to report deprecated use only on changed lines, or --since to hold every rule to changed lines, so a new rule can go to error before the backlog is fixed. --explain <rule> describes one rule by id, name, or code with its options and effective level; --list-rules lists every rule. --fix applies the safe replacements findings carry and re-checks; --unsafe-fixes adds approximations such as the nearest theme colour. --path accepts a single Blade file; --stdin=<path> lints source read from standard input as that project-relative file (an editor buffer); --watch re-runs on every change. --oracle asks the installed Tailwind (Node and tailwindcss in node_modules) whether an unknown class produces CSS, instead of the bundled grammar. Levels, policies, and messages per rule live in the lint block of ui.json. Contract checks cover installed component names, required props, allowed literal values, named slots, supported elements, deprecated props, and Livewire safety requirements. Accessibility and token checks also cover static ARIA references, clickable non-controls, reduced motion, RTL-safe utilities, and token-driven dark mode. --json is an alias for JSON output.

Suppress one intentional exception with {{-- ui-lint-disable-next-line UI-304: reason --}} (the rule name works too) on the preceding line. Unknown, malformed, and unused suppressions fail as UI-005.


ui:migrate

Apply safe declarative migrations to consumer Blade views.

Usage

terminal
php artisan ui:migrate &lt;item&gt; [--to=&lt;version&gt;] [--dry-run] [--offline] [--yes] [--report=&lt;path&gt;] [--json]

Use --to to stop at a published version, --dry-run to preview changes, and --offline to use lock metadata. --yes skips confirmation. --report selects a path under .jml/migrations, and --json emits a machine-readable report.


ui:outdated

List installed items and foundations that are outdated or deprecated.

Usage

terminal
php artisan ui:outdated [--fail] [--include-current] [--json]

Use --fail for a non-zero CI result when action is needed. --include-current includes current items, and --json emits machine-readable results.


ui:status

Show installed UI items against the registry: available updates and registry status.

Usage

terminal
php artisan ui:status [--json]

This command takes no arguments. Pass --json for the machine-readable per-item registry state. It checks whether the configured registry endpoint is reachable, then lists every item recorded in ui-lock.json with its installed version, the latest available version, and a status label (current, update available, upstream changed). It compares with the registry index and does not read your files. To find local edits, run ui:inventory --json: each item in data.items has modifiedFiles (tracked files that no longer match their installed hash) and missingFiles (tracked files that are not on disk), both counts. A good first step before running ui:update on a large project.


ui:doctor

Verify the UI package registration and expected Laravel project paths.

Usage

terminal
php artisan ui:doctor [--offline] [--json]

This command takes no arguments. Pass --offline to skip network reachability checks or --json for machine-readable checks and advisories. It runs a series of environment checks and prints a pass/fail result for each:

  • Laravel application base path is available.
  • Brok package config (config/ui.php) is loaded.
  • Generated component, block, config-file, lock-file, and cache paths are set to the expected defaults.
  • The resources/ directory exists.
  • Advisory only: installed blocks and pages whose <x-blocks.*> or <x-pages.*> tag does not resolve because no anonymous component path is registered.

Exits with a non-zero status if any check fails, making it suitable for CI health checks.


ui:inventory

Report application, package, foundation, and installed-item versions.

terminal
php artisan ui:inventory [--json] [--offline] [--project=<id>] [--team=<id>] [--application-version=<version>] [--phase=<phase>] [--migration=<name>] [--feature=<name>] [--feature-started-at=<timestamp>] [--feature-completed-at=<timestamp>] [--package-released-at=<timestamp>] [--a11y-defects=<count>] [--visual-regressions=<count>] [--quality-report=<path>] [--report=<https-url>]

The command reports local version and drift data. Use --project, --team, and --application-version to set stable release identifiers and ownership. Use --json for machine-readable output. Use --offline to resolve item metadata only from ui-lock.json without a registry request. Use --quality-report to add per-component quality counts from a project-relative JSON file. Reporting is explicit: --report sends the inventory to an HTTPS endpoint and requires BROK_INVENTORY_TOKEN.

Use --phase with --migration to record a baseline or post-migration result. Use --feature, --feature-started-at, and --feature-completed-at to measure delivery time. Use --package-released-at, --a11y-defects, and --visual-regressions to report upgrade and quality data.


ui:skill

Install Brok's agent instructions into the current project.

terminal
php artisan ui:skill [--check|--update] [--json]

Writes the Claude Code skill and Cursor/AGENTS guidance while preserving user-authored rules outside Brok's marker section. Use --check in CI and --update after package upgrades; --force remains an alias for update.


ui:auth

Authenticate with the Pro registry.

Usage

terminal
php artisan ui:auth [<license>] [--registry=<url>] [--label=<text>] [--machine=<hash>] [--list] [--deactivate=<id|current>]

Arguments & options

  • license — Pro license key. If omitted, the command prompts for it securely (the input is hidden).
  • --registry= — Pro registry base URL, e.g. https://ui.example.com/r/pro. Defaults to the ui.pro_registry_url config value.
  • --label= — Optional support-friendly name stored with the activation record. Defaults to the machine hostname.
  • --machine= — Override the generated machine hash used to activate the license seat. Normally auto-generated; use this for reproducible CI environments.
  • --list — List the active seats for the stored Pro token.
  • --deactivate= — Release a numeric activation ID, or use current for this machine.

Sends the license key and a machine fingerprint to the Pro license server's activation endpoint. On success the returned bearer token is stored locally (the path is printed after authentication), and subsequent ui:add pro/<item> calls attach it automatically when fetching from the Pro registry.

Note

ui:auth is only required for Pro items. Open-core components and blocks can be installed without authenticating. Each machine running ui:add pro/… must be activated against your license key. Use --machine= to pin the hash in shared CI environments so the same seat is reused across runs. Use --list to find a seat ID, then use --deactivate=<id> to release a lost machine.