Super excited to announce the release of the Makerkit CLI, a command-line tool that helps you build and manage your Makerkit projects 🚀
The CLI is a set of commands that help you manage your Makerkit SaaS Starter Kits. It can help you with:
- Starting a new Project: Generating any of the SaaS Starter Kits in one simple command
- Plugins: Installing and updating the plugins available for your SaaS Starter Kit
- Translations: Managing your i18n files - translate them, verify them, and more
- Content Generation: Generating blog posts using the OpenAI API
... with more features coming soon, including dynamic code generation.
Your can run commands using
npx @makerkit/cli@latest <command>
Simply replace the examples below with
npx @makerkit/cli@latest instead of
makerkit to run the commands without installing the CLI globally.
This allows you to always run the latest version of the CLI without having to update it.
Running the CLI without any arguments will display the help:
Usage: makerkit [options] [command] Your SaaS Kit companion. Add plugins, manage migrations, and more. Options: display the version number output the version number -h, --help display help for command Commands: new Initialize a new Makerkit project plugins List and install plugins. i18n Manage and translate your i18n files license Manage Licenses blog Manage and generate your blog posts help [command] display help for command
To use the generative AI features of the CLI, you will need to add an OpenAI key.
To do so, create a
.env.local file if it does not exist yet, and add the
following environment variable:
This key will be used to generate the prompts for your blog posts. It remains locally on your computer and is not shared with anyone.
At the moment of writing, the CLI only uses the OpenAI API to generate:
- Translations for your i18n files
- Blog Posts
To create a new Makerkit project, you can use the
> npx @makerkit/cli@latest new
The CLI will prompt you to select a starter kit to use and a name. Once selected, the CLI will create a new project in the current directory by pulling the starter kit from GitHub.
The command will also install the dependencies.
The CLI can help you manage plugins in your project. You can list the available plugins, install them, and update them.
To list the available plugins, you can use the
plugins list command:
> npx @makerkit/cli@latest plugins list Available plugins: - cookie-banner
To install a plugin, you can use the
plugins install command:
> npx @makerkit/cli@latest plugins install
This command will prompt you to select a plugin to install. Once selected, the plugin will be installed in your project.
To update a plugin, you can use the
plugins update command:
> npx @makerkit/cli@latest plugins update
This command will prompt you to select a plugin to update. Once selected, the plugin will be updated in your project.
The CLI can help you manage your i18n files. You can translate from a locale to another (requires an OpenAI key), and verify that your translations are in sync between each other.
To translate your i18n files, you can use the
i18n translate command:
> npx @makerkit/cli@latest i18n translate en es
This command will translate all the keys in your
en/*.json file to
es/*. json. It will use the OpenAI API to translate the keys. You will need to
add a valid OpenAI API key in the
.env.local file of your Makerkit repository.
To verify that your i18n files are in sync, you can use the
i18n verify command:
> npx @makerkit/cli@latest i18n verify <base-locale>
If you omit the
base-locale argument, the command will use
en as the base.
The CLI can help you generate your blog posts.
NB: this command requires you to setup an OpenAI key.
To generate a new blog post, you can use the
blog generate command:
> npx @makerkit/cli@latest blog generate
You will be prompted to enter the following information:
- Title: The title of the blog post
- Category: The category of the blog post. At this time, this file needs to exist in your Makerkit repository. You can create it later.
- Word Count: The target word count of the blog post.
- Prompt: Any additional information you want to add to the prompt (optional).