@@ -10,9 +10,13 @@ You found an issue?<br>Tell us about it - <a href="https://github.com/storyblok/
1010[ ![ GitHub issues] ( https://img.shields.io/github/issues/storyblok/storyblok.svg?style=flat-square&v=1 )] ( https://github.com/storyblok/storyblok/issues?q=is%3Aopen+is%3Aissue )
1111[ ![ GitHub closed issues] ( https://img.shields.io/github/issues-closed/storyblok/storyblok.svg?style=flat-square&v=1 )] ( https://github.com/storyblok/storyblok/issues?q=is%3Aissue+is%3Aclosed )
1212
13+ ## BREAKING CHANGE
14+
15+ We added the ` region ` option upon login. If you are using the CLI, please ` logout ` and ` login ` again providing your user region.
16+
1317## Installation
1418
15- Make sure you've node ` >= 9.11.0 ` installed.
19+ Make sure you have Node ` >= 9.11.0 ` installed.
1620
1721``` sh
1822$ npm i storyblok -g
@@ -28,12 +32,24 @@ Usage to kickstart a boilerplate, fieldtype or theme
2832$ storyblok select
2933```
3034
35+ ### pull-languages
36+
37+ Download your space's languages schema as json. This command will download 1 file.
38+
39+ ``` sh
40+ $ storyblok pull-languages --space < SPACE_ID>
41+ ```
42+
43+ #### Options
44+
45+ * ` space ` : your space id
46+
3147### pull-components
3248
3349Download your space's components schema as json. This command will download 2 files: 1 for the components and 1 for the presets.
3450
3551``` sh
36- $ storyblok pull-components --space < SPACE_ID>
52+ $ storyblok pull-components --space < SPACE_ID> --region < REGION >
3753```
3854
3955#### Options
@@ -45,7 +61,7 @@ $ storyblok pull-components --space <SPACE_ID>
4561Push your components file to your/another space
4662
4763``` sh
48- $ storyblok push-components < SOURCE> --space < SPACE_ID> --presets-source < PRESETS_SOURCE>
64+ $ storyblok push-components < SOURCE> --space < SPACE_ID> --region < REGION > -- presets-source < PRESETS_SOURCE>
4965```
5066
5167#### Parameters
@@ -83,6 +99,65 @@ Using a **path** to file
8399$ storyblok push-components ./components.json --presets-source ./presets.json --space 67819
84100```
85101
102+ ### delete-component
103+
104+ Delete a single component on your space.
105+
106+ ``` sh
107+ storyblok delete-component < component> --space < SPACE_ID>
108+ ```
109+
110+ #### Parameters
111+ * ` component ` : The name or id of the component
112+
113+ #### Options
114+ * ` space_id ` : the space where the command should be executed.
115+
116+ #### Examples
117+
118+ Delete a component on your space.
119+ ``` sh
120+ storyblok delete-component 111111 --space 67819
121+ ```
122+
123+ ``` sh
124+ storyblok delete-component teaser --space 67819
125+ ```
126+
127+ ### delete-components
128+
129+ Delete all components from your Space that occur in your Local JSON.
130+ Or delete those components on your Space that do not appear in the JSON. (` --reverse ` )
131+
132+ ``` sh
133+ storyblok delete-components < SOURCE> --space < SPACE_ID>
134+ ```
135+
136+ #### Parameters
137+ * ` source ` : can be a URL or path to JSON file.
138+
139+ #### Options
140+ * ` space_id ` : the space where the command should be executed.
141+ * ` reverse ` : When passed as an argument, deletes only those components on your space that do not appear in the JSON.
142+ * ` dryrun ` : when passed as an argument, does not perform any changes on the given space.
143+
144+ #### Examples
145+
146+ Delete all components on a certain space that occur in your local JSON.
147+ ``` sh
148+ storyblok delete-components ./components.json --space 67819
149+ ```
150+
151+ Delete only those components which do not occur in your local json from your space.
152+ ``` sh
153+ storyblok delete-components ./components.json --space 67819 --reverse
154+ ```
155+
156+ To see the result in your console output but to not perform the command on your space, use the ` --dryrun ` argument.
157+ ``` sh
158+ storyblok delete-components ./components.json --space 67819 --reverse --dryrun
159+ ```
160+
86161### sync
87162
88163Sync components, folder, roles, datasources or stories between spaces
@@ -130,6 +205,19 @@ Login to the Storyblok cli
130205``` sh
131206$ storyblok login
132207```
208+ #### Options
209+
210+ * ` email ` : your user's email address
211+ * ` password ` : your user's password
212+ * ` region ` : your user's region (default: ` eu ` ). You can use ` us ` , ` cn ` or ` eu ` . This region will be used for the other cli's commands.
213+
214+ ### user
215+
216+ Get the currently logged in user
217+
218+ ``` sh
219+ $ storyblok user
220+ ```
133221
134222### generate-migration
135223
@@ -138,6 +226,7 @@ Create a migration file (with the name `change_<COMPONENT>_<FIELD>.js`) inside t
138226``` sh
139227$ storyblok generate-migration --space < SPACE_ID> --component < COMPONENT_NAME> --field < FIELD>
140228```
229+ It's important to note that the ` component ` and ` field ` parameters are required and must be spelled exactly as they are in Storyblok. You can check the exact name by looking at the ` Block library ` inside your space.
141230
142231#### Options
143232
@@ -189,6 +278,7 @@ $ storyblok rollback-migration --space 1234 --component Product --field title
189278
190279### spaces
191280
281+
192282List all spaces of the logged account
193283
194284``` sh
@@ -275,7 +365,7 @@ $ storyblok -V # or --version
275365
276366Content migrations are a convenient way to change fields of your content.
277367
278- To execute a migration you first need to create a migration file. This file is a pure Javascript function where the content of a specific content type or compontent gets passed through.
368+ To execute a migration you first need to create a migration file. This file is a pure Javascript function where the content of a specific content type or component gets passed through.
279369
280370### 1. Creating a migration file
281371
0 commit comments