Skip to content

feat(cli): init command for adding Stackwright to existing projects #185

@perasperaactual

Description

@perasperaactual

Parent Issue

Tracked by #177

Problem

scaffold creates a full project from scratch. There's no lighter command for adding Stackwright to an existing Next.js project.

Required Behavior

stackwright init          # in existing project dir
stackwright init my-app   # specify directory
  • Generates stackwright.yml if missing
  • Creates pages/ directory with root page if missing
  • Does NOT overwrite existing files
  • Idempotent — running twice is safe

Files to Create

  • packages/cli/src/commands/init.ts

Files to Modify

  • packages/cli/src/cli.ts — register command
  • packages/cli/src/index.ts — export function

Acceptance Criteria

  • Init in empty dir creates stackwright.yml and root page
  • Init in dir with existing stackwright.yml is no-op (with message)
  • Init in dir with existing package.json preserves it
  • Works with --json and --no-interactive

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:laterPlanned but not yet committed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions