> ## Documentation Index
> Fetch the complete documentation index at: https://wiggum.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# init

> Scan your project, detect the tech stack, and generate configuration.

```bash theme={null}
wiggum init [options]
```

Scans your project and generates a `.ralph/` directory with configuration, prompts, guides, and scripts tailored to your codebase.

## What happens

The init process has six phases:

<Steps>
  <Step title="Scanning">
    Wiggum runs parallel detectors across your project to identify your tech stack. Detects 80+ technologies including:

    * **Core** — Framework, package manager, testing (unit + E2E), styling
    * **Data** — Database, ORM, API layer
    * **Frontend** — State management, UI components, form handling
    * **Services** — Auth, analytics
    * **Infra** — Hosting, CI/CD, MCP servers

    Each detection includes a confidence score (0-100).
  </Step>

  <Step title="Provider selection">
    Choose your AI provider: Anthropic, OpenAI, or OpenRouter.
  </Step>

  <Step title="API key">
    Enter your API key. Wiggum saves it to `.ralph/.env.local` (gitignored) so you don't need to re-enter it.
  </Step>

  <Step title="Model selection">
    Pick models for each purpose:

    * **Planning model** (e.g. Opus) — Handles spec generation, architectural decisions, and verification
    * **Implementation model** (e.g. Sonnet) — Handles the coding loop
  </Step>

  <Step title="AI analysis">
    Wiggum runs an agentic analysis of your codebase, producing structured context:

    * Entry points and key files
    * Directory purposes
    * Build, dev, test, lint commands
    * Naming conventions
    * Project-specific implementation guidelines
  </Step>

  <Step title="File generation">
    Creates the `.ralph/` directory with all configuration, prompts, guides, and scripts.
  </Step>
</Steps>

## Flags

<ParamField path="--provider" type="string" default="anthropic">
  AI provider to use. Options: `anthropic`, `openai`, `openrouter`.
</ParamField>

<ParamField path="-i, --interactive" type="boolean" default="false">
  Stay in interactive TUI mode after init completes.
</ParamField>

<ParamField path="-y, --yes" type="boolean" default="false">
  Accept all defaults and skip confirmation prompts.
</ParamField>

## Output

Creates the `.ralph/` directory:

```
.ralph/
├── ralph.config.cjs          # Stack detection + loop config
├── .env.local                # API keys (gitignored)
├── .context.json             # Codebase analysis results
├── prompts/
│   ├── PROMPT.md.tmpl             # Implementation prompt
│   ├── PROMPT_feature.md.tmpl     # Planning phase prompt
│   ├── PROMPT_e2e.md.tmpl         # E2E testing prompt
│   ├── PROMPT_verify.md.tmpl      # Verification prompt
│   ├── PROMPT_review_manual.md.tmpl  # Manual review prompt
│   ├── PROMPT_review_auto.md.tmpl    # Auto review prompt
│   └── PROMPT_review_merge.md.tmpl   # Auto-merge review prompt
├── guides/
│   ├── AGENTS.md             # Agent instructions
│   └── ...                   # Project-specific guides
├── scripts/
│   ├── feature-loop.sh       # The Ralph loop engine
│   └── ralph-monitor.sh      # Monitoring script
├── specs/
│   └── _example.md           # Example spec template
└── LEARNINGS.md              # Accumulated project learnings
```

See [configuration](/using-wiggum/configuration) for details on each file and setting.

## Examples

<CodeGroup>
  ```bash Interactive (recommended) theme={null}
  wiggum
  # then type /init in the TUI
  ```

  ```bash Headless theme={null}
  wiggum init --provider anthropic --yes
  ```
</CodeGroup>

<Note>
  To rescan your project after changes without repeating the full init flow, use [`wiggum sync`](/commands/sync).
</Note>
