Skip to content

Commit 42b4a6c

Browse files
authored
fix!: upgrade to commander@12 and fix some conflicting short option names (#7008)
* fix: use a valid short flag for blobs:get output `-o` is already used in the base command for `--offline`, so this was being quietly ignored This can't be considered a breaking change as it has never worked. (I just tried it to be sure.) See tj/commander.js#2055. * fix: avoid redefining `--json` option in commands See tj/commander.js#2055. * fix: fix duplicate `-o` option for deploy command It's already used in the BaseCommand for `--offline`. This is not a breaking change, because this never worked as is. Same issue as in 9280c55. * fix: fix duplicate `-a` option in deploy command It's already defined in the BaseCommand for `--offline`. * fix: fix still more `--json` option overrides * fix: fix env:import options `-r` was already used globally so this was being ignored * fix: don't mutate the commander singleton It was redefining the options over and over and over. The latest commander throws. * chore(deps): bump astro in docs site * fix(deps): upgrade to commander@12 * types(site): fix jsdoc types in docs script * fix: remove `--json`, `--offline` from BaseCommand and centralize `--auth` only in `BaseCommand` commander@12 doesn't allow redefining the same option, so this pattern was no longer viable This was a pure refactor, but it uncovered some commands that weren't declaring options they were using, so I fixed those too. * fix: undo unnecessary short flag change
1 parent 5435e79 commit 42b4a6c

36 files changed

+271
-141
lines changed

docs/commands/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ netlify api
2727
- `data` (*string*) - Data to use
2828
- `list` (*boolean*) - List out available API methods
2929
- `debug` (*boolean*) - Print debugging information
30+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
3031

3132
**Examples**
3233

docs/commands/blobs.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ netlify blobs
2020

2121
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
2222
- `debug` (*boolean*) - Print debugging information
23+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2324

2425
| Subcommand | description |
2526
|:--------------------------- |:-----|
@@ -61,6 +62,7 @@ netlify blobs:delete
6162
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
6263
- `force` (*boolean*) - Bypasses prompts & Force the command to run.
6364
- `debug` (*boolean*) - Print debugging information
65+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
6466

6567
---
6668
## `blobs:get`
@@ -83,6 +85,7 @@ netlify blobs:get
8385
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
8486
- `output` (*string*) - Defines the filesystem path where the blob data should be persisted
8587
- `debug` (*boolean*) - Print debugging information
88+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
8689

8790
---
8891
## `blobs:list`
@@ -106,6 +109,7 @@ netlify blobs:list
106109
- `json` (*boolean*) - Output list contents as JSON
107110
- `prefix` (*string*) - A string for filtering down the entries; when specified, only the entries whose key starts with that prefix are returned
108111
- `debug` (*boolean*) - Print debugging information
112+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
109113

110114
---
111115
## `blobs:set`
@@ -130,6 +134,7 @@ netlify blobs:set
130134
- `force` (*boolean*) - Bypasses prompts & Force the command to run.
131135
- `input` (*string*) - Defines the filesystem path where the blob data should be read from
132136
- `debug` (*boolean*) - Print debugging information
137+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
133138

134139
---
135140

docs/commands/build.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ netlify build
2020
- `context` (*string*) - Specify a build context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")
2121
- `dry` (*boolean*) - Dry run: show instructions without running them
2222
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
23-
- `offline` (*boolean*) - disables any features that require network access
2423
- `debug` (*boolean*) - Print debugging information
24+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
25+
- `offline` (*boolean*) - Disables any features that require network access
2526

2627
**Examples**
2728

docs/commands/completion.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ netlify completion
2020
**Flags**
2121

2222
- `debug` (*boolean*) - Print debugging information
23+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2324

2425
| Subcommand | description |
2526
|:--------------------------- |:-----|
@@ -47,6 +48,7 @@ netlify completion:install
4748

4849
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
4950
- `debug` (*boolean*) - Print debugging information
51+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
5052

5153
---
5254

docs/commands/deploy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ netlify deploy
8585
**Flags**
8686

8787
- `alias` (*string*) - Specifies the alias for deployment, the string at the beginning of the deploy subdomain. Useful for creating predictable deployment URLs. Avoid setting an alias string to the same value as a deployed branch. `alias` doesn’t create a branch deploy and can’t be used in conjunction with the branch subdomain feature. Maximum 37 characters.
88-
- `auth` (*string*) - Netlify auth token to deploy with
8988
- `branch` (*string*) - Serves the same functionality as --alias. Deprecated and will be removed in future versions
9089
- `build` (*boolean*) - Run build command before deploying
9190
- `context` (*string*) - Context to use when resolving build configuration
@@ -94,14 +93,15 @@ netlify deploy
9493
- `functions` (*string*) - Specify a functions folder to deploy
9594
- `json` (*boolean*) - Output deployment data as JSON
9695
- `message` (*string*) - A short message to include in the deploy log
96+
- `prod-if-unlocked` (*boolean*) - Deploy to production if unlocked, create a draft otherwise
97+
- `debug` (*boolean*) - Print debugging information
98+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
9799
- `open` (*boolean*) - Open site after deploy
98100
- `prod` (*boolean*) - Deploy to production
99-
- `prod-if-unlocked` (*boolean*) - Deploy to production if unlocked, create a draft otherwise
100101
- `site` (*string*) - A site name or ID to deploy to
101102
- `skip-functions-cache` (*boolean*) - Ignore any functions created as part of a previous `build` or `deploy` commands, forcing them to be bundled again as part of the deployment
102103
- `timeout` (*string*) - Timeout to wait for deployment to finish
103104
- `trigger` (*boolean*) - Trigger a new build of your site on Netlify without uploading local files
104-
- `debug` (*boolean*) - Print debugging information
105105

106106
**Examples**
107107

docs/commands/dev.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ netlify dev
3232
- `geo` (*cache | mock | update*) - force geolocation data to be updated, use cached data from the last 24h if found, or use a mock location
3333
- `live` (*string*) - start a public live session; optionally, supply a subdomain to generate a custom URL
3434
- `no-open` (*boolean*) - disables the automatic opening of a browser window
35-
- `offline` (*boolean*) - disables any features that require network access
35+
- `debug` (*boolean*) - Print debugging information
36+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
37+
- `offline` (*boolean*) - Disables any features that require network access
3638
- `port` (*string*) - port of netlify dev
3739
- `target-port` (*string*) - port of target app server
38-
- `debug` (*boolean*) - Print debugging information
3940

4041
| Subcommand | description |
4142
|:--------------------------- |:-----|
@@ -76,6 +77,7 @@ netlify dev:exec
7677
- `context` (*string*) - Specify a deploy context or branch for environment variables (contexts: "production", "deploy-preview", "branch-deploy", "dev")
7778
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
7879
- `debug` (*boolean*) - Print debugging information
80+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
7981

8082
**Examples**
8183

docs/commands/env.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ netlify env
2020

2121
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
2222
- `debug` (*boolean*) - Print debugging information
23+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2324

2425
| Subcommand | description |
2526
|:--------------------------- |:-----|
@@ -60,6 +61,7 @@ netlify env:clone
6061
- `from` (*string*) - Site ID (From)
6162
- `to` (*string*) - Site ID (To)
6263
- `debug` (*boolean*) - Print debugging information
64+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
6365

6466
**Examples**
6567

@@ -87,8 +89,10 @@ netlify env:get
8789

8890
- `context` (*string*) - Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")
8991
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
90-
- `scope` (*builds | functions | post-processing | runtime | any*) - Specify a scope
92+
- `json` (*boolean*) - Output environment variables as JSON
9193
- `debug` (*boolean*) - Print debugging information
94+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
95+
- `scope` (*builds | functions | post-processing | runtime | any*) - Specify a scope
9296

9397
**Examples**
9498

@@ -117,8 +121,10 @@ netlify env:import
117121
**Flags**
118122

119123
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
124+
- `json` (*boolean*) - Output environment variables as JSON
120125
- `replace-existing` (*boolean*) - Replace all existing variables instead of merging them with the current ones
121126
- `debug` (*boolean*) - Print debugging information
127+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
122128

123129
---
124130
## `env:list`
@@ -136,9 +142,10 @@ netlify env:list
136142
- `context` (*string*) - Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")
137143
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
138144
- `json` (*boolean*) - Output environment variables as JSON
139-
- `plain` (*boolean*) - Output environment variables as plaintext
140145
- `scope` (*builds | functions | post-processing | runtime | any*) - Specify a scope
141146
- `debug` (*boolean*) - Print debugging information
147+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
148+
- `plain` (*boolean*) - Output environment variables as plaintext
142149

143150
**Examples**
144151

@@ -171,9 +178,11 @@ netlify env:set
171178
- `context` (*string*) - Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev") (default: all contexts)
172179
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
173180
- `force` (*boolean*) - Bypasses prompts & Force the command to run.
174-
- `scope` (*builds | functions | post-processing | runtime*) - Specify a scope (default: all scopes)
181+
- `json` (*boolean*) - Output environment variables as JSON
175182
- `secret` (*boolean*) - Indicate whether the environment variable value can be read again.
176183
- `debug` (*boolean*) - Print debugging information
184+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
185+
- `scope` (*builds | functions | post-processing | runtime*) - Specify a scope (default: all scopes)
177186

178187
**Examples**
179188

@@ -207,7 +216,9 @@ netlify env:unset
207216
- `context` (*string*) - Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev") (default: all contexts)
208217
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
209218
- `force` (*boolean*) - Bypasses prompts & Force the command to run.
219+
- `json` (*boolean*) - Output environment variables as JSON
210220
- `debug` (*boolean*) - Print debugging information
221+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
211222

212223
**Examples**
213224

docs/commands/functions.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ netlify functions
2121

2222
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
2323
- `debug` (*boolean*) - Print debugging information
24+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2425

2526
| Subcommand | description |
2627
|:--------------------------- |:-----|
@@ -55,6 +56,7 @@ netlify functions:build
5556
- `functions` (*string*) - Specify a functions directory to build to
5657
- `src` (*string*) - Specify the source directory for the functions
5758
- `debug` (*boolean*) - Print debugging information
59+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
5860

5961
---
6062
## `functions:create`
@@ -76,8 +78,10 @@ netlify functions:create
7678
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
7779
- `language` (*string*) - function language
7880
- `name` (*string*) - function name
81+
- `offline` (*boolean*) - Disables any features that require network access
7982
- `url` (*string*) - pull template from URL
8083
- `debug` (*boolean*) - Print debugging information
84+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
8185

8286
**Examples**
8387

@@ -109,10 +113,12 @@ netlify functions:invoke
109113
- `identity` (*boolean*) - simulate Netlify Identity authentication JWT. pass --identity to affirm unauthenticated request
110114
- `name` (*string*) - function name to invoke
111115
- `no-identity` (*boolean*) - simulate Netlify Identity authentication JWT. pass --no-identity to affirm unauthenticated request
116+
- `offline` (*boolean*) - Disables any features that require network access
112117
- `payload` (*string*) - Supply POST payload in stringified json, or a path to a json file
118+
- `debug` (*boolean*) - Print debugging information
119+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
113120
- `port` (*string*) - Port where netlify dev is accessible. e.g. 8888
114121
- `querystring` (*string*) - Querystring to add to your function invocation
115-
- `debug` (*boolean*) - Print debugging information
116122

117123
**Examples**
118124

@@ -147,6 +153,7 @@ netlify functions:list
147153
- `functions` (*string*) - Specify a functions directory to list
148154
- `json` (*boolean*) - Output function data as JSON
149155
- `debug` (*boolean*) - Print debugging information
156+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
150157
151158
---
152159
## `functions:serve`
@@ -163,9 +170,10 @@ netlify functions:serve
163170
164171
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
165172
- `functions` (*string*) - Specify a functions directory to serve
166-
- `offline` (*boolean*) - disables any features that require network access
173+
- `offline` (*boolean*) - Disables any features that require network access
167174
- `port` (*string*) - Specify a port for the functions server
168175
- `debug` (*boolean*) - Print debugging information
176+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
169177
170178
---
171179

docs/commands/init.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ netlify init
2323
- `git-remote-name` (*string*) - Name of Git remote to use. e.g. "origin"
2424
- `manual` (*boolean*) - Manually configure a git remote for CI
2525
- `debug` (*boolean*) - Print debugging information
26+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2627

2728

2829
<!-- AUTO-GENERATED-CONTENT:END -->

docs/commands/link.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ netlify link
2323
- `id` (*string*) - ID of site to link to
2424
- `name` (*string*) - Name of site to link to
2525
- `debug` (*boolean*) - Print debugging information
26+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2627

2728
**Examples**
2829

docs/commands/login.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ netlify login
2121

2222
- `new` (*boolean*) - Login to new Netlify account
2323
- `debug` (*boolean*) - Print debugging information
24+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2425

2526

2627
<!-- AUTO-GENERATED-CONTENT:END -->

docs/commands/logs.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ netlify logs
1919

2020
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
2121
- `debug` (*boolean*) - Print debugging information
22+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2223

2324
| Subcommand | description |
2425
|:--------------------------- |:-----|
@@ -49,6 +50,7 @@ netlify logs:deploy
4950

5051
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
5152
- `debug` (*boolean*) - Print debugging information
53+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
5254

5355
---
5456
## `logs:function`
@@ -70,6 +72,7 @@ netlify logs:function
7072
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
7173
- `level` (*string*) - Log levels to stream. Choices are: trace, debug, info, warn, error, fatal
7274
- `debug` (*boolean*) - Print debugging information
75+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
7376

7477
**Examples**
7578

docs/commands/open.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ netlify open
2121
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
2222
- `site` (*boolean*) - Open site
2323
- `debug` (*boolean*) - Print debugging information
24+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2425

2526
| Subcommand | description |
2627
|:--------------------------- |:-----|
@@ -52,6 +53,7 @@ netlify open:admin
5253

5354
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
5455
- `debug` (*boolean*) - Print debugging information
56+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
5557

5658
**Examples**
5759

@@ -74,6 +76,7 @@ netlify open:site
7476

7577
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
7678
- `debug` (*boolean*) - Print debugging information
79+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
7780

7881
**Examples**
7982

docs/commands/recipes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ netlify recipes
2323

2424
- `name` (*string*) - recipe name to use
2525
- `debug` (*boolean*) - Print debugging information
26+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
2627

2728
| Subcommand | description |
2829
|:--------------------------- |:-----|
@@ -51,6 +52,7 @@ netlify recipes:list
5152

5253
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
5354
- `debug` (*boolean*) - Print debugging information
55+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
5456

5557
**Examples**
5658

docs/commands/serve.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ netlify serve
2525
- `functions` (*string*) - specify a functions folder to serve
2626
- `functions-port` (*string*) - port of functions server
2727
- `geo` (*cache | mock | update*) - force geolocation data to be updated, use cached data from the last 24h if found, or use a mock location
28-
- `offline` (*boolean*) - disables any features that require network access
28+
- `offline` (*boolean*) - Disables any features that require network access
2929
- `port` (*string*) - port of netlify dev
3030
- `debug` (*boolean*) - Print debugging information
31+
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
3132

3233
**Examples**
3334

0 commit comments

Comments
 (0)