Command reference
Every command, argument and option.
The barnark command is for a terminal, scripts, CI and AI agents. It does what the browser app does.
vendor/bin/barnark <command> --help lists every option of a command.
The commands #
| Command | What it does |
|---|---|
init | Make a barn here if there is none, and say where Barnark keeps its records. |
skills:install | Copy Barnark’s agent skills into the project. |
ark:list | List the project’s arks: name, folder and template. |
template:list | List the arks’ templates, your own and the shipped ones, each copy with where it was copied from. |
template:components <template> [<key>] [--keys] | List the components a template is built from, placed in its tree or only available, or show one component’s meaning and what it holds. |
template:copy-component <from> <component> <to> [--name=] | Copy a component, with what it holds, from one of your templates or a shipped one into one of your templates or an ark’s, available to place. No folder changes, and nothing is copied out of an ark. |
template:remove-component <template> <component> | Remove an available component, with what only it holds. |
template:place <template> <path> <component> | Place an available component in a folder of one of your templates or an ark’s, the path inside the template’s folder. In an ark its folders are made. |
template:add-list <template> --in= --name= --meaning= --member-type= --member-meaning= | Add a list of your own to one of your templates: a folder that holds members, and the member type each follows, an empty folder to build inside. --in is the key of the component to add it in, as template:components lists it (--keys prints only the keys). No folder changes, and an ark’s template takes none. |
template:remove-folder <template> --in= [--delete-definition] | Take a folder out of one of your templates, with everything inside it. Its definition stays, so it can be placed again, unless --delete-definition deletes it with what only it holds. The root, a member type and a folder used in several places stay. An ark’s template takes no removal. |
template:clone <your template> <ark> <targetDir> | Make a new ark and its folder from a copy of one of your templates, named after the ark. A shipped template is refused: copy it first. --outside allows a folder outside the barn’s root, and --absolute-link writes the ark’s link file with absolute paths. |
template:check [<template> [<directory>]] | Check an ark against its template, or a directory against a shipped template. --ark names the ark. An ark’s file rules are checked too. |
template:offers [<path>] | List what the template lets you create in a folder. |
template:new <slot> <name> [<path>] | Add a member the folder offers, under a name you give, to the template and make its folder. |
template:add-folder <path> <meaning> | Add a folder of your own to the template, or take in one made by hand. --template= adds it to one of your templates instead, with no folder made. |
template:change-meaning <path> <meaning> | Change what a folder of the template, or an ark’s folder, means. |
template:tag <template> --in= --tag= [--meaning=] | Put a tag on every occurrence of a component in one of your templates, by its key, and list the places reached. --meaning declares the tag when the template doesn’t have it. An ark’s template takes none: it keeps the tags it had when the ark was made. |
template:untag <template> --in= --tag= | Take a tag off every occurrence of a component in one of your templates, and list the places reached. The tag stays declared. |
rule:set <ark> <tag> <pattern>... [--none] | Say which files the folders carrying a tag may hold in an ark, by name patterns such as '*.php' (quote them). --none allows no file. |
rule:list <ark> | List an ark’s file rules. |
rule:remove <ark> <tag> | Take away an ark’s file rule for a tag. |
template:copy <from> <name> | Copy a shipped template or one of yours into a new one of your own. An ark’s template is refused. |
template:delete <template> | Delete one of your templates, with every revision. |
gui | Serve the browser app and open it. It needs rmb32/barnark-gui. |
list and help are there too, and completion prints a shell completion script.
Options every command has #
| Option | What it does |
|---|---|
-h, --help | Show help for the command. |
-n, --no-interaction | Don’t ask. template:delete goes ahead without asking. |
-q, --quiet | Show only errors. |
--silent | Show no message at all. |
-v, -vv, -vvv | More output. |
--ansi, --no-ansi | Force colour on or off. |
-V, --version | Show Barnark’s version. |
The barn #
Barnark keeps its records only in a barn: the project’s .barn/ folder, which every Barn tool shares. init
makes one in the current folder. Inside another barn it asks first; with -n it refuses unless you pass
--separate-barn. With no barn, every template: command refuses and writes nothing:
$ vendor/bin/barnark template:list
[ERROR] There is no barn in "…/hotel" or any folder above it: no .barn folder
was found. Start one with `barnark init`.
Each template: command prints the barn’s root first and works from any folder inside the barn. Folder paths are
relative to the barn’s root.
Exit status #
A command exits with 0 when it succeeded, and 1 when it was refused or, for template:check, when the folder doesn’t
conform (or an ark’s link file disagrees with the record). A refusal says why, and writes nothing.
Examples #
$ vendor/bin/barnark init # make a barn here
$ vendor/bin/barnark template:copy "Domain Driven Design" "My DDD" # a template of your own
$ vendor/bin/barnark template:clone "My DDD" Hotel ./src # make the ark Hotel in src/
$ vendor/bin/barnark template:check # check an ark
$ vendor/bin/barnark template:offers src/Context # what can be created here?
$ vendor/bin/barnark template:new Context Reservation src/Context # add a member and make its folders
$ vendor/bin/barnark template:add-folder src/Docs "Design notes." # add a folder of your own
$ vendor/bin/barnark template:copy Hotel Reservations # copy a template
$ vendor/bin/barnark template:delete Reservations # delete the copy