@@ -19,17 +19,21 @@ The cli allows you to run transforms either from the [community folder](https://
19
19
20
20
## Usage/Installation
21
21
22
- We recommend running the CLI with ` npx ` to ensure you always have the latest version.
22
+ We recommend running the CLI with ` $ npx` to ensure you always have the latest version.
23
23
24
24
` $ npx @codeshift/cli --packages mylib@1.0.0 /project/src `
25
25
26
26
But it can also be installed normally:
27
27
28
- ` npm install -g @codeshift/cli ` or ` yarn global add @codeshift/cli `
28
+ ` $ npm install --save-dev @codeshift/cli` or ` yarn add -D @codeshift/cli `
29
29
30
30
Or globally:
31
31
32
- ` npm install --save-dev @codeshift/cli ` or ` yarn add -D @codeshift/cli `
32
+ ` $ npm install -g @codeshift/cli ` or ` yarn global add @codeshift/cli `
33
+
34
+ and run with:
35
+
36
+ ` $ codeshift-cli `
33
37
34
38
## Options
35
39
@@ -39,17 +43,17 @@ The transform to run, transforms can be either a single file or directory with a
39
43
40
44
** example:**
41
45
42
- - ` npx @ codeshift/ cli --transform codemods/my-special-mod /project/src/file.js`
43
- - ` npx @ codeshift/ cli --transform codemods/my-special-mod/index.ts /project/src/file.js`
46
+ - ` $ codeshift- cli --transform codemods/my-special-mod /project/src/file.js`
47
+ - ` $ codeshift- cli --transform codemods/my-special-mod/index.ts /project/src/file.js`
44
48
45
49
### --packages
46
50
47
51
Runs transforms for the specified comma separated list of packages, optionally include a version for each package to run all transforms since that version
48
52
49
53
** example:**
50
54
51
- - ` npx @ codeshift/ cli --packages @atlaskit/button /project/src`
52
- - ` npx @ codeshift/ cli --packages @atlaskit/button@3.0.0,@atlaskit/range@4.0.0 /project/src`
55
+ - ` $ codeshift- cli --packages @atlaskit/button /project/src`
56
+ - ` $ codeshift- cli --packages @atlaskit/button@3.0.0,@atlaskit/range@4.0.0 /project/src`
53
57
54
58
### --parser, -p
55
59
@@ -65,42 +69,42 @@ Parser to use for parsing the source files you are code modding.
65
69
66
70
** example:**
67
71
68
- - ` npx @ codeshift/ cli --parser tsx /project/src/file.ts`
69
- - ` npx @ codeshift/ cli -p babel /project/src/file.js`
72
+ - ` $ codeshift- cli --parser tsx /project/src/file.ts`
73
+ - ` $ codeshift- cli -p babel /project/src/file.js`
70
74
71
75
### --extensions, -e
72
76
73
77
Transform files with these file extensions (comma separated list) (default: js)
74
78
75
79
** example:**
76
80
77
- - ` npx @ codeshift/ cli --extensions ts,tsx /project/src/file.js`
78
- - ` npx @ codeshift/ cli -e js /project/src/file.js`
81
+ - ` $ codeshift- cli --extensions ts,tsx /project/src/file.js`
82
+ - ` $ codeshift- cli -e js /project/src/file.js`
79
83
80
84
### --ignore-pattern
81
85
82
86
Ignore files that match a provided glob expression
83
87
84
88
** example:**
85
89
86
- - ` @ codeshift/ cli --ignore-pattern node_modules /project/src/file.js`
90
+ - ` $ codeshift- cli --ignore-pattern node_modules /project/src/file.js`
87
91
88
92
### --version, -v
89
93
90
94
Get current version number
91
95
92
96
** example:**
93
97
94
- - ` @ codeshift/ cli --version`
95
- - ` @ codeshift/ cli -v`
98
+ - ` $ codeshift- cli --version`
99
+ - ` $ codeshift- cli -v`
96
100
97
101
### --help
98
102
99
103
Print all help text to the command line
100
104
101
105
** example:**
102
106
103
- - ` @ codeshift/ cli --help`
107
+ - ` $ codeshift- cli --help`
104
108
105
109
## Commands
106
110
@@ -112,11 +116,11 @@ Lists available codemods for the provided packages
112
116
113
117
Print a list of available codemods for a single package
114
118
115
- - ` @ codeshift/ cli list mylib`
119
+ - ` $ codeshift- cli list mylib`
116
120
117
121
Print a list of available codemods for multiple packages
118
122
119
- - ` @ codeshift/ cli list mylib, @material-ui/button`
123
+ - ` $ codeshift- cli list mylib, @material-ui/button`
120
124
121
125
### init
122
126
@@ -127,7 +131,7 @@ Generates a new codemod at your desired path
127
131
Create a new codemod package called foobar with a transform for version 10
128
132
on the Desktop
129
133
130
- - ` @ codeshift/ cli init --packageName="foobar" --version"10.0.0" ~/Desktop`
134
+ - ` $ codeshift- cli init --packageName="foobar" --version"10.0.0" ~/Desktop`
131
135
132
136
### validate
133
137
@@ -137,8 +141,8 @@ Validates a codemod package at the desired path.
137
141
138
142
Validate a codemod package called "my-codemods".
139
143
140
- - ` $ npx @ codeshift/ cli validate ./codemods/my-codemods `
144
+ - ` $ codeshift- cli validate ./codemods/my-codemods `
141
145
142
146
Validate a codemod package from the current working directory
143
147
144
- - ` $ npx @ codeshift/ cli validate `
148
+ - ` $ codeshift- cli validate `
0 commit comments