Commit Graph

222 Commits

Author SHA1 Message Date
Austin Merrick
446ac49e2b [cli] Don't pull system environment vars in dev (#11526)
System environment variables would get set with empty strings in development which breaks some builds. This fixes that by using the v2 of `/env/pull` introduced in https://github.com/vercel/api/pull/27777.
2024-05-15 12:17:47 +00:00
Erika Rowland
0f12005a68 [cli] Migrate alias command to use parseArguments and getFlagsSpecification (#11467)
Migrating `vc alias` to use new argument parsing utilities.

Note that our snapshot tests show that our help text was out of sync with what we were actually parsing from the user. 

In particular, we were showing `-n` as the shorthand for both `next` and `limit` and neither of these had this shortflag. `next` was parsing `-N` (capital), so I've updated it to that.

`--json` was parsed, but wasn't mentioned in the help text. I've kept it this way, but it may be worth adding a description. We may want to have a separate discussion about the nature and role of `json` output from our CLI as a whole.
2024-04-24 19:48:04 +00:00
Jeff See
596b68ce56 Add eslint rule for no-console within the cli package (#11452)
This PR adds a rule to disallow the use of console.log/console.error/etc
from within the CLI package. The aim is to centralize our use of stdio
within the CLI so that everything moves through our client's output
module. It also disables the rule for all of the current console usage,
with the hopes that we will clean things up soon™

Also want to note that the rule only applies to usage from within the
CLI, so dependencies that the CLI pulls in (both external and even
within this monorepo) are unaffected.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2024-04-18 10:54:05 -07:00
Chris
1e6323e2b1 [cli] Ignore VERCEL_ANALYTICS_ID if @vercel/speed-insights is present on the project (#11305)
In the past, we used the `VERCEL_ANALYTICS_ID` environment variable with the previous Speed Insights feature on Vercel to activate specific logic in Next.js, Nuxt and Gatsby for collecting and sending web vitals data.

With the new Speed Insights, that's not required anymore.

We no longer want to set the environment variable when detecting the new `@vercel/speed-insights` package. 
This PR confirms that the variable is not set if the new package is detected.
2024-04-18 15:08:32 +00:00
S. Elliott Johnson
8fd2c0671e [cli] Sort default team to the top of the team selector (#11451)
The user's default team should be sorted to the top of the selector. This is a nice and simple way to do this, though I'm not sure how to test my changes -- would appreciate guidance!
2024-04-18 13:46:22 +00:00
Erika Rowland
027150134f Add snapshot tests for help (#11439)
Adds snapshot tests for the output from help as output by various commands. I expect to be changing some of the `Command` structs to continue the work started in [ [cli] Improve type signature of CommandOption #11394 ](https://github.com/vercel/vercel/pull/11394) especially as I build on work in [ Get flags specification #11433 ](https://github.com/vercel/vercel/pull/11433), and I want to be sure that the associated changes to help output are what we expect.
2024-04-17 20:51:54 +00:00
Erika Rowland
a1dfd90eec Get flags specification (#11433)
Extracting logic for turning a list of `CommandOption`s into a flagsSpecification for `parseArguments`. Builds on the work from #11396 and #11394.
2024-04-16 17:07:55 +00:00
Erika Rowland
0dfb60df83 [cli] Create argument parsing utility with clearer semantics (#11396)
The way that we currently parse arguments throughout the vercel command line is through the `getArgs` function. This function takes three arguments: `argv`, `argOptions`, and `argsOptions`. (Those last two arguments are swapped in order from the real function). This is semantically muddy and likely to create mistakes. We have instances in our code base, such as `deploy/index.ts` which at the time of this pull request creates a variable named `argOptions` and passes it to the `argsOptions` argument of `getArgs`.

Further, the return type of `arg` the library we currently use to parse arguments is unclear as well. It puts positional arguments under an `_` key, instead of a meaningful name.

In this pull request, I create a function called `parseArguments` that takes the same three arguments as `getArgs` with improved names: `args`, `flags`, and `parserOptions`. It also changes the return type to be an object with two keys: `{args, flags}` allowing for clearer access patterns where the argument parser is used.
2024-04-14 08:22:55 +00:00
Jeff See
a6f1c561a2 Introduce snapshot testing utilities (#11375)
This introduces some additional capabilities on the `MockClient` and `MockStream` classes used in our unit tests. 

The bulk of this code is copied over from https://github.com/SBoudrias/Inquirer.js/tree/master/packages/testing, but uses our existing stdin/stdout mocks instead of what's used there. 

You can now use `client.getScreen()` to see the "last" screen pushed to stdin, which is super handy for snapshot tests. I've added a few as part of this PR, but many more can be written for our client output as well in the near future.

---

The `client.getScreen()` is also a handy debug tool, use it with `raw: true` to see a pretty printed output during tests:


https://github.com/vercel/vercel/assets/5414297/d0be6078-4901-4eb2-a6c9-1b51b576c1ba

---

This also adds an `events` object on the `MockClient` which allows us to write `client.events.keypress("down")` instead of the less readable `client.stdin.write('\x1B[B')` throughout our testing. This could also be moved to so that it's `client.stdin.keypress(...` or something similar. Note that I've only tested that this works in a login test, included in this PR. If we're happy to make this change I will make update the rest of the unit tests to use this syntax for the inputs.
2024-04-11 19:51:34 +00:00
Sean Massa
cddf3fa00c Revert "[cli] Revert "Disallow promoting preview deployments to production (#11363)"" (#11411)
Reverts vercel/vercel#11410 to reinstate #11363
2024-04-10 22:15:33 +00:00
Nathan Rajlich
627b79fb14 [client] Always use v13 of create deployment API endpoint (#11351)
Updates `@vercel/client` to always use the v13 create-deployment endpoint, even when `builds` is present. This allows for `projectSettings.nodeVersion` to be passed when `builds` is present.
2024-04-10 20:55:28 +00:00
Nathan Rajlich
1088bf2dea [cli] Revert "Disallow promoting preview deployments to production (#11363)" (#11410)
This reverts commit 4e416d7d7b.

It was erroneously merged by Kodiak with failing unit tests.
2024-04-10 07:03:12 +00:00
Trek Glowacki
4e416d7d7b [cli] Disallow promoting preview deployments to production (#11363)
Blocks preview deployments from being directly promoted. This relies on a new API version bump.

Copied the warning text from the UI:
![CleanShot 2024-04-01 at 11 04 00@2x](https://github.com/vercel/vercel/assets/9736/4e93ffdd-32f2-40bc-97e7-6fe98208cd76)

This is a breaking change and will require a major version bump. Please don't merge until we're ready.
2024-04-09 22:02:29 +00:00
Nathan Rajlich
bd100baa16 [tests] Fix tarball URL from deleted project (#11403)
I did some pruning of old projects on my personal account last night, and accidentally broke CI. I've created a new tarball on the `curated-tests` team so that it doesn't happen again.
2024-04-09 19:56:47 +00:00
Austin Merrick
2e6aab01cb [cli] Unify table formatting output (#11387)
This removes 'text-table' as a dependency in favor of using 'cli-table3', and simplifies table formatting logic.
2024-04-09 07:33:04 +00:00
Jeff See
76ea6ea2a7 [cli] Replace promptBool with confirm prompts (#11279)
The only changes are from some slightly different punctuation and that typing 'y' or 'n' doesn't process the prompt, it now waits for "Enter". Easiest command to see this is an action is the `init`, if you provided an invalid example to initialize `vercel init astroz` and follow the prompts.
2024-04-04 09:45:02 +00:00
Austin Merrick
d0877c1023 [cli] Replace inquirer with @inquirer/prompts (#11321)
# Overview

Changing to `@inquirer/prompts` meant updating all existing usage of `inquirer.prompt`. This removed a lot of code since the `inquirer.prompt` function was extra verbose.

The user experience shouldn't have changed much besides different styling. `patch-inquirer` is incompatible with `@inquirer/prompts`. ~~We probably don't want to merge this until we have a new solution for styling.~~ The new default styling is preferred over our old styling.

There are lots of changes over many files, so I went back and organized the commit history. It will probably be easier to review this PR by commit.

## Tests

~~I had to change tests in ways that aren't great. Tests had a hard time recognizing output with escape codes in them, so I had to make the expected output more generic.~~ Using `strip-ansi` worked nicely to ignore styling changes in unit and integration tests.

I removed the unit test "should list projects running on an soon-to-be-deprecated Node.js version" because that test doing `jest.useFakeTimers().setSystemTime(new Date('2023-12-08'));` would make the "should remove a project" test fail. Really strange stuff! Couldn't think of a better solution than removing this, so looking for suggestions here.
2024-04-02 07:40:32 +00:00
Nathan Rajlich
07d8d11989 Revert "[cli] extract isZeroConfigBuild into utility function (#11316)" (#11350)
This reverts commit 78e2c012f9.

This commit causes a failing test which contains the `zeroConfig: true`
field. It should have not been merged in the first place due to the
failing test, but Kodiak erroneously merged it before the tests were
passing.

When there are `builds` configuration, the v10 create-deployment
endpoint is used instead of the latest v13 endpoint. `projectSettings`
is not allowed in the v10 endpoint, therefore we can not send the
`nodeVersion` when `builds` project exists. Instead, we should look into
moving away from the v10 endpoint so that we can be using the latest
version of the endpoint for all deployments.
2024-03-29 13:53:51 -07:00
Erika Rowland
8a16e8eb65 [cli] Add explicit vitest import to unit test for isZeroConfigBuild utility (#11341) 2024-03-28 13:32:46 -05:00
Erika Rowland
78e2c012f9 [cli] extract isZeroConfigBuild into utility function (#11316)
An additional check was added to make sure that `projectSettings.nodeVersion` is sent when builds property is defined in `vercel.json`
2024-03-28 08:06:10 +00:00
Jeff See
9ed967034d [cli] Switch unit tests from jest to vitest (#11302) 2024-03-27 17:33:27 -07:00
Austin Merrick
6f46b1fc70 [cli][tests] Fix getUpdateCommand for local dev (#11276)
This unit test fails on my machine:
```
Expected: "pnpm i vercel@latest"
Received: "pnpm i -g vercel@latest"
```

This change allows the test to succeed on machines that need the `-g` flag.
2024-03-16 00:31:26 +00:00
Erika Rowland
11218a1798 [cli] Don't send projectSettings.nodeVersion for unsupported versions (#11277)
Previously, we used `semver` which correctly identified the nodeVersion used in `package.json`, but failed in two cases:

1. If the specified `engines` range started too low, it wouldn't correctly identify a later version compatible with Vercel. (`">10"` was detecting as Node `"10.x"` not `"20.x"`)
2. If the specified `engines` version was fixed too low to be compatible with Vercel, we sent it, and then Vercel predictably errored. (`"10"` was detecting as Node `"10.x"` which would lead to an error in the build process)

Now, case 1 should properly use the latest node version. And case 2 will not send a node version override to the API and will print a warning to the user on the CLI, but the deployment will still proceed with the version specified for the project in the web interface.

We chose to keep the error message shown to the user consistent with what shows in the logs for the build container, that is:
> WARN! Node.js Version "10.x" is discontinued and must be upgraded. Please set "engines": { "node": "20.x" } in your `package.json` file to use Node.js 20.
2024-03-14 21:34:51 +00:00
Damien Simonin Feugas
2ad44999dd [cli] stops warning Next.js users about legacy Speed Insights (#11268)
### 🧐 What's in there?

Vercel's Speed Insights legacy injection is deprecated in favor of `@vercel/speed-insights` package.
CLI has a couple places where it warns users running `vc build` locally (or on their CI).

Some users complained about seeing the warning while they are already using the package.

This PR removes the message

###  Note to reviewers

@tobiaslins, @timolins and I had a long discussion on the approach here.

This warning is issued because during `vc pull`, the project API on Vercel returns a legacy analytics.id field, [which is stored](https://github.com/vercel/vercel/blame/main/packages/cli/src/util/projects/project-settings.ts#L35) in `.vercel/project.json`.
While it is legit for users who never used `@vercel/speed-insights` package, it also appear for users who migrated from legacy.

Besides setting the warning, `VERCEL_ANALYTICS_ID` is set, which triggers auto-injection in Next.js, and is useful during self-hosting.

We first considered removing the legacy id from `project.json`, but it would break self-hosting.
We also considered printing the warning only if the application never used the package (which the project API on Vercel knows). 
In the end, we realized that vercel.com Speed Insights dashboard has plenty of disclaimer and incentives to use the new package. Having it in the CLI doesn't worth the annoyance.
2024-03-14 15:00:43 +00:00
Nathan Rajlich
8ea93839cc [cli] Set projectSettings.nodeVersion in vc deploy based on "engines.node" field (#11261)
Read the package.json and use the `engines.node` value to set the
`projectSettings.nodeVersion` property on the create deployment API call
POST body. This allows for the Node 20 build container image to be
properly specified before the deployment is created on the server side.
2024-03-13 15:39:51 -07:00
Nathan Rajlich
b9f3438c2d [cli] Fix framework version detection in monorepos (#11212)
I noticed that the framework version was not being printed on deployments in a monorepo. Turns out the framework detection logic was happening at the root of the monorepo, instead of the project directory.
2024-03-12 22:54:53 +00:00
Andy
908e7837d5 [cli][build-utils] Rename variants to flags (#11121)
- Removes all the legacy `flags`
 - Renames the new `variants` to `flags`

Neither the legacy flags, nor the new variants were exposed to anyone, except for the type in build-utils, so there shouldn't be any issues removing/renaming them.
2024-03-08 16:06:23 +00:00
Shohei Maeda
37b193c845 [build-utils] increase max memory limit (#11209)
internal ref. https://github.com/vercel/api/pull/25997

increasing max limit from 3008 -> 3009 MB

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
2024-03-01 08:23:11 +09:00
Damien Simonin Feugas
2601257846 [cli, static-builds] deprecation notice for speed insights injection (#11048)
### 🧐 What's in there?

With the recent release of [`@vercel/speed-insights`](https://vercel.com/docs/speed-insights/package) own package (like [`@vercel/analytics`](https://vercel.com/docs/analytics/package)), it's time to encourage users to migrate.

With the availability of `@vercel/speed-insights`, users will have to opt-in explicitly by installing the package. Their benefit is a better and fine-grained control of the reporting (in particular, per-application sample rate).

###  Note to reviewers

I used `console.warn` and hope it will stands out in the build logs. I'm happy to use anything else if you have better suggestions.

There's also a deprecation warning in Next.js, which covers a related but slightly different case, when users explicitly pass analyticsId in their configuration. https://github.com/vercel/next.js/pull/60677
2024-01-19 19:10:31 +00:00
Trek Glowacki
7de754398e [cli] Add documentation string for skip-domain option (#11051)
Text taken directly from https://vercel.com/docs/cli/deploy#skip-domain
2024-01-18 18:10:22 +00:00
Nathan Rajlich
ab826eb83d [cli] Serialize duplicate EdgeFunction references as symlinks in vc build (#11027)
Enables the symlink optimization that currently exists for `Lambda`
instances, but now for `EdgeFunction` instances as well. This will be
particularly beneficial for Remix applications which use edge functions
for many routes, since they will now all be represented by the same
underling function in production.

---------

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2024-01-10 13:17:59 -08:00
Ethan Arrowood
9146885f80 [cli] replace --deprecated with --update-required in vc project ls (#10965)
Replaces the new `--deprecated` option with `--update-required` in the `vc project ls` command.
2023-12-18 19:10:07 +00:00
Ethan Arrowood
a1df25a197 [cli] Clean up project ls --deprecate (#10926)
Follow up to #10919

Removes console.log statements and changes log into warning.
2023-12-08 17:55:24 +00:00
Ethan Arrowood
dfe47f6e6c [cli] add --deprecated option to vc project ls command (#10919)
Adds a `--deprecated` option to the `vc project ls` command that will only show projects currently running on a soon-to-be-deprecated Node.js version.

It also adds additional output providing more information to the user about what versions and a link to our documentation so they can learn more.

Example:

<img width="836" alt="Screenshot 2023-12-07 at 15 01 22" src="https://github.com/vercel/vercel/assets/16144158/3b7f7b13-802e-4af1-a76e-a158a477beb4">
2023-12-08 17:09:18 +00:00
Trek Glowacki
c41ff450c0 [cli] Fix behavior for combination of northstar user + team scope provided to cli as an argument. (#10884)
Fixes a neat little bug with the intersection of northstar users, teams, and the behavior of `Array#find_index`:

When selecting an org for various cli actions _non_ northstar users will see a select list with their user in the 0th position, and their teams in the 1..nth positions, like so:

```
// user: Logan
// teams: [Avengers, X-Men]
○ Logan
○ Avengers
○ X-Men
``` 

We'd like to preselect either a team referenced in `client.config.currentTeam` or if said team cannot be found in the collection of a user's teams, preselect the user. So if `X-Men` is `currentTeam`, we find that item (element `1` in the teams array) and increment that value by `1` to account for the user being element `0` in the list of choices:

```
// currentTeam: X-Men
// user: Logan
// teams: [Avengers, X-Men]
○ Logan
○ Avengers
● X-Men
``` 

If we _can't_ find the `currentTeam` in the list of teams (or one isn't provided), `Array#find_index` returns `-1`, which we increment to by `1` to get the 0th element in the list of choices:

```
// currentTeam: undefined
// user: Logan
// teams: [Avengers, X-Men]
● Logan
○ Avengers
○ X-Men
``` 

Neat trick!

However, Northstar users _don't_ use the user account as the 0th element in the list of choices. Northstar users will in fact have a team that represents a hidden default team with the same name as their `user.name` and this will be the 0th element in their teams:

```
// user: Logan
// teams: [Logan, Avengers, X-Men]
○ Logan
○ Avengers
○ X-Men
``` 

This of course means the trick of `+1` to index of the team selects the wrong item _and_ can result in `undefined` in cases where the `currentTeam` references the last team.

```
// currentTeam: X-Men
// user: Logan
// teams: [Logan, Avengers, X-Men]
○ Logan
○ Avengers
○ X-Men
``` 

● how'd we get out here?!?! 👀 

To address the issue this PR:
1. calls `findIndex` on the array of _choices_ checking for matches to `currentTeam`
2. wraps that in `Math.max` to set to `0` if `find_index` returns `-1` when a `currentTeam` can't be found.
2023-11-29 14:15:17 +00:00
Trek Glowacki
2d86a2d4ba [tests] tidy and make select-org tests more realistic (#10882)
Tracking down a bug with "northstar" users and have a little prefactor that 

a) isolates setup code so it's less repeated
b) makes the "northstar" tests more reflective of actual execution.

Northstar users will always have a `currentTeam` value on their `client.config`:

aa0f3d712b/packages/cli/src/util/get-scope.ts (L18-L20)

And finally c) add tests for the case of a non-northstar users where a team scope is supplied.

The final hypothetical matching group (northstart users with team scope provided) is the bug that I'll fix with a refactor.
2023-11-28 23:21:32 +00:00
Trek Glowacki
9bc5bb4afc [cli] Move from yarn to npm for fixtures and ensure lockfiles to speed up installs (#10619)
Some of our tests take quite some time to run and occasionally timeout when accessing https://yarnpkg.com/. We decided to make sure there is a lockfile for this _and_ just move over to `npm`. Shifting the `packages/cli` fixtures over in this PR.

I possibly missed one but I changed the install commands in tests and ran

* pnpm test
* pnpm test-unit
* pnpm test-dev
* pnpm test-e2e
2023-10-04 17:31:08 +00:00
balazs4
905c7b6ad4 [vc cert ls] remove error shallowing (#10551)
During [project-level-rbac bug bash](https://linear.app/vercel/issue/IAM-1267/vc-certs-ls-fails-with-typeerror-for-contributors) we were facing a runtime error 

```
Error: An unexpected error occurred in certs: TypeError: Cannot read properties of undefined (reading 'length')
```

The reason for that is because the API responded with `403`, which was expected in our test. However the CLI should not exit with a generic runtime error in this case.

This PR removes the `.catch(err => err)` error shallowing instruction.
2023-09-25 16:25:46 +00:00
Tobias Lins
57231a0d60 [speed insights] Prepare for migration to new speed insights package (#10500)
During `vc build` do following when `@vercel/speed-insights` package is in dependencies:
- Show a warning when `VERCEL_ANALYTICS_ID` is set in environment variables
- Unset it in process.env to prevent auto-injecting old speed insights in Next.js

Durning `vc env pull` prevent pulling internal environment variables `VERCEL_ANALYTICS_ID`, `VERCEL_SPEED_INSIGHTS_ID` & `VERCEL_WEB_ANALYTICS_ID`. They are never required in the frontend
2023-09-20 21:06:12 +00:00
Shu Uesugi
b7e93524e3 [cli] Support northstar users (#10535)
Supports users who have `version === 'northstar'` and `defaultTeamId`.
2023-09-19 21:45:42 +00:00
Trek Glowacki
92ad73b8f3 Restore datadog checking with logs not exit codes (#10527)
Restores DataDog flakey test detection. Briefly disabled because the old method of using exit codes would bail the entire workflow.

Taking the Turbo team's suggestion of looking at `runData.execution` values to avoid an extra loop. Now with unit tests!
2023-09-18 16:43:16 +00:00
Trek Glowacki
bd1319d7a3 [cli] Update secrets.js to more current styles (#10461)
Updates the `secrets` command to be a bit more modern. Initially I was going to covert this to typescript but that change was quite large, so going stepwise for easier review.

1. Moves the command implementation into a directory like other commands
2. Shifts the command data structure into its own file
3. Adds a test.

Other relevant comments inline.
2023-09-06 20:58:57 +00:00
Trek Glowacki
104ab0332d [cli] Wrap description in help output (#10370)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-08-18 15:01:45 -05:00
Trek Glowacki
78fa02292d [cli] Swap custom table code with cli-table3 (#10333)
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
2023-08-14 10:12:43 -05:00
Chris Barber
d6f18f4e2d [cli] Sanitize argv for vc build (#10311)
`vc build` writes a file `.vercel/output/build.json` that contains the `argv` contents which could include sensitive information that needs to be sanitized.
2023-08-09 15:01:18 +00:00
Trek Glowacki
153ca440fa Add basic tests for remove command (#10304)
Adds some minimal unit testing for the `remove` command. There is currently none.
2023-08-07 18:14:21 +00:00
Trek Glowacki
7d3dda7341 [cli] Update spacing on --help output (#10287)
Indent more items rightwards to tidy up spacing.

Example of unmigrated `bisect` on current `main`:
<img width="561" alt="CleanShot 2023-07-31 at 14 47 38@2x" src="https://github.com/vercel/vercel/assets/9736/7474ac88-775c-43aa-937b-3f544c064c6d">

Migrated example (https://github.com/vercel/vercel/pull/10276) before changes in this PR:
<img width="661" alt="CleanShot 2023-07-31 at 15 07 26@2x" src="https://github.com/vercel/vercel/assets/9736/076b247c-35cf-45ea-8713-3c684b5063e4">


Migrated example after changes in this PR:
<img width="693" alt="CleanShot 2023-07-31 at 14 46 39@2x" src="https://github.com/vercel/vercel/assets/9736/f5f056a1-7f68-42e5-a724-79cf86031d09">
2023-08-02 17:33:59 +00:00
Trek Glowacki
d5b588bc06 [cli] Add a "Global Options" section to help output (#10250)
Followup PR to #10090. Some of our commands duplicate global options into their `args` structure e.g. 2661f56347/packages/cli/src/commands/logs.ts (L25-L26)

 Others commands omit it entirely.

This updates the `--help` output for commands migrated to our new structure (so far, only `deploy`) will show a "Global Options" section:

```
▲ vercel deploy [project-path] [options]

Deploy your project to Vercel. The `deploy` command is the default command for the Vercel CLI, and can be omitted (`vc deploy my-app` equals `vc my-app`).

Options

  --archive                    Compress the deployment code into a file before uploading it
  -b, --build-env <key=value>  Specify environment variables during build-time (e.g. `-b KEY1=value1 -b KEY2=value2`)
  -e, --env <key=value>        Specify environment variables during run-time (e.g. `-e KEY1=value1 -e KEY2=value2`)
  -f, --force                  Force a new deployment even if nothing has changed
  -m, --meta <key=value>       Specify metadata for the deployment (e.g. `-m KEY1=value1 -m KEY2=value2`)
  --no-wait                    Don't wait for the deployment to finish
  --prebuilt                   Use in combination with `vc build`. Deploy an existing build
  --prod                       Create a production deployment
  -p, --public                 Deployment is public (`/_src`) is exposed)
  --regions                    Set default regions to enable the deployment on
  --with-cache                 Retain build cache when using "--force"
  -y, --yes                    Use default options to skip all prompts

Global Options

  --cwd <DIR>                Sets the current working directory for a single run of a command
  -d, --debug                Debug mode (default off)
  -Q, --global-config <DIR>  Path to the global ${'`.vercel`'} directory
  -h, --help                 Output usage information
  -A, --local-config <FILE>  Path to the local `vercel.json` file
  --no-color                 No color mode (default off)
  -S, --scope                Set a custom scope
  -t, --token <TOKEN>        Login token
  -v, --version              Output the version number
```

As commands are migrated to this new structure, they'll gain this output automatically.
2023-07-27 20:48:07 +00:00
Chris Barber
8dd6d021df [cli] Add "Environment" column to vc list (#10239)
Also adds a new `--environment=[preview|production]` filter and ability to pipe deployment URLs to `stdout`!

<img width="380" alt="image" src="https://github.com/vercel/vercel/assets/97262/20de0caa-2d63-4112-8213-cc15d23295c7">

```
vc list --environment preview
```

```
vc list --environment production
```

```
vc list --environment preview > preview_deployments.txt
```
2023-07-24 20:02:25 +00:00
Nathan Rajlich
9969f0ba18 [cli] Use detectFrameworks() during vc link --repo (#10203)
Allows for multiple frameworks to be detectable within the same root directory. This is basically specifically for Storybook.

<img width="700" alt="Screenshot 2023-07-12 at 6 04 37 PM" src="https://github.com/vercel/vercel/assets/71256/5a240f1e-b000-42ad-b36f-3c151d3cd449">
2023-07-14 18:11:49 +00:00