Skip to content

Commit 704e5fd

Browse files
committed
refactor command & fix
1 parent 4a45da8 commit 704e5fd

File tree

24 files changed

+7958
-9120
lines changed

24 files changed

+7958
-9120
lines changed

README.md

Lines changed: 77 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -64,42 +64,51 @@ $ csdx content-type:details -a "management token" -c "content type" --no-path
6464

6565
## `csdx content-type:audit`
6666

67-
display recent changes to a Content Type
67+
Display recent changes to a Content Type
6868

6969
```
7070
USAGE
71-
$ csdx content-type:audit
71+
$ csdx content-type:audit -c <value> [-k <value> | -a <value>]
7272
73-
OPTIONS
74-
-a, --token-alias=token-alias management token alias
75-
-c, --content-type=content-type (required) Content Type UID
76-
-s, --stack=stack Stack UID
73+
FLAGS
74+
-a, --token-alias=<value> Management token alias
75+
-c, --content-type=<value> (required) Content Type UID
76+
-k, --stack=<value> Stack API Key
77+
78+
DESCRIPTION
79+
Display recent changes to a Content Type
7780
7881
EXAMPLES
79-
$ csdx content-type:audit -s "xxxxxxxxxxxxxxxxxxx" -c "home_page"
82+
$ csdx content-type:audit -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"
83+
8084
$ csdx content-type:audit -a "management token" -c "home_page"
8185
```
8286

8387
_See code: [src/commands/content-type/audit.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/audit.ts)_
8488

8589
## `csdx content-type:compare`
8690

87-
compare two Content Type versions
91+
Compare two Content Type versions
8892

8993
```
9094
USAGE
91-
$ csdx content-type:compare
95+
$ csdx content-type:compare -c <value> [-k <value> | -a <value>] [-l <value> -r <value>]
96+
97+
FLAGS
98+
-a, --token-alias=<value> Management token alias
99+
-c, --content-type=<value> (required) Content Type UID
100+
-k, --stack=<value> Stack API Key
101+
-l, --left=<value> Content Type version, i.e. prev version
102+
-r, --right=<value> Content Type version, i.e. later version
92103
93-
OPTIONS
94-
-a, --token-alias=token-alias management token alias
95-
-c, --content-type=content-type (required) Content Type UID
96-
-l, --left=left Content Type version, i.e. prev version
97-
-r, --right=right Content Type version, i.e. later version
98-
-s, --stack=stack Stack UID
104+
DESCRIPTION
105+
Compare two Content Type versions
99106
100107
EXAMPLES
101-
$ csdx content-type:compare -s "xxxxxxxxxxxxxxxxxxx" -c "home_page"
102-
$ csdx content-type:compare -s "xxxxxxxxxxxxxxxxxxx" -c "home_page" -l # -r #
108+
$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"
109+
110+
$ csdx content-type:compare -k "xxxxxxxxxxxxxxxxxxx" -c "home_page" -l # -r #
111+
103112
$ csdx content-type:compare -a "management token" -c "home_page" -l # -r #
104113
```
105114

@@ -111,81 +120,103 @@ compare two Content Types on different Stacks
111120

112121
```
113122
USAGE
114-
$ csdx content-type:compare-remote
123+
$ csdx content-type:compare-remote (-o <value> -r <value>) -c <value>
115124
116-
OPTIONS
117-
-c, --content-type=content-type (required) Content Type UID
118-
-o, --origin-stack=origin-stack (required) origin Stack UID
119-
-r, --remote-stack=remote-stack (required) remote Stack UID
125+
FLAGS
126+
-c, --content-type=<value> (required) Content Type UID
127+
-o, --origin-stack=<value> (required) Origin Stack API Key
128+
-r, --remote-stack=<value> (required) Remote Stack API Key
120129
121-
EXAMPLE
130+
DESCRIPTION
131+
compare two Content Types on different Stacks
132+
133+
EXAMPLES
122134
$ csdx content-type:compare-remote -o "xxxxxxxxxxxxxxxxxxx" -r "xxxxxxxxxxxxxxxxxxx" -c "home_page"
123135
```
124136

125137
_See code: [src/commands/content-type/compare-remote.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/compare-remote.ts)_
126138

127139
## `csdx content-type:details`
128140

129-
display Content Type details
141+
Display Content Type details
130142

