rmb32 / barnscaff-cli
The barnscaff command: scaffold a folder from a Barncept schema, or scan one to check it still conforms
v2.0.0
2026-10-19 20:50 UTC
Requires
- php: ^8.5
- rmb32/barncept: ^5.0
- rmb32/barnscaff: ^2.0
Requires (Dev)
- infection/infection: ^0.35.4
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^13.3
- rector/rector: ^2.6
- squizlabs/php_codesniffer: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Part of Barn.
The barnscaff command: scaffold a folder from a Barncept
concept, or scan a folder to check it still conforms. Built on
Barnscaff.
Requirements
- PHP 8.5+
Installation
composer require rmb32/barnscaff-cli
Setup
Run vendor/bin/barncept init once (from Barncept CLI)
so the project has a barncept.json saying where its concepts live, and which other folders it may
borrow from. barnscaff uses it to find a concept by name; you can always pass a file path instead.
Without a barncept.json it looks in ./concepts.
Usage
barnscaff scaffold <concept> <choice> <target> [--apply]
barnscaff scan <concept> <choice> <path>
<concept>— a path to a concept file, or a concept'snamein the project's concept folder. A concept that borrows others is composed first, so they must be in that folder or aborrowFromone.<choice>— the key of the Choice to resolve from: an entry point with no open slots beneath it.scaffoldprints the plan and writes nothing; add--applyto create the directories and files.scanprints every finding (Missing/Unexpected/Misplaced/TypeMismatch) and exits0if conformant,1otherwise — handy in CI.
$ barnscaff scaffold Library Root ./generated
[Directory] ./generated
[Directory] ./generated/Core
[Directory] ./generated/Command
[File] ./generated/Command/Cmd.php
Re-run with --apply to write these to disk.
$ barnscaff scaffold Library Root ./generated --apply
$ barnscaff scan Library Root ./generated
Conformant.
Related packages
- Barnscaff — the library behind this CLI, for use from PHP.
- Barncept — concepts, and the graphs they resolve to.
- Barncept CLI —
barncept init. - Barnark CLI —
template:scaffold/template:checkagainst ready-made architecture templates.
More docs
License
Proprietary. See LICENSE. Copyright (c) Roger Barnfather.