Scaffold a new project
Advent day 13: quickly scaffold a new Cypress project using @bahmutov/cly
When adding Cypress to a project you need to start it once to see the scaffolded files, then delete the files (who needs to see the same Kitchensink tests again and again?), then adjust the plugins / support / fixture folders… Unfortunately, Cypress does not have a built-in “npx cypress scaffold …” command. This is why I wrote @bahmutov/cly - a CLI for Cypress.
Say you want to scaffold a new Cypress test:
npm i -D cypress
npx @bahmutov/cly init
Boom, you get a cypress.json file and the Cypress folder with a single example spec. Want to scaffold TypeScript specs?
npx @bahmutov/cly init --typescript
Want to scaffold a bare minimum project?
npx @bahmutov/cly init --bare (or -b)
I personally use the “-b” option all the time when creating the first test.