Implementation:Cypress io Cypress OpenModule Start Launchpad
| Knowledge Sources | |
|---|---|
| Domains | CLI, Electron |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Concrete tool for launching the Cypress Launchpad setup experience provided by the CLI open module and DataContext initialization.
Description
The open module's start function (in cli/lib/exec/open.ts) spawns the Cypress Electron binary, which initializes the DataContext (packages/data-context/src/DataContext.ts) and serves the Launchpad Vue application. The DataContext constructor sets up the GraphQL schema, initializes stores for project state, and connects to the filesystem for configuration detection.
Usage
This is called when a user runs cypress open and needs to configure or select a project for testing.
Code Reference
Source Location
- Repository: cypress-io/cypress
- Files:
- cli/lib/exec/open.ts:L81-106 (open.start)
- cli/lib/exec/spawn.ts:L286-322 (spawn.start)
- packages/data-context/src/DataContext.ts:L101+ (DataContext constructor)
Signature
// CLI open module
const start = async (options: any = {}): Promise<any> => {
// options.project: string - project path
// options.global: boolean - global mode
// options.browser: string - preferred browser
// options.testingType: string - 'e2e' or 'component'
}
// DataContext (server-side)
class DataContext {
constructor(options: DataContextOptions) {
// Initializes GraphQL schema, project state, file watchers
}
}
Import
import openModule from '../exec/open'
await openModule.start({ project: '/path/to/project' })
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| options.project | string | No | Project directory path |
| options.global | boolean | No | Open in global mode (no project) |
| options.testingType | string | No | Pre-select testing type |
Outputs
| Name | Type | Description |
|---|---|---|
| Electron window | BrowserWindow | Launchpad UI window |
| DataContext | DataContext | Initialized GraphQL state management |
Usage Examples
Opening the Launchpad
# Open Launchpad for current directory
npx cypress open
# Open with specific project
npx cypress open --project /path/to/my-app
# Open in global mode
npx cypress open --global