Skip to content

Commit 51924a0

Browse files
Documentation edits made through Mintlify web editor
1 parent 7a8cdc9 commit 51924a0

File tree

1 file changed

+58
-17
lines changed

1 file changed

+58
-17
lines changed

apps/docs/cli/cli-reference.mdx

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
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"
55
---
66

77
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.
2626
<ResponseField name="workflow run">
2727
Run a workflow.
2828
</ResponseField>
29+
2930
```bash
3031
npx codemod@next workflow run -w <workflow.yaml|directory> [--param key=value]
3132
```
33+
3234
- `-w, --workflow <PATH>` (string) — Path to workflow file or directory. (required)
3335
- `--param <KEY=VALUE>` (string) — Workflow parameters (format: key=value).
3436

3537
<ResponseField name="workflow resume">
3638
Resume a paused workflow.
3739
</ResponseField>
40+
3841
```bash
3942
npx codemod@next workflow resume -i <ID> [-t <TASK>] [--trigger-all]
4043
```
44+
4145
- `-i, --id <ID>` (string) — Workflow run ID. (required)
4246
- `-t, --task <TASK>` (string) — Task ID to trigger (can be specified multiple times).
4347
- `--trigger-all` (boolean) — Trigger all awaiting tasks.
4448

4549
<ResponseField name="workflow validate">
4650
Validate a workflow file.
4751
</ResponseField>
52+
4853
```bash
4954
npx codemod@next workflow validate -w <workflow.yaml>
5055
```
56+
5157
- `-w, --workflow <FILE>` (string) — Path to workflow file. (required)
5258

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

6470
<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.
6675
</Info>
6776

6877
<ResponseField name="workflow status">
6978
Show workflow run status.
7079
</ResponseField>
80+
7181
```bash
7282
npx codemod@next workflow status -i <ID>
7383
```
84+
7485
- `-i, --id <ID>` (string) — Workflow run ID. (required)
7586

7687
<ResponseField name="workflow list">
7788
List workflow runs.
7889
</ResponseField>
90+
7991
```bash
8092
npx codemod@next workflow list [-l <LIMIT>]
8193
```
94+
8295
- `-l, --limit <LIMIT>` (number) — Number of workflow runs to show. (default: 10)
8396

8497
<ResponseField name="workflow cancel">
8598
Cancel a workflow run.
8699
</ResponseField>
100+
87101
```bash
88102
npx codemod@next workflow cancel -i <ID>
89103
```
104+
90105
- `-i, --id <ID>` (string) — Workflow run ID. (required)
91106

92107
---
@@ -100,109 +115,135 @@ See [this page](/cli/jssg) for full details and options for running and testing
100115
### `codemod@next init`
101116

102117
Initialize a new workflow project.
118+
103119
```bash
104120
npx codemod@next init [PATH] [options]
105121
```
122+
106123
<ResponseField name="[PATH]" type="string">
107124
Project directory name.
108125
</ResponseField>
126+
109127
<ResponseField name="--name <NAME>" type="string">
110128
Project name (defaults to directory name).
111129
</ResponseField>
130+
112131
<ResponseField name="--project-type <PROJECT_TYPE>" type="string">
113132
Project type: `shell`, `ast-grep-js`, `ast-grep-yaml`.
114133
</ResponseField>
134+
115135
<ResponseField name="--language <LANGUAGE>" type="string">
116136
Target language.
117137
</ResponseField>
138+
118139
<ResponseField name="--description <DESCRIPTION>" type="string">
119140
Project description.
120141
</ResponseField>
142+
121143
<ResponseField name="--author <AUTHOR>" type="string">
122144
Author name and email.
123145
</ResponseField>
146+
124147
<ResponseField name="--license <LICENSE>" type="string">
125148
License.
126149
</ResponseField>
150+
127151
<ResponseField name="--private" type="boolean">
128152
Make package private.
129153
</ResponseField>
154+
130155
<ResponseField name="--force" type="boolean">
131156
Overwrite existing files.
132157
</ResponseField>
158+
133159
<ResponseField name="--no-interactive" type="boolean">
134160
Use defaults without prompts.
135161
</ResponseField>
136162

137163
### `codemod@next login`
138164

139165
Login to a registry.
166+
140167
```bash
141168
npx codemod@next login [--registry <REGISTRY>] [--scope <SCOPE>]
142169
```
170+
143171
<ResponseField name="--registry <REGISTRY>" type="string">
144172
Registry URL.
145173
</ResponseField>
174+
146175
<ResponseField name="--scope <SCOPE>" type="string">
147176
Organization or user scope for publishing.
148177
</ResponseField>
149178

150179
### `codemod@next logout`
151180

152181
Logout from a registry.
182+
153183
```bash
154184
npx codemod@next logout [--registry <REGISTRY>] [--all]
155185
```
186+
156187
<ResponseField name="--registry <REGISTRY>" type="string">
157188
Registry URL to logout from.
158189
</ResponseField>
190+
159191
<ResponseField name="--all" type="boolean">
160192
Logout from all registries.
161193
</ResponseField>
162194

163195
### `codemod@next whoami`
164196

165197
Show current authentication status.
198+
166199
```bash
167200
npx codemod@next whoami [--registry <REGISTRY>] [--detailed]
168201
```
202+
169203
<ResponseField name="--registry <REGISTRY>" type="string">
170204
Registry URL to check.
171205
</ResponseField>
206+
172207
<ResponseField name="--detailed" type="boolean">
173208
Show detailed information including token scopes.
174209
</ResponseField>
175210

176211
### `codemod@next publish`
177212

178213
Publish a workflow to a registry.
214+
179215
```bash
180216
npx codemod@next publish [PATH] [options]
181217
```
218+
182219
<ResponseField name="[PATH]" type="string">
183220
Path to codemod directory.
184221
</ResponseField>
222+
185223
<ResponseField name="--version <VERSION>" type="string">
186224
Explicit version override.
187225
</ResponseField>
226+
188227
<ResponseField name="--registry <REGISTRY>" type="string">
189228
Target registry URL.
190229
</ResponseField>
230+
191231
<ResponseField name="--tag <TAG>" type="string">
192232
Tag for the release.
193233
</ResponseField>
234+
194235
<ResponseField name="--access <ACCESS>" type="string">
195236
Access level (`public`, `private`).
196237
</ResponseField>
238+
197239
<ResponseField name="--dry-run" type="boolean">
198240
Validate and pack without uploading.
199241
</ResponseField>
200242

201243
### `codemod@next search`
202244

203-
#### `codemod@next search`
204-
205245
Search for packages in the registry.
246+
206247
```bash
207248
npx codemod@next search [QUERY] [options]
208-
```
249+
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy