rmb32 / barnscaff-cli
The barnscaff command: scaffold a folder from a Barntree tree, or scan one to check it still conforms
v0.1.1
2026-11-11 14:22 UTC
Requires
- php: ^8.5
- rmb32/barnscaff: ^0.1@dev
- rmb32/barntree: ^0.1@dev
Requires (Dev)
- infection/infection: ^0.35.4
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^13.3
- rector/rector: ^2.6
- rmb32/barn-paths: ^0.1@dev
- rmb32/typed-json: ^1.0@dev
- squizlabs/php_codesniffer: ^4.0
Suggests
- rmb32/barntree-cli: The barntree command: make a barn and the trees barnscaff works from.
- rmb32/barntree-gui: A browser page for making and editing the trees barnscaff works from.
Provides
None
Conflicts
None
Replaces
None
README
Early, version 0.x. Not ready for real projects yet; the minor version is the breaking one.
Part of Barn.
The barnscaff command: scaffold a folder from a Barntree
tree, or scan a folder to check it still conforms. Built on
Barnscaff.
Requirements
- PHP 8.5+
Installation
composer require rmb32/barnscaff-cli
Usage
barnscaff scaffold <tree-name> <target> [--apply]
barnscaff scan <tree-name> <path>
<tree-name>— thenameof a tree kept in the barn's Barntree folder. barnscaff works in a barn. It searches up from the current folder for the nearest.barn/and looks for the tree in.barn/barntree/trees/. It prints the barn's root on stderr. Usebarntree initto make a barn. Trees are made with Barntree CLI or Barntree GUI.<target>/<path>— the folder the tree's root item is. Below it, each map and list item is a folder and each leaf item a.phpfile. A tree written without an item tree is scaffolded as its skeleton.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.
To try the bundled House tree in a fresh project:
composer require rmb32/barntree-cli
vendor/bin/barntree init
mkdir -p .barn/barntree/trees
cp vendor/rmb32/barntree/trees/house.barntree.json .barn/barntree/trees/
vendor/bin/barnscaff scaffold House ./generated
vendor/bin/barnscaff scaffold House ./generated --apply
vendor/bin/barnscaff scan House ./generated
The scan prints Conformant. after the scaffold is applied.
Related packages
- Barnscaff — the library behind this CLI, for use from PHP.
- Barntree — Trees: types, and a tree of items that follow them.
- Barntree CLI —
barntree initmakes a barn; make and check the trees barnscaff works from. - Barntree GUI — the same in the browser.
- Barnark CLI —
template:clone/template:checkagainst ready-made architecture templates.
More docs
License
Proprietary. See LICENSE. Copyright (c) Roger Barnfather.