> ## 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:

**1. 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).

**2. Provider selection**

Choose your AI provider: Anthropic, OpenAI, or OpenRouter.

**3. API key**

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

**4. 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

**5. 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

**6. File generation**

Creates the `.ralph/` directory with all configuration, prompts, guides, and scripts.

## Flags

**--provider** `string` (default: anthropic)

AI provider to use. Options: `anthropic`, `openai`, `openrouter`.

**-i, --interactive** `boolean` (default: false)

Stay in interactive TUI mode after init completes.

**-y, --yes** `boolean` (default: false)

Accept all defaults and skip confirmation prompts.

## 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](https://wiggum.app/docs/using-wiggum/configuration.md) for details on each file and setting.

## Examples

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

```bash Headless theme={null}
wiggum init --provider anthropic --yes
```

> [!NOTE]
>
> To rescan your project after changes without repeating the full init flow, use [`wiggum sync`](https://wiggum.app/docs/commands/sync).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.