131143
```
132144
USAGE
133-
$ csdx content-type:details
145+
$ csdx content-type:details -c <value> [-k <value> | -a <value>] [-p]
134146
135-
OPTIONS
136-
-a, --token-alias=token-alias management token alias
137-
-c, --content-type=content-type (required) Content Type UID
138-
-p, --[no-]path show path column
139-
-s, --stack=stack Stack UID
147+
FLAGS
148+
-a, --token-alias=<value> Management token alias
149+
-c, --content-type=<value> (required) Content Type UID
150+
-k, --stack=<value> Stack API Key
151+
-p, --[no-]path show path column
152+
153+
DESCRIPTION
154+
Display Content Type details
140155
141156
EXAMPLES
142-
$ csdx content-type:details -s "xxxxxxxxxxxxxxxxxxx" -c "home_page"
157+
$ csdx content-type:details -k "xxxxxxxxxxxxxxxxxxx" -c "home_page"
158+
143159
$ csdx content-type:details -a "management token" -c "home_page"
160+
144161
$ csdx content-type:details -a "management token" -c "home_page" --no-path
145162
```
146163

147164
_See code: [src/commands/content-type/details.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/details.ts)_
148165

149166
## `csdx content-type:diagram`
150167

151-
create a visual diagram of a Stack's Content Types
168+
Create a visual diagram of a Stack's Content Types
152169

153170
```
154171
USAGE
155-
$ csdx content-type:diagram
172+
$ csdx content-type:diagram -o <value> -d portrait|landscape -t svg|dot [-k <value> | -a <value>]
173+
174+
FLAGS
175+
-a, --token-alias=<value> Management token alias
176+
-d, --direction=<option> (required) [default: portrait] graph orientation
177+
<options: portrait|landscape>
178+
-k, --stack=<value> Stack API Key
179+
-o, --output=<value> (required) full path to output
180+
-t, --type=<option> (required) [default: svg] graph output file type
181+
<options: svg|dot>
156182
157-
OPTIONS
158-
-a, --token-alias=token-alias management token alias
159-
-d, --direction=portrait|landscape (required) [default: portrait] graph orientation
160-
-o, --output=output (required) full path to output
161-
-s, --stack=stack Stack UID
162-
-t, --type=svg|dot (required) [default: svg] graph output file type
183+
DESCRIPTION
184+
Create a visual diagram of a Stack's Content Types
163185
164186
EXAMPLES
165-
$ csdx content-type:diagram -s "xxxxxxxxxxxxxxxxxxx" -o "content-model.svg"
187+
$ csdx content-type:diagram -k "xxxxxxxxxxxxxxxxxxx" -o "content-model.svg"
188+
166189
$ csdx content-type:diagram -a "management token" -o "content-model.svg"
190+
167191
$ csdx content-type:diagram -a "management token" -o "content-model.svg" -d "landscape"
192+
168193
$ csdx content-type:diagram -a "management token" -o "content-model.dot" -t "dot"
169194
```
170195

171196
_See code: [src/commands/content-type/diagram.ts](https://github.com/Contentstack-Solutions/contentstack-cli-content-type/blob/v1.0.7/src/commands/content-type/diagram.ts)_
172197

173198
## `csdx content-type:list`
174199

175-
list all Content Types in a Stack
200+
List all Content Types in a Stack
176201

177202
```
178203
USAGE
179-
$ csdx content-type:list
204+
$ csdx content-type:list [-k <value> | -a <value>] [-o title|modified]
205+
206+
FLAGS
207+
-a, --token-alias=<value> Management token alias
208+
-k, --stack=<value> Stack API Key
209+
-o, --order=<option> [default: title] order by column
210+
<options: title|modified>
180211
181-
OPTIONS
182-
-a, --token-alias=token-alias management token alias
183-
-o, --order=title|modified [default: title] order by column
184-
-s, --stack=stack Stack UID
212+
DESCRIPTION
213+
List all Content Types in a Stack
185214
186215
EXAMPLES
187216
$ csdx content-type:list -s "xxxxxxxxxxxxxxxxxxx"
217+
188218
$ csdx content-type:list -a "management token"
219+
189220
$ csdx content-type:list -a "management token" -o modified
190221
```
191222

bin/run

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env node
22

3-
require('@oclif/command').run()
4-
.catch(require('@oclif/errors/handle'))
3+
(async () => {
4+
const { execute } = require('@contentstack/cli-utilities')
5+
await execute({ type: 'cjs', dir: __dirname })
6+
})()

0 commit comments

Comments
 (0)