Skip to content

vercel bisect

Learn how to perform a binary search on your deployments to help surface issues.

The vercel bisect command can be used to perform a binary search upon a set of Deployments in a Project for the purpose of determining when an bug was introduced.

This is similar to git bisect but faster because you don't need to wait to rebuild each commit, as long as there is a corresponding Deployment.

vercel bisect

Using the vercel bisect command will initiate an interactive prompt where you specify a good deployment, followed by a bad deployment and step through the deployments in between to find the first bad deployment.

The following global options can be passed when using the vercel bisect command:

  • --cwd
  • --debug
  • --global-config
  • --help
  • --token

For more information on global options and their usage, refer to the options section.

These are options that only apply to the vercel bisect command, therefore, more information is provided.

The --good option, shorthand -g, can be used to specify the initial "good" deployment from the command line. When this option is present, the prompt will be skipped at the beginning of the bisect session. A production alias URL may be specified for convenience.

vercel bisect --good https://example.com

Using the vercel bisect command with the --good option.

The --bad option, shorthand -b, can be used to specify the "bad" deployment from the command line. When this option is present, the prompt will be skipped at the beginning of the bisect session. A production alias URL may be specified for convenience.

vercel bisect --bad https://example-s93n1nfa.vercel.app

Using the vercel bisect command with the --bad option.

The --path option, shorthand -p, can be used to specify a subpath of the deployment where the issue occurs. The subpath will be appended to each URL during the bisect session.

vercel bisect --path /blog/first-post

Using the vercel bisect command with the --path option.

The --open option, shorthand -o, will attempt to automatically open each deployment URL in your browser window for convenience.

vercel bisect --open

Using the vercel bisect command with the --open option.

The --run option, shorthand -r, provides the ability for the bisect session to be automated using a shell script or command that will be invoked for each deployment URL. The shell script can run an automated test (for example, using the curl command to check the exit code) which the bisect command will use to determine whether each URL is good (exit code 0), bad (exit code non-0), or should be skipped (exit code 125).

vercel bisect --run ./test.sh

Using the vercel bisect command with the --run option.