directus-template-cli 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -1,314 +1,19 @@
1
- ⚠️ WARNING: DO NOT USE ⚠️
2
- Very Very Alpha State
3
- =================
1
+ # Directus Template CLI
4
2
 
5
- oclif example Hello World CLI
3
+ A CLI tool to apply Directus "templates" to a blank Directus instance.
6
4
 
7
- [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
8
- [![Version](https://img.shields.io/npm/v/oclif-hello-world.svg)](https://npmjs.org/package/oclif-hello-world)
9
- [![CircleCI](https://circleci.com/gh/oclif/hello-world/tree/main.svg?style=shield)](https://circleci.com/gh/oclif/hello-world/tree/main)
10
- [![Downloads/week](https://img.shields.io/npm/dw/oclif-hello-world.svg)](https://npmjs.org/package/oclif-hello-world)
11
- [![License](https://img.shields.io/npm/l/oclif-hello-world.svg)](https://github.com/oclif/hello-world/blob/main/package.json)
5
+ Note: This is a pre-release. It is recommended for use on POC or demo projects only.
12
6
 
13
- <!-- toc -->
14
- * [Usage](#usage)
15
- * [Commands](#commands)
16
- <!-- tocstop -->
17
- # Usage
18
- <!-- usage -->
19
- ```sh-session
20
- $ npm install -g directus-template-cli
21
- $ directus-template-cli COMMAND
22
- running command...
23
- $ directus-template-cli (--version)
24
- directus-template-cli/0.1.2 darwin-x64 node-v18.12.1
25
- $ directus-template-cli --help [COMMAND]
26
- USAGE
27
- $ directus-template-cli COMMAND
28
- ...
29
- ```
30
- <!-- usagestop -->
31
- # Commands
32
- <!-- commands -->
33
- * [`directus-template-cli apply`](#directus-template-cli-apply)
34
- * [`directus-template-cli help [COMMANDS]`](#directus-template-cli-help-commands)
35
- * [`directus-template-cli plugins`](#directus-template-cli-plugins)
36
- * [`directus-template-cli plugins:install PLUGIN...`](#directus-template-cli-pluginsinstall-plugin)
37
- * [`directus-template-cli plugins:inspect PLUGIN...`](#directus-template-cli-pluginsinspect-plugin)
38
- * [`directus-template-cli plugins:install PLUGIN...`](#directus-template-cli-pluginsinstall-plugin-1)
39
- * [`directus-template-cli plugins:link PLUGIN`](#directus-template-cli-pluginslink-plugin)
40
- * [`directus-template-cli plugins:uninstall PLUGIN...`](#directus-template-cli-pluginsuninstall-plugin)
41
- * [`directus-template-cli plugins:uninstall PLUGIN...`](#directus-template-cli-pluginsuninstall-plugin-1)
42
- * [`directus-template-cli plugins:uninstall PLUGIN...`](#directus-template-cli-pluginsuninstall-plugin-2)
43
- * [`directus-template-cli plugins update`](#directus-template-cli-plugins-update)
44
-
45
- ## `directus-template-cli apply`
46
-
47
- Apply a template to a blank Directus instance.
48
-
49
- ```
50
- USAGE
51
- $ directus-template-cli apply
52
-
53
- DESCRIPTION
54
- Apply a template to a blank Directus instance.
55
-
56
- EXAMPLES
57
- $ directus-template-cli apply
58
- ```
59
-
60
- _See code: [dist/commands/apply.ts](https://github.com/bryantgillespie/directus-template-cli/blob/v0.1.2/dist/commands/apply.ts)_
61
-
62
- ## `directus-template-cli help [COMMANDS]`
63
-
64
- Display help for directus-template-cli.
65
-
66
- ```
67
- USAGE
68
- $ directus-template-cli help [COMMANDS] [-n]
69
-
70
- ARGUMENTS
71
- COMMANDS Command to show help for.
72
-
73
- FLAGS
74
- -n, --nested-commands Include all nested commands in the output.
75
-
76
- DESCRIPTION
77
- Display help for directus-template-cli.
78
- ```
79
-
80
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.9/src/commands/help.ts)_
81
-
82
- ## `directus-template-cli plugins`
83
-
84
- List installed plugins.
85
-
86
- ```
87
- USAGE
88
- $ directus-template-cli plugins [--core]
89
-
90
- FLAGS
91
- --core Show core plugins.
92
-
93
- DESCRIPTION
94
- List installed plugins.
95
-
96
- EXAMPLES
97
- $ directus-template-cli plugins
98
- ```
99
-
100
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.7/src/commands/plugins/index.ts)_
101
-
102
- ## `directus-template-cli plugins:install PLUGIN...`
103
-
104
- Installs a plugin into the CLI.
7
+ ## Usage
105
8
 
9
+ 1. Create a Directus instance on [Directus Cloud](https://directus.cloud) or using self-hosted version.
10
+ 2. Login and create a Static Access Token for the admin user.
11
+ 3. Copy the static token and your Directus URL.
12
+ 4. Run the following command on the terminal and follow the prompts.
106
13
  ```
107
- USAGE
108
- $ directus-template-cli plugins:install PLUGIN...
109
-
110
- ARGUMENTS
111
- PLUGIN Plugin to install.
112
-
113
- FLAGS
114
- -f, --force Run yarn install with force flag.
115
- -h, --help Show CLI help.
116
- -v, --verbose
117
-
118
- DESCRIPTION
119
- Installs a plugin into the CLI.
120
- Can be installed from npm or a git url.
121
-
122
- Installation of a user-installed plugin will override a core plugin.
123
-
124
- e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
125
- will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
126
- the CLI without the need to patch and update the whole CLI.
127
-
128
-
129
- ALIASES
130
- $ directus-template-cli plugins add
131
-
132
- EXAMPLES
133
- $ directus-template-cli plugins:install myplugin
134
-
135
- $ directus-template-cli plugins:install https://github.com/someuser/someplugin
136
-
137
- $ directus-template-cli plugins:install someuser/someplugin
14
+ $ npx directus-template-cli apply
138
15
  ```
139
16
 
140
- ## `directus-template-cli plugins:inspect PLUGIN...`
141
-
142
- Displays installation properties of a plugin.
143
-
144
- ```
145
- USAGE
146
- $ directus-template-cli plugins:inspect PLUGIN...
147
-
148
- ARGUMENTS
149
- PLUGIN [default: .] Plugin to inspect.
150
-
151
- FLAGS
152
- -h, --help Show CLI help.
153
- -v, --verbose
154
-
155
- GLOBAL FLAGS
156
- --json Format output as json.
157
-
158
- DESCRIPTION
159
- Displays installation properties of a plugin.
160
-
161
- EXAMPLES
162
- $ directus-template-cli plugins:inspect myplugin
163
- ```
164
-
165
- ## `directus-template-cli plugins:install PLUGIN...`
166
-
167
- Installs a plugin into the CLI.
168
-
169
- ```
170
- USAGE
171
- $ directus-template-cli plugins:install PLUGIN...
172
-
173
- ARGUMENTS
174
- PLUGIN Plugin to install.
175
-
176
- FLAGS
177
- -f, --force Run yarn install with force flag.
178
- -h, --help Show CLI help.
179
- -v, --verbose
17
+ ## License
180
18
 
181
- DESCRIPTION
182
- Installs a plugin into the CLI.
183
- Can be installed from npm or a git url.
184
-
185
- Installation of a user-installed plugin will override a core plugin.
186
-
187
- e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
188
- will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
189
- the CLI without the need to patch and update the whole CLI.
190
-
191
-
192
- ALIASES
193
- $ directus-template-cli plugins add
194
-
195
- EXAMPLES
196
- $ directus-template-cli plugins:install myplugin
197
-
198
- $ directus-template-cli plugins:install https://github.com/someuser/someplugin
199
-
200
- $ directus-template-cli plugins:install someuser/someplugin
201
- ```
202
-
203
- ## `directus-template-cli plugins:link PLUGIN`
204
-
205
- Links a plugin into the CLI for development.
206
-
207
- ```
208
- USAGE
209
- $ directus-template-cli plugins:link PLUGIN
210
-
211
- ARGUMENTS
212
- PATH [default: .] path to plugin
213
-
214
- FLAGS
215
- -h, --help Show CLI help.
216
- -v, --verbose
217
-
218
- DESCRIPTION
219
- Links a plugin into the CLI for development.
220
- Installation of a linked plugin will override a user-installed or core plugin.
221
-
222
- e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
223
- command will override the user-installed or core plugin implementation. This is useful for development work.
224
-
225
-
226
- EXAMPLES
227
- $ directus-template-cli plugins:link myplugin
228
- ```
229
-
230
- ## `directus-template-cli plugins:uninstall PLUGIN...`
231
-
232
- Removes a plugin from the CLI.
233
-
234
- ```
235
- USAGE
236
- $ directus-template-cli plugins:uninstall PLUGIN...
237
-
238
- ARGUMENTS
239
- PLUGIN plugin to uninstall
240
-
241
- FLAGS
242
- -h, --help Show CLI help.
243
- -v, --verbose
244
-
245
- DESCRIPTION
246
- Removes a plugin from the CLI.
247
-
248
- ALIASES
249
- $ directus-template-cli plugins unlink
250
- $ directus-template-cli plugins remove
251
- ```
252
-
253
- ## `directus-template-cli plugins:uninstall PLUGIN...`
254
-
255
- Removes a plugin from the CLI.
256
-
257
- ```
258
- USAGE
259
- $ directus-template-cli plugins:uninstall PLUGIN...
260
-
261
- ARGUMENTS
262
- PLUGIN plugin to uninstall
263
-
264
- FLAGS
265
- -h, --help Show CLI help.
266
- -v, --verbose
267
-
268
- DESCRIPTION
269
- Removes a plugin from the CLI.
270
-
271
- ALIASES
272
- $ directus-template-cli plugins unlink
273
- $ directus-template-cli plugins remove
274
- ```
275
-
276
- ## `directus-template-cli plugins:uninstall PLUGIN...`
277
-
278
- Removes a plugin from the CLI.
279
-
280
- ```
281
- USAGE
282
- $ directus-template-cli plugins:uninstall PLUGIN...
283
-
284
- ARGUMENTS
285
- PLUGIN plugin to uninstall
286
-
287
- FLAGS
288
- -h, --help Show CLI help.
289
- -v, --verbose
290
-
291
- DESCRIPTION
292
- Removes a plugin from the CLI.
293
-
294
- ALIASES
295
- $ directus-template-cli plugins unlink
296
- $ directus-template-cli plugins remove
297
- ```
298
-
299
- ## `directus-template-cli plugins update`
300
-
301
- Update installed plugins.
302
-
303
- ```
304
- USAGE
305
- $ directus-template-cli plugins update [-h] [-v]
306
-
307
- FLAGS
308
- -h, --help Show CLI help.
309
- -v, --verbose
310
-
311
- DESCRIPTION
312
- Update installed plugins.
313
- ```
314
- <!-- commandsstop -->
19
+ This template is licensed under the [MIT License](https://opensource.org/licenses/MIT).
@@ -6,13 +6,13 @@ const core_2 = require("@oclif/core");
6
6
  const inquirer = tslib_1.__importStar(require("inquirer"));
7
7
  const read_templates_1 = tslib_1.__importDefault(require("../lib/utils/read-templates"));
8
8
  const validate_url_1 = tslib_1.__importDefault(require("../lib/utils/validate-url"));
9
- const node_process_1 = require("node:process");
9
+ const node_path_1 = tslib_1.__importDefault(require("node:path"));
10
10
  const api_1 = require("../lib/api");
11
11
  const load_1 = tslib_1.__importDefault(require("../lib/load/"));
12
12
  const separator = '------------------';
13
13
  async function getTemplate() {
14
- const rootDir = (0, node_process_1.cwd)() + '/templates';
15
- const templates = await (0, read_templates_1.default)(rootDir);
14
+ const TEMPLATE_DIR = node_path_1.default.join(__dirname, '..', '..', 'templates');
15
+ const templates = await (0, read_templates_1.default)(TEMPLATE_DIR);
16
16
  const templateChoices = templates.map((template) => {
17
17
  return { name: template.templateName, value: template };
18
18
  });
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.2",
2
+ "version": "0.1.4",
3
3
  "commands": {
4
4
  "apply": {
5
5
  "id": "apply",
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "directus-template-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "CLI Utility for applying templates to a Directus instance.",
5
5
  "author": "bryantgillespie @bryantgillespie",
6
6
  "bin": {
7
7
  "directus-template-util": "./bin/run"
8
8
  },
9
- "homepage": "https://github.com/bryantgillespie/directus-template-cli",
9
+ "homepage": "https://github.com/directus-community/directus-template-cli",
10
10
  "license": "MIT",
11
11
  "main": "dist/index.js",
12
- "repository": "bryantgillespie/directus-template-cli",
12
+ "repository": "directus-community/directus-template-cli",
13
13
  "files": [
14
14
  "/bin",
15
15
  "/templates",
@@ -70,7 +70,7 @@
70
70
  "engines": {
71
71
  "node": ">=12.0.0"
72
72
  },
73
- "bugs": "https://github.com/bryantgillespie/directus-template-cli/issues",
73
+ "bugs": "https://github.com/directus-community/directus-template-cli/issues",
74
74
  "keywords": [
75
75
  "oclif"
76
76
  ],