Broken Record

NPM version Build Status JavaScript Style Guide

A Handlebars powered CLI tool for defining file and directory structure templates.

Repeatably setting up new projects the same way can be annoying.

Broken Record allows you to define templates which can then be invoked and filled out in hassle-free way.


Install with npm:

$ npm i broken-record -g


Show help information:

$ broken-record -h

Usage: broken-record [options] [command]


    -V, --version         output the version number
    -h, --help            output usage information


    config [dir]          Displays or sets the templates directory
    register <dir>        Registers a template at a specified directory
    list                  Lists the available templates
    remove <name>         Removes a registered template
    get [options] <name>  Retrieves a registered template
    show [name]           Opens the templates directory or a template in the file explorer

  Template Specification:

    Directory Structure:
          ├── template <-- template files directory
          └── template.json

        "options": [
            "name": "<variable-name>", <-- required
            "message": "<displayed-message>", <-- value of "name" used by default,
            "value": "<default-value-or-choices-array>" <-- default value can be boolean
        "embed": {
          "<template-name>": {
            "directory": "<path-relative-to-template-dir>", <-- required
            "options": {
              "<option1>": "<handlebars-template>",

Set the templates directory location:

$ broken-record config
Looks like this is your first time running this command!
? Where should the 'templates' directory be created? path/to/some/dir

Try out an example:

$ git clone
$ cd broken-record-templates
$ broken-record register mit
The provided template was successfully registered.
$ broken-record register js-npm-module
The provided template was successfully registered.
$ broken-record get js-npm-module

Related projects


Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running Tests

Install dev dependencies:

$ npm i -d && npm test


Tomer Aberbach


Copyright © 2018 Tomer Aberbach Released under the MIT license.

Share this project: