PHPackages                             ailuracode/bladcn - 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. ailuracode/bladcn

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

ailuracode/bladcn
=================

CLI to add shadcn-style Blade components to Laravel projects

v1.0.0(today)10MITPHPPHP ^8.2CI failing

Since Jun 20Pushed todayCompare

[ Source](https://github.com/ailuracode/bladcn-cli)[ Packagist](https://packagist.org/packages/ailuracode/bladcn)[ Docs](https://github.com/ailuracode/bladcn-cli)[ RSS](/packages/ailuracode-bladcn/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (13)Versions (2)Used By (0)

bladcn CLI
==========

[](#bladcn-cli)

[shadcn/ui](https://ui.shadcn.com)-style CLI to install Blade + Alpine components in Laravel projects.

Copies components from [bladcn-components](https://github.com/ailuracode/bladcn-components) (CSS, JS, Blade) and resolves dependencies from each `dependencies.json`.

### Registry layout (`bladcn-components`)

[](#registry-layout-bladcn-components)

```
bladcn-components/
├── app/Providers/             # BladcnServiceProvider (bladcn init)
├── resources/
│   ├── js/                    # bladcn.js + carousel (import from app.js)
│   ├── css/                   # Theme and base CSS (bladcn init)
│   ├── views/components/ui/   # Blade components (bladcn add)
│   └── views/partials/        # bladcn-boot

```

The CLI package does not ship component assets; they live in **bladcn-components** (default `../bladcn-components`).

```
# .env
BLADCN_REGISTRY=../bladcn-components

# optional: publish config to customize defaults
php artisan vendor:publish --tag=bladcn-config
```

```
export BLADCN_REGISTRY=../bladcn-components
bladcn init
```

Installation
------------

[](#installation)

```
composer require ailuracode/bladcn --dev
```

Or clone this repo and use the binary directly:

```
cd bladcn-cli
composer install
cp .env.example .env   # optional: local registry defaults
./bin/bladcn --version
```

Usage
-----

[](#usage)

### With Artisan (recommended in Laravel)

[](#with-artisan-recommended-in-laravel)

```
# Full setup: bladcn.json + stubs (CSS, ServiceProvider, boot)
php artisan bladcn:init

# Useful options
php artisan bladcn:init --with-dark-mode --skip-prompts
php artisan bladcn:init --force

php artisan bladcn:list
php artisan bladcn:add accordion
php artisan bladcn:add --all
php artisan bladcn:add button --dry-run
```

### Standalone binary

[](#standalone-binary)

From your Laravel app root:

```
# 1. Create bladcn.json and base assets
bladcn init

# 2. List available components
bladcn list

# 3. Add a component (and its dependencies)
bladcn add accordion

# 4. Add several at once
bladcn add dialog button card

# 5. Component only, no dependencies
bladcn add button --no-deps

# 6. Preview without copying
bladcn add drawer --dry-run

# 7. Install every component in the registry
bladcn add --all

# 8. Overwrite existing files
bladcn add button --overwrite
```

Configuration (`bladcn.json`)
-----------------------------

[](#configuration-bladcnjson)

```
{
  "$schema": "./vendor/ailuracode/bladcn/resources/bladcn.schema.json",
  "componentsPath": "resources/views/components/ui",
  "registry": "github:ailuracode/bladcn-components",
  "registryBranch": "main",
  "resolved": ["accordion", "icon"]
}
```

The default registry points to [bladcn-components](https://github.com/ailuracode/bladcn-components). You can change it using any of these formats:

```
{
  "registry": "https://github.com/ailuracode/bladcn-components"
}
```

```
{
  "registry": "https://github.com/other-user/other-registry/tree/develop",
  "registryBranch": "develop"
}
```

### Local registry (development)

[](#local-registry-development)

```
bladcn init --registry ../bladcn-components --force
```

You can also set a relative path in `registry`:

```
{
  "registry": "../bladcn-components"
}
```

How components are resolved
---------------------------

[](#how-components-are-resolved)

Resolution is **declarative**: the CLI reads each component's `dependencies.json` in the registry and persists installed components in `resolved` inside `bladcn.json`. It does not infer dependencies from Blade imports.

### Registry lookup

[](#registry-lookup)

`Registry` locates components under `resources/views/components/ui/` (preferred) or `components/` inside the configured registry. A component is either a **folder** (`accordion/`) or a single **file** (`foo.blade.php`).

### `dependencies.json` manifest

[](#dependenciesjson-manifest)

Only folder components may include a manifest. `ComponentManifest` parses:

```
{
  "dependencies": ["icon"],
  "composer": ["mallardduck/blade-lucide-icons"],
  "npm": ["embla-carousel"],
  "css": ["sonner.css"],
  "js": ["bladcn/carousel.js"]
}
```

FieldPurpose`dependencies`Other registry components installed first (transitive, depth-first)`composer`Packages passed to `composer require` when missing`npm`Documented for the host project (not installed automatically)`css`CSS files copied from the registry and imported into the main CSS file`js`JS files copied under `resources/js/` and wired into `bladcn.js` when neededSame-group sub-components (e.g. `accordion/trigger.blade.php`) are **not** listed in `dependencies`; only external registry components are.

### Install flow (`bladcn add`)

[](#install-flow-bladcn-add)

 ```
flowchart TD
    A["bladcn add carousel"] --> B["Registry: local path or GitHub cache"]
    B --> C["Read carousel/dependencies.json"]
    C --> D["DFS plan: icon → button → carousel"]
    D --> E["Copy Blade files to componentsPath"]
    D --> F["composer require listed packages"]
    D --> G["Publish CSS/JS assets from manifest"]
    E --> H["Update resolved in bladcn.json"]
    F --> H
    G --> H
```

      Loading When you run `bladcn add accordion`, the CLI:

1. Validates the component exists in the registry
2. Builds an ordered install plan via `ComponentInstaller::resolveInstallPlan()` (dependencies first)
3. Copies each component folder/file to `componentsPath` (skips `dependencies.json`)
4. Runs `composer require` for aggregated `composer` entries (`--no-external-deps` skips this)
5. Publishes `css` / `js` assets and updates imports in `app.css` / `bladcn.js`
6. Merges newly installed names into `resolved` in `bladcn.json`

Use `--no-deps` to install only the requested component without transitive registry dependencies.

### Remove flow (`bladcn remove`)

[](#remove-flow-bladcn-remove)

`ComponentRemover` uses `resolved` plus `DependencyResolver` to detect **orphans**: internal components, Composer packages, and CSS/JS assets that no remaining installed component still needs. Orphan removal can be skipped with `--no-orphans`.

Laravel project requirements
----------------------------

[](#laravel-project-requirements)

Copied components require the following in the host app (this CLI does not install them):

DependencyPurpose`livewire/blaze``@blaze` directive`mallardduck/blade-lucide-icons````app/Bladcn/Support/*``ClassResolver`, toast, as-child`resources/css/app.css`Tailwind 4 + shadcn tokens`resources/js/bladcn.js`Alpine helpers (`bladcnOnAlpine`, scroll-area, copy button)`resources/js/bladcn/carousel.js`Embla carousel registration`resources/views/partials/bladcn-boot.blade.php`Layout hook before `@stack('bladcn-scripts')``app/Providers/BladcnServiceProvider.php``@asChild` directiveCommands
--------

[](#commands)

ArtisanBinaryDescription`bladcn:init``bladcn init`Create `bladcn.json` and publish base stubs`bladcn:list``bladcn list`List registry components`bladcn:add``bladcn add`Install components and dependencies`bladcn:remove``bladcn remove`Remove components and orphan deps### `add` options

[](#add-options)

OptionDescription`--all`Install every component from the registry`--no-deps`Skip internal dependencies`--no-external-deps`Skip automatic `composer require``--overwrite`Overwrite existing components`--dry-run`Preview without copying### `remove` options

[](#remove-options)

OptionDescription`--no-orphans`Do not remove orphan internal dependencies`--yes`Remove orphans without prompting`--dry-run`Preview without deleting### `init` options

[](#init-options)

OptionDescription`--with-dark-mode`CSS theme with `.dark` variables`--css-file=app.css`Main CSS file to import the theme into`--theme-file=bladcn-theme.css`Theme file name`--skip-prompts`Skip interactive prompts`--skip-assets`Only `bladcn.json`, no stubs`--force`Overwrite existing filesCode quality
------------

[](#code-quality)

Aligned with [laravel-starter-kit](https://github.com/nunomaduro/laravel-starter-kit): Laravel Pint (strict preset), Larastan (max level + bleedingEdge), Rector with `rector-laravel`.

See [AGENTS.md](AGENTS.md) for architecture notes and agent conventions.

```
composer lint         # rector + pint (apply changes)
composer test         # phpunit + lint check + phpstan
composer ci           # alias for test
composer test:unit    # phpunit
composer test:lint    # pint --test + rector --dry-run
composer test:types   # phpstan (Larastan, max level)
composer pint         # format code
composer pint:check   # check format without modifying
composer phpstan      # static analysis
composer rector       # apply refactorings
composer rector:check # suggested refactorings (dry-run)
```

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c76656f63ce9b5b29122c1e8162ba3131dbd644ecba71bb33c54166dd34b2dd?d=identicon)[AiluraCode](/maintainers/AiluraCode)

---

Top Contributors

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

---

Tags

clilaraveluicomponentsbladealpineshadcn

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ailuracode-bladcn/health.svg)

```
[![Health](https://phpackages.com/badges/ailuracode-bladcn/health.svg)](https://phpackages.com/packages/ailuracode-bladcn)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[livewire/flux

The official UI component library for Livewire.

9476.8M121](/packages/livewire-flux)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.3k449.3k30](/packages/tightenco-jigsaw)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

9782.1M160](/packages/laravel-ai)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)

PHPackages © 2026

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