Skip to content

Commit 49b5762

Browse files
committed
🐛 Codeshift CLI binary name now correctly set to "codeshift-cli"
1 parent 58d200c commit 49b5762

File tree

4 files changed

+36
-27
lines changed

4 files changed

+36
-27
lines changed

.changeset/hungry-months-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codeshift/cli': patch
3+
---
4+
5+
Updates cli identifier to the correct name + updates docs accordingly

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"license": "MIT",
88
"repository": "https://github.com/CodeshiftCommunity/CodeshiftCommunity/tree/master/packages/cli",
99
"bin": {
10-
"codemod-cli": "./bin/codeshift-cli.js"
10+
"codeshift-cli": "./bin/codeshift-cli.js"
1111
},
1212
"scripts": {
1313
"start": "./bin/codeshift-cli.js",

packages/cli/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ program
5252
`
5353
Examples:
5454
# Run a transform for "@mylib/button" version 3.0.0 only
55-
$ npx @codeshift/cli --packages @mylib/button@3.0.0 /project/src
55+
$ codeshift-cli --packages @mylib/button@3.0.0 /project/src
5656
5757
# Run all transforms for "@mylib/button" greater than version 3.0.0 and @mylib/range greater than 4.0.0
58-
$ npx @codeshift/cli --sequence --packages @mylib/button@3.0.0,@mylib/range@4.0.0 /project/src
58+
$ codeshift-cli --sequence --packages @mylib/button@3.0.0,@mylib/range@4.0.0 /project/src
5959
6060
# Run the "my-custom-transform" transform
61-
$ npx @codeshift/cli -t path/to/my-custom-transform /project/src`,
61+
$ codeshift-cli -t path/to/my-custom-transform /project/src`,
6262
)
6363
.action((options, command) => main(command.args, options));
6464

@@ -78,7 +78,7 @@ program
7878
'after',
7979
`
8080
Examples:
81-
$ npx @codeshift/cli init --package-name foobar --version 10.0.0 ~/Desktop
81+
$ codeshift-cli init --package-name foobar --version 10.0.0 ~/Desktop
8282
`,
8383
);
8484

@@ -90,8 +90,8 @@ program
9090
'after',
9191
`
9292
Examples:
93-
$ npx @codeshift/cli validate
94-
$ npx @codeshift/cli validate ./codemods/my-codemods
93+
$ codeshift-cli validate
94+
$ codeshift-cli validate ./codemods/my-codemods
9595
`,
9696
);
9797

website/docs/api/codeshift-cli.mdx

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,21 @@ The cli allows you to run transforms either from the [community folder](https://
1919

2020
## Usage/Installation
2121

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.
2323

2424
`$ npx @codeshift/cli --packages mylib@1.0.0 /project/src`
2525

2626
But it can also be installed normally:
2727

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`
2929

3030
Or globally:
3131

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`
3337

3438
## Options
3539

@@ -39,17 +43,17 @@ The transform to run, transforms can be either a single file or directory with a
3943

4044
**example:**
4145

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`
4448

4549
### --packages
4650

4751
Runs transforms for the specified comma separated list of packages, optionally include a version for each package to run all transforms since that version
4852

4953
**example:**
5054

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`
5357

5458
### --parser, -p
5559

@@ -65,42 +69,42 @@ Parser to use for parsing the source files you are code modding.
6569

6670
**example:**
6771

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`
7074

7175
### --extensions, -e
7276

7377
Transform files with these file extensions (comma separated list) (default: js)
7478

7579
**example:**
7680

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`
7983

8084
### --ignore-pattern
8185

8286
Ignore files that match a provided glob expression
8387

8488
**example:**
8589

86-
- `@codeshift/cli --ignore-pattern node_modules /project/src/file.js`
90+
- `$ codeshift-cli --ignore-pattern node_modules /project/src/file.js`
8791

8892
### --version, -v
8993

9094
Get current version number
9195

9296
**example:**
9397

94-
- `@codeshift/cli --version`
95-
- `@codeshift/cli -v`
98+
- `$ codeshift-cli --version`
99+
- `$ codeshift-cli -v`
96100

97101
### --help
98102

99103
Print all help text to the command line
100104

101105
**example:**
102106

103-
- `@codeshift/cli --help`
107+
- `$ codeshift-cli --help`
104108

105109
## Commands
106110

@@ -112,11 +116,11 @@ Lists available codemods for the provided packages
112116

113117
Print a list of available codemods for a single package
114118

115-
- `@codeshift/cli list mylib`
119+
- `$ codeshift-cli list mylib`
116120

117121
Print a list of available codemods for multiple packages
118122

119-
- `@codeshift/cli list mylib, @material-ui/button`
123+
- `$ codeshift-cli list mylib, @material-ui/button`
120124

121125
### init
122126

@@ -127,7 +131,7 @@ Generates a new codemod at your desired path
127131
Create a new codemod package called foobar with a transform for version 10
128132
on the Desktop
129133

130-
- `@codeshift/cli init --packageName="foobar" --version"10.0.0" ~/Desktop`
134+
- `$ codeshift-cli init --packageName="foobar" --version"10.0.0" ~/Desktop`
131135

132136
### validate
133137

@@ -137,8 +141,8 @@ Validates a codemod package at the desired path.
137141

138142
Validate a codemod package called "my-codemods".
139143

140-
- `$ npx @codeshift/cli validate ./codemods/my-codemods`
144+
- `$ codeshift-cli validate ./codemods/my-codemods`
141145

142146
Validate a codemod package from the current working directory
143147

144-
- `$ npx @codeshift/cli validate`
148+
- `$ codeshift-cli validate`

0 commit comments

Comments
 (0)