Search by

rmb32 / barnscaff-cli

rogerbarnfather

The barnscaff command: scaffold a folder from a Barntree tree, or scan one to check it still conforms

Package info

bitbucket.org/rmb32/barnscaff-cli/

Homepage

pkg:composer/rmb32/barnscaff-cli

Statistics

Installs: 16

Dependents: 0

Suggesters: 0

v0.1.1 2026-11-11 14:22 UTC

This package is auto-updated.

Last update: 2026-11-11 15:01:21 UTC


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> — the name of 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. Use barntree init to 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 .php file. A tree written without an item tree is scaffolded as its skeleton.
  • scaffold prints the plan and writes nothing; add --apply to create the directories and files.
  • scan prints every finding (Missing / Unexpected / Misplaced / TypeMismatch) and exits 0 if conformant, 1 otherwise — 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 init makes a barn; make and check the trees barnscaff works from.
  • Barntree GUI — the same in the browser.
  • Barnark CLI — template:clone / template:check against ready-made architecture templates.

More docs

Internals · History

License

Proprietary. See LICENSE. Copyright (c) Roger Barnfather.