@makerkit/cli 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +179 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +734 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# A CLI for the Makerkit SaaS Starter Kits
|
|
2
|
+
|
|
3
|
+
The CLI is a set of commands that help you manage your Makerkit SaaS Starter Kits.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
To install the CLI, you can use npm:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install -g @makerkit/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
You may need to use `sudo` to install the CLI globally.
|
|
14
|
+
|
|
15
|
+
Alternatively, your can run commands using `npx`:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npx @makerkit/cli@latest <command>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Simply replace the examples below with `npx @makerkit/cli@latest` instead of
|
|
22
|
+
`makerkit` to run the commands without installing the CLI globally.
|
|
23
|
+
|
|
24
|
+
Using `npx @makerkit/cli@latest` is recommended.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
Running the CLI without any arguments will display the help:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Usage: makerkit [options] [command]
|
|
32
|
+
|
|
33
|
+
Your SaaS Kit companion. Add plugins, manage migrations, and more.
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
display the version number output the version number
|
|
37
|
+
-h, --help display help for command
|
|
38
|
+
|
|
39
|
+
Commands:
|
|
40
|
+
new Initialize a new Makerkit project
|
|
41
|
+
plugins List and install plugins.
|
|
42
|
+
i18n Manage and translate your i18n files
|
|
43
|
+
license Manage Licenses
|
|
44
|
+
blog Manage and generate your blog posts
|
|
45
|
+
help [command] display help for command
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Adding an OpenAI Key (optional)
|
|
49
|
+
|
|
50
|
+
To use the generative AI features of the CLI, you will need to add an OpenAI
|
|
51
|
+
key.
|
|
52
|
+
|
|
53
|
+
To do so, create a `.env.local` file if it does not exist yet, and add the
|
|
54
|
+
following environment variable:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
OPENAI_API_KEY=<your-key>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This key will be used to generate the prompts for your blog posts. It
|
|
61
|
+
remains locally on your computer and is not shared with anyone.
|
|
62
|
+
|
|
63
|
+
At the moment of writing, the CLI only uses the OpenAI API to generate:
|
|
64
|
+
1. Translations for your i18n files
|
|
65
|
+
2. Blog Posts
|
|
66
|
+
|
|
67
|
+
## Creating a new Makerkit project
|
|
68
|
+
|
|
69
|
+
To create a new Makerkit project, you can use the `new` command:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
> makerkit new
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The CLI will prompt you to select a starter kit to use and a name. Once
|
|
76
|
+
selected, the CLI will create a new project in the current directory by
|
|
77
|
+
pulling the starter kit from GitHub.
|
|
78
|
+
|
|
79
|
+
The command will also install the dependencies.
|
|
80
|
+
|
|
81
|
+
## Plugins
|
|
82
|
+
|
|
83
|
+
The CLI can help you manage plugins in your project. You can list the available plugins, install them, and update them.
|
|
84
|
+
|
|
85
|
+
### Listing plugins
|
|
86
|
+
|
|
87
|
+
To list the available plugins, you can use the `plugins list` command:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
> makerkit plugins list
|
|
91
|
+
|
|
92
|
+
Available plugins:
|
|
93
|
+
- cookie-banner
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Installing plugins
|
|
97
|
+
|
|
98
|
+
To install a plugin, you can use the `plugins install` command:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
> makerkit plugins install
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This command will prompt you to select a plugin to install. Once selected, the plugin will be installed in your project.
|
|
105
|
+
|
|
106
|
+
### Updating plugins
|
|
107
|
+
|
|
108
|
+
To update a plugin, you can use the `plugins update` command:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
> makerkit plugins update
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
This command will prompt you to select a plugin to update. Once selected, the plugin will be updated in your project.
|
|
115
|
+
|
|
116
|
+
## i18n
|
|
117
|
+
|
|
118
|
+
The CLI can help you manage your i18n files. You can translate from a locale
|
|
119
|
+
to another (requires an OpenAI key), and verify that your translations are
|
|
120
|
+
in sync between each other.
|
|
121
|
+
|
|
122
|
+
### Translating
|
|
123
|
+
|
|
124
|
+
To translate your i18n files, you can use the `i18n translate` command:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
> makerkit i18n translate en es
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This command will translate all the keys in your `en/*.json` file to `es/*.
|
|
131
|
+
json`. It will use the OpenAI API to translate the keys. You will need to
|
|
132
|
+
add a valid OpenAI API key in the `.env.local` file of your Makerkit repository.
|
|
133
|
+
|
|
134
|
+
### Verifying
|
|
135
|
+
|
|
136
|
+
To verify that your i18n files are in sync, you can use the `i18n verify` command:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
> makerkit i18n verify <base-locale>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
If you omit the `base-locale` argument, the command will use `en` as the base.
|
|
143
|
+
|
|
144
|
+
## Blog
|
|
145
|
+
|
|
146
|
+
The CLI can help you generate your blog posts.
|
|
147
|
+
|
|
148
|
+
NB: this command requires you to setup an OpenAI key.
|
|
149
|
+
|
|
150
|
+
### Generating a new blog post
|
|
151
|
+
|
|
152
|
+
To generate a new blog post, you can use the `blog generate` command:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
> makerkit blog generate
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
You will be prompted to enter the following information:
|
|
159
|
+
1. **Title**: The title of the blog post
|
|
160
|
+
2. **Category**: The category of the blog post. At this time, this file
|
|
161
|
+
needs to exist in
|
|
162
|
+
your Makerkit repository. You can create it later.
|
|
163
|
+
3. **Word Count**: The target word count of the blog post.
|
|
164
|
+
4. **Prompt**: Any additional information you want to add to the prompt
|
|
165
|
+
(optional).
|
|
166
|
+
|
|
167
|
+
## Licenses
|
|
168
|
+
|
|
169
|
+
The CLI can help you manage your licenses.
|
|
170
|
+
|
|
171
|
+
### Activating your Makerkit License
|
|
172
|
+
|
|
173
|
+
To activate your Makerkit license, you can use the `license activate` command:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
> makerkit license activate
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
This command will prompt you to enter your license key and your Github username. Once entered, the command will activate your license.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|