1
1
---
2
- title : ' Codemod CLI'
3
- description : ' Orchestrate large-scale code migrations with Codemod CLI.'
4
- icon : ' terminal'
2
+ title : " Codemod CLI"
3
+ description : " Orchestrate large-scale code migrations with Codemod CLI."
4
+ icon : " terminal"
5
5
---
6
6
7
7
Codemod CLI (new) is accessible using the ` npx codemod@next ` command. The following commands and options are available:
@@ -26,67 +26,82 @@ Manage and execute workflow YAMLs.
26
26
<ResponseField name = " workflow run" >
27
27
Run a workflow.
28
28
</ResponseField >
29
+
29
30
``` bash
30
31
npx codemod@next workflow run -w < workflow.yaml| directory> [--param key= value]
31
32
```
33
+
32
34
- ` -w, --workflow <PATH> ` (string) — Path to workflow file or directory. (required)
33
35
- ` --param <KEY=VALUE> ` (string) — Workflow parameters (format: key=value).
34
36
35
37
<ResponseField name = " workflow resume" >
36
38
Resume a paused workflow.
37
39
</ResponseField >
40
+
38
41
``` bash
39
42
npx codemod@next workflow resume -i < ID> [-t < TASK> ] [--trigger-all]
40
43
```
44
+
41
45
- ` -i, --id <ID> ` (string) — Workflow run ID. (required)
42
46
- ` -t, --task <TASK> ` (string) — Task ID to trigger (can be specified multiple times).
43
47
- ` --trigger-all ` (boolean) — Trigger all awaiting tasks.
44
48
45
49
<ResponseField name = " workflow validate" >
46
50
Validate a workflow file.
47
51
</ResponseField >
52
+
48
53
``` bash
49
54
npx codemod@next workflow validate -w < workflow.yaml>
50
55
```
56
+
51
57
- ` -w, --workflow <FILE> ` (string) — Path to workflow file. (required)
52
58
53
- | Check | Ensures |
54
- | ----------------------------- | ----------------------------------------- |
55
- | Schema validation | YAML matches the workflow spec |
56
- | Unique IDs | Node & template IDs are unique |
57
- | Dependency validation | Every ` depends_on ` exists |
58
- | Cyclic dependency detection | DAG has no cycles |
59
- | Template references | All ` template: ` IDs exist |
60
- | Matrix validation | ` from_state ` matches schema |
61
- | State schema validation | ` state.schema ` is valid |
62
- | Variable syntax | ` ${{…}} ` uses ` params ` , ` env ` , ` state ` |
59
+ | Check | Ensures |
60
+ | --------------------------- | -------------------------------------- |
61
+ | Schema validation | YAML matches the workflow spec |
62
+ | Unique IDs | Node & template IDs are unique |
63
+ | Dependency validation | Every ` depends_on ` exists |
64
+ | Cyclic dependency detection | DAG has no cycles |
65
+ | Template references | All ` template: ` IDs exist |
66
+ | Matrix validation | ` from_state ` matches schema |
67
+ | State schema validation | ` state.schema ` is valid |
68
+ | Variable syntax | ` ${{…}} ` uses ` params ` , ` env ` , ` state ` |
63
69
64
70
<Info >
65
- <b >Why validate?</b > Validation catches issues before execution, saving time and preventing runtime errors.
71
+ <b >
72
+ Why validate?</b >
73
+
74
+ Validation catches issues before execution, saving time and preventing runtime errors.
66
75
</Info >
67
76
68
77
<ResponseField name = " workflow status" >
69
78
Show workflow run status.
70
79
</ResponseField >
80
+
71
81
``` bash
72
82
npx codemod@next workflow status -i < ID>
73
83
```
84
+
74
85
- ` -i, --id <ID> ` (string) — Workflow run ID. (required)
75
86
76
87
<ResponseField name = " workflow list" >
77
88
List workflow runs.
78
89
</ResponseField >
90
+
79
91
``` bash
80
92
npx codemod@next workflow list [-l < LIMIT> ]
81
93
```
94
+
82
95
- ` -l, --limit <LIMIT> ` (number) — Number of workflow runs to show. (default: 10)
83
96
84
97
<ResponseField name = " workflow cancel" >
85
98
Cancel a workflow run.
86
99
</ResponseField >
100
+
87
101
``` bash
88
102
npx codemod@next workflow cancel -i < ID>
89
103
```
104
+
90
105
- ` -i, --id <ID> ` (string) — Workflow run ID. (required)
91
106
92
107
---
@@ -100,109 +115,135 @@ See [this page](/cli/jssg) for full details and options for running and testing
100
115
### ` codemod@next init `
101
116
102
117
Initialize a new workflow project.
118
+
103
119
``` bash
104
120
npx codemod@next init [PATH] [options]
105
121
```
122
+
106
123
<ResponseField name = " [PATH]" type = " string" >
107
124
Project directory name.
108
125
</ResponseField >
126
+
109
127
<ResponseField name = " --name <NAME>" type = " string" >
110
128
Project name (defaults to directory name).
111
129
</ResponseField >
130
+
112
131
<ResponseField name = " --project-type <PROJECT_TYPE>" type = " string" >
113
132
Project type: ` shell ` , ` ast-grep-js ` , ` ast-grep-yaml ` .
114
133
</ResponseField >
134
+
115
135
<ResponseField name = " --language <LANGUAGE>" type = " string" >
116
136
Target language.
117
137
</ResponseField >
138
+
118
139
<ResponseField name = " --description <DESCRIPTION>" type = " string" >
119
140
Project description.
120
141
</ResponseField >
142
+
121
143
<ResponseField name = " --author <AUTHOR>" type = " string" >
122
144
Author name and email.
123
145
</ResponseField >
146
+
124
147
<ResponseField name = " --license <LICENSE>" type = " string" >
125
148
License.
126
149
</ResponseField >
150
+
127
151
<ResponseField name = " --private" type = " boolean" >
128
152
Make package private.
129
153
</ResponseField >
154
+
130
155
<ResponseField name = " --force" type = " boolean" >
131
156
Overwrite existing files.
132
157
</ResponseField >
158
+
133
159
<ResponseField name = " --no-interactive" type = " boolean" >
134
160
Use defaults without prompts.
135
161
</ResponseField >
136
162
137
163
### ` codemod@next login `
138
164
139
165
Login to a registry.
166
+
140
167
``` bash
141
168
npx codemod@next login [--registry < REGISTRY> ] [--scope < SCOPE> ]
142
169
```
170
+
143
171
<ResponseField name = " --registry <REGISTRY>" type = " string" >
144
172
Registry URL.
145
173
</ResponseField >
174
+
146
175
<ResponseField name = " --scope <SCOPE>" type = " string" >
147
176
Organization or user scope for publishing.
148
177
</ResponseField >
149
178
150
179
### ` codemod@next logout `
151
180
152
181
Logout from a registry.
182
+
153
183
``` bash
154
184
npx codemod@next logout [--registry < REGISTRY> ] [--all]
155
185
```
186
+
156
187
<ResponseField name = " --registry <REGISTRY>" type = " string" >
157
188
Registry URL to logout from.
158
189
</ResponseField >
190
+
159
191
<ResponseField name = " --all" type = " boolean" >
160
192
Logout from all registries.
161
193
</ResponseField >
162
194
163
195
### ` codemod@next whoami `
164
196
165
197
Show current authentication status.
198
+
166
199
``` bash
167
200
npx codemod@next whoami [--registry < REGISTRY> ] [--detailed]
168
201
```
202
+
169
203
<ResponseField name = " --registry <REGISTRY>" type = " string" >
170
204
Registry URL to check.
171
205
</ResponseField >
206
+
172
207
<ResponseField name = " --detailed" type = " boolean" >
173
208
Show detailed information including token scopes.
174
209
</ResponseField >
175
210
176
211
### ` codemod@next publish `
177
212
178
213
Publish a workflow to a registry.
214
+
179
215
``` bash
180
216
npx codemod@next publish [PATH] [options]
181
217
```
218
+
182
219
<ResponseField name = " [PATH]" type = " string" >
183
220
Path to codemod directory.
184
221
</ResponseField >
222
+
185
223
<ResponseField name = " --version <VERSION>" type = " string" >
186
224
Explicit version override.
187
225
</ResponseField >
226
+
188
227
<ResponseField name = " --registry <REGISTRY>" type = " string" >
189
228
Target registry URL.
190
229
</ResponseField >
230
+
191
231
<ResponseField name = " --tag <TAG>" type = " string" >
192
232
Tag for the release.
193
233
</ResponseField >
234
+
194
235
<ResponseField name = " --access <ACCESS>" type = " string" >
195
236
Access level (` public ` , ` private ` ).
196
237
</ResponseField >
238
+
197
239
<ResponseField name = " --dry-run" type = " boolean" >
198
240
Validate and pack without uploading.
199
241
</ResponseField >
200
242
201
243
### ` codemod@next search `
202
244
203
- #### ` codemod@next search `
204
-
205
245
Search for packages in the registry.
246
+
206
247
``` bash
207
248
npx codemod@next search [QUERY] [options]
208
- ```
249
+ ```
0 commit comments