oorty init
Initialize testing infrastructure in your project.
Usage
Terminal
npx oorty@latest init [options]Options
| Option | Default | Description |
|---|---|---|
-y, --yes | false | Skip all prompts and use defaults |
--typescript | true | Use TypeScript for test files |
--src-dir | auto | Project uses src directory structure |
--skip-install | false | Skip installing dependencies |
--cwd <path> | . | Set the working directory |
What It Does
The init command performs the following steps:
- Detects your framework - Next.js, React, Vite, Remix, Astro, etc.
- Detects your package manager - npm, yarn, pnpm, or bun
- Creates oorty.json - The configuration manifest with directory paths
- Creates .oorty/ directory - Single source of truth for cache, plans, analysis, and logs
- Creates vitest.config.ts - Configured for your framework (if not already present)
- Creates playwright.config.ts - With sensible defaults (if not already present)
- Creates GitHub Actions workflow - CI ready out of the box (optional)
- Installs dependencies - Vitest, Playwright, Testing Library
Note
The init command does not create test directories or test files. It only generates configuration files and installs dependencies. Use
oorty add to create test files, which will also create the directories if needed.Examples
Initialize with all defaults (no prompts):
Terminal
npx oorty@latest init -yInitialize in a specific directory:
Terminal
npx oorty@latest init --cwd ./my-appInitialize without installing dependencies:
Terminal
npx oorty@latest init --skip-installExisting Configurations
If you already have vitest.config.ts or playwright.config.ts, Oorty will skip creating those files to avoid overwriting your existing configuration.
Output
After running init, your project will have the following new files:
Generated Files
my-app/├── .github/│ └── workflows/│ └── test.yml # CI workflow (if selected)├── .oorty/ # Single source of truth│ ├── cache/ # Ephemeral (gitignored)│ ├── plans/ # Test plans (tracked)│ ├── analysis/ # Coverage snapshots (gitignored)│ └── logs/ # Debug logs (gitignored)├── oorty.json # Configuration manifest├── vitest.config.ts # Unit/component test config└── playwright.config.ts # E2E test configThe .oorty/ directory is the single source of truth for auto-generated files. Plans in .oorty/plans/ are tracked in git for CI/collaboration, while cache and analysis are gitignored and rebuilt locally.
Next: oorty doctor
Learn how to validate your setup.