-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathcsdx.ts
335 lines (334 loc) · 9.37 KB
/
csdx.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
const completionSpec: Fig.Spec = {
name: "csdx",
description: "Content Stack CLI",
subcommands: [
{
name: "login",
description:
"The auth:login command lets you log in to Contentstack and save the session",
options: [
{
name: ["-u", "--username"],
description: "Email address of your Contentstack account",
args: {
name: "email address",
},
isRequired: true,
},
{
name: ["-p", "--password"],
description: "Password can be passed in command",
args: {
name: "password",
},
},
],
},
{
name: "auth:tokens:add",
description:
"Lets you add an existing management token from your Contentstack account and save it to the session for further use",
options: [
{
name: ["-a", "--alias"],
description: "Alias (name) you want to assign to the token",
args: {
name: "alias",
},
isRequired: true,
},
{
name: "--management",
description: "Alias (name) you want to assign to the token",
},
{
name: "--delivery",
description: "Flag to set delivery token",
},
{
name: ["-k", "--stack-api-key"],
description: "API key of the stack where the token exists",
args: {
name: "stack-api-key",
},
isRequired: true,
},
{
name: "--token",
description: "Value of the token",
args: {
name: "token",
},
dependsOn: ["--stack-api-key"],
},
{
name: ["-f", "--force"],
description: "Force token replace",
},
],
},
{
name: "auth:tokens:remove",
description:
"The auth:tokens:remove command lets you delete a management/ delivery token from your local CLI session",
options: [
{
name: ["-a", "--alias"],
description: "Alias (name) you want to assign to the token",
args: {
name: "alias",
},
isRequired: true,
},
{
name: ["-i", "--ignore"],
description: "Ignores if token not present. Command",
},
],
},
{
name: "cm:bootstrap",
description:
"The 'Bootstrap' plugin in Contentstack CLI allows users to automate the process of project setup for starter apps",
options: [
{
name: "--app-name",
description:
"The name of the starter app you want to use. Example: reactjs-starter, nextjs-starter, gatsby-starter, angular-starter, nuxt-starter",
args: {
name: "app-name",
suggestions: [
{
name: "reactjs-starter",
},
{ name: "nextjs-starter" },
{ name: "gatsby-starter" },
{ name: "angular-starter" },
{ name: "nuxt-starter" },
],
},
},
{
name: "--project-dir",
description:
"Directory/path to setup the project. If directory name has a space then provide the path as a string or escap the space using back slash as shown in the below example",
args: {
name: "project-dir",
},
},
{
name: "--app-type",
description: "Sample or Starter app",
args: {
name: "app-type",
suggestions: [{ name: "Sample" }, { name: "Starter" }],
},
},
{
name: ["-k", "--stack-api-key"],
description: "Provide stack API key to seed content",
args: {
name: "stack-api-key",
},
},
{
name: "--org",
description: "Provide organization UID to create a new stack",
args: {
name: "org",
},
},
{
name: ["-n", "--stack-name"],
description: "Name of the new stack that will be created",
args: {
name: "stack-name",
},
},
],
},
{
name: "auth:tokens",
description:
"The auth:tokens command lists the existing tokens added to the session",
options: [
{
name: ["-x", "--extended"],
description: "To show extra columns",
},
{
name: "--columns",
description: "To display specific columns, separated by comma",
args: {
name: "columns",
},
},
{
name: "--csv",
description: "Output is csv format",
},
{
name: "--filter",
description:
"To filter the property by partial string matching, ex: name=foo",
args: {
name: "filter",
},
},
{
name: "--no-header",
description: "To hide table’s header in output",
},
{
name: "--no-truncate",
description: "To not truncate output to fit screen",
},
{
name: "--output",
description: "To display output in a particular format",
args: {
name: "format",
suggestions: [{ name: "csv" }, { name: "json" }, { name: "yaml" }],
},
},
{
name: "--sort",
description:
"To sort the list, prepend '-' to sort in a descending order",
args: {
name: "sort",
},
},
],
},
{
name: "config:get:region",
description:
"The config:get:region command will return the name of the region on which you are performing actions in Contentstack, via the CLI",
},
{
name: "config:set:region",
description:
"The config:set:region command lets you select a region, from the available Contentstack regions, to perform actions using the CLI",
args: {
name: "region",
description: "The ContentStack AWS region you want to use",
suggestions: [
{
name: "EU",
displayName: "Europe",
type: "option",
},
{
name: "AZURE-NA",
displayName: "Azure North America",
type: "option",
},
{
name: "NA",
displayName: "North America",
type: "option",
priority: 100,
},
],
},
},
{
name: "cm:stacks:export",
description:
"The cm:stacks:export command lets you export content from one stack to another",
options: [
{
name: ["-c", "--config"],
description: "[optional] path of the config",
args: {
name: "config",
},
},
{
name: ["-k", "--stack-api-key"],
description: "API key of the source stack",
args: {
name: "stack-api-key",
},
},
{
name: ["-a", "--alias"],
description:
"The management token of the source stack from which you will export content",
args: {
name: "alias",
},
},
{
name: ["-d", "--data-dir"],
description:
"The path or the location in your file system to store the exported content. For e.g., ./content",
args: {
name: "data-dir",
},
},
{
name: "--branch",
description:
"The name of the branch where you want to export your content. If you don’t mention the branch name, then by default the content will be exported from all the branches of your stack",
args: {
name: "branch",
},
},
{
name: "--module",
description:
"[optional] Specific module name. If not specified, the export command will export all the modules to the stack. The available modules are assets, content-types, entries, environments, extensions, global-fields, labels, locales, webhooks, and workflows",
args: {
name: "module",
suggestions: [
"assets",
"content-types",
"entries",
"environments",
"extensions",
"global-fields",
"labels",
"locales",
"webhooks",
"workflows",
],
},
},
{
name: "--content-types",
description: "[optional] content type",
args: {
name: "content-types",
},
},
{
name: "--secured-assets",
description: "[optional] use when assets are secured",
args: {
name: "secured-assets",
},
},
],
},
{
name: "logout",
description:
"The auth:logout command lets you log out of Contentstack and clear the session",
},
{
name: "whoami",
description:
"The csdx auth:whoami command returns the username (email address) of the user who is currently logged in to the session",
},
],
options: [
{
name: ["--help", "-h"],
description: "Show help for csdx",
isPersistent: true,
},
],
};
export default completionSpec;