You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/reference/cli.md
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
# Command Line Reference
2
2
3
-
You can always see up-to-date command line options using `sg --help`.
3
+
You can always see up-to-date command line options using `ast-grep --help`.
4
4
ast-grep has several subcommands as listed below.
5
5
6
-
## `sg run`
7
-
Run one time search or rewrite in command line. This is the default command when you run `sg`so `sg -p 'foo()'` is equivalent to `sg run -p 'foo()'`. [View detailed reference.](/reference/cli/run.html)
6
+
## `ast-grep run`
7
+
Run one time search or rewrite in command line. This is the default command when you run the CLI, so `ast-grep -p 'foo()'` is equivalent to `ast-grep run -p 'foo()'`. [View detailed reference.](/reference/cli/run.html)
8
8
9
9
### Usage
10
10
11
11
```shell
12
-
sg run [OPTIONS] --pattern <PATTERN> [PATHS]...
12
+
ast-grep run [OPTIONS] --pattern <PATTERN> [PATHS]...
13
13
```
14
14
15
15
### Arguments
@@ -42,13 +42,13 @@ sg run [OPTIONS] --pattern <PATTERN> [PATHS]...
42
42
| -C| --context `<NUM>`| Show NUM lines around each match [default: 0]|
43
43
|-h | --help | Print help |
44
44
45
-
## `sg scan`
45
+
## `ast-grep scan`
46
46
Scan and rewrite code by configuration. [View detailed reference.](/reference/cli/scan.html)
47
47
48
48
### Usage
49
49
50
50
```shell
51
-
sg scan [OPTIONS] [PATHS]...
51
+
ast-grep scan [OPTIONS] [PATHS]...
52
52
```
53
53
54
54
### Arguments
@@ -87,13 +87,13 @@ sg scan [OPTIONS] [PATHS]...
87
87
| -C| --context `<NUM>`| Show NUM lines around each match [default: 0]|
88
88
| -h| --help|Print help|
89
89
90
-
## `sg test`
90
+
## `ast-grep test`
91
91
Test ast-grep rules. See [testing guide](/guide/test-rule.html) for more details. [View detailed reference.](/reference/cli/test.html)
92
92
93
93
### Usage
94
94
95
95
```shell
96
-
sgtest [OPTIONS]
96
+
ast-greptest [OPTIONS]
97
97
```
98
98
99
99
### Options
@@ -109,15 +109,15 @@ sg test [OPTIONS]
109
109
| -i| --interactive |start an interactive review to update snapshots selectively.|
110
110
| -h| --help |Print help.|
111
111
112
-
## `sg new`
112
+
## `ast-grep new`
113
113
114
114
Create new ast-grep project or items like rules/tests. [View detailed reference.](/reference/cli/new.html)
115
115
116
116
117
117
### Usage
118
118
119
119
```shell
120
-
sg new [COMMAND] [OPTIONS] [NAME]
120
+
ast-grep new [COMMAND] [OPTIONS] [NAME]
121
121
```
122
122
123
123
### Commands
@@ -142,14 +142,14 @@ sg new [COMMAND] [OPTIONS] [NAME]
142
142
| -b|`--base-dir <BASE_DIR>`| Create new project/items in the folder specified by this argument `[default: .]`|
143
143
| -h|`--help`| Print help (see more with '--help') |
144
144
145
-
## `sg lsp`
145
+
## `ast-grep lsp`
146
146
147
147
Start a language server to [report diagnostics](/guide/scan-project.html) in your project. This is useful for editor integration. See [editor integration](/guide/tools/editors.html) for more details.
148
148
149
149
### Usage
150
150
151
151
```shell
152
-
sg lsp
152
+
ast-grep lsp
153
153
```
154
154
155
155
### Options
@@ -159,14 +159,14 @@ sg lsp
159
159
| -c | --config `<CONFIG_FILE>`| Path to ast-grep root config, default is `sgconfig.yml`|
160
160
| -h|`--help`| Print help (see more with '--help') |
161
161
162
-
## `sg completions`
162
+
## `ast-grep completions`
163
163
164
164
Generate shell completion script.
165
165
166
166
### Usage
167
167
168
168
```shell
169
-
sg completions [SHELL]
169
+
ast-grep completions [SHELL]
170
170
```
171
171
172
172
### Arguments
@@ -178,5 +178,5 @@ If not provided, shell flavor will be inferred from environment.
0 commit comments