cy2 is a tiny NPM package that changes cypress API server configuration on-the-fly using environment variable CYPRESS_API_URL
The command passes down to cypress all the CLI flags, so you can just use it instead of cypress .
$ npm install -g cy2
$ export CYPRESS_API_URL=""
$ cy2 run --record --key XXX --parallel --ci-build-id `date +%s`
  • Running the command above will invoke your default cypress version with the flags you've provided. It will also modify the internal cypress configuration to use a different API URL.
  • If no URL provided, it will use the default cypress package value.
  • On Windows set CYPRESS_API_URL in the CMD shell with set CYPRESS_API_URL= (Don't use quotes (") because the Windows CMD takes them literal unlike the Linux shells)
Copy link
Edit on GitHub