Generates block files

Usage no npm install needed!

<script type="module">
  import 24hrBlockCli from 'https://cdn.skypack.dev/@24hr/block-cli';


Block CLI

This is a handy CLI tool to generate Gutenberg block files that follows the Resurs Bank project's pattern.

How to use

Either install i globally with npm install -g @24hr/block-cli or run it with npx

If installed globally you can run block-cli.

  block-cli generate <blockName>  Generate block files
  block-cli completion            generate completion script

  --version  Show version number [boolean]
  --help     Show help [boolean]

Generate block

By running the generate command followed by the block name will generate all files to the current directory. Be sure that you run this command at the root of the folder where you want the block files to be generated.

NOTE that the CLI will always put the files in a new folder.


Generate block:

block-cli generate my-new-block

Generate block with custom title in Gutenberg editor

block-cli generate my-new-block --title "My New Custom Block"