The Stackbit CLI tool can help you to generate, validate and edit your stackbit.yaml configuration file.

Note: Stackbit CLI is in active development and is coming soon.

Installation

Stackbit CLI can be installed globally on your local machine using the following:

npm install @stackbit/cli -g

stackbit.yaml generator

To generate stackbit.yaml using content from files located in the current folder

stackbit generate \
    --pagesDir=./content \
    --dataDir=./data

Or using the npx command:

npx @stackbit/cli generate

You can also use the generator in node:

npm install @stackbit/schema-utils
const path = require('path');
const { generator } require('@stackbit/schema-utils');

const stackbitYaml = await generator.generate({
  dir: proccess.cwd()
  pagesDir: path.join(proccess.cwd(), 'content'),
  dataDir: path.join(proccess.cwd(), 'data')
});

stackbit.yaml validator

To validate stackbit.yaml located in current folder use the following command:

stackbit validate

Or using the npx command:

> npx @stackbit/cli validate

You can also use the validator in node:

npm install @stackbit/schema-utils
const { validator } require('@stackbit/schema-utils');

const result = await validator.validate({
  dir: process.cwd()
});

stackbit.yaml editor

To edit stackbit.yaml located in current folder use the following command:

stackbit edit

Or using the npx command:

npx @stackbit/cli edit

Ready to get started?