Skip to content

feat: framework adapter init CLI (npx review-loop init) #67

@viv

Description

@viv

Summary

Add an interactive npx review-loop init CLI command that detects the project framework and sets up Review Loop automatically.

Problem

Setting up Review Loop requires reading docs, choosing the right adapter (Astro/Vite/Express), editing config files, and adding .mcp.json. Each framework has slightly different integration steps. This friction discourages adoption, especially for quick evaluations where "try it in 60 seconds" matters.

Proposal

An interactive CLI that:

  1. Detects the framework — checks for astro.config.*, vite.config.*, svelte.config.*, nuxt.config.*, server.js/app.js
  2. Generates integration code — adds the correct import and plugin/integration call to the detected config file
  3. Creates .mcp.json — with the correct MCP server configuration for the project
  4. Optionally updates .gitignore — adds inline-review.json if the user wants to keep annotations local
  5. Validates the setup — optionally starts the dev server briefly and checks the API endpoint responds

CLI flow

$ npx review-loop init

Detected: Astro project (astro.config.mjs)

  1. Add review-loop integration to astro.config.mjs
  2. Create .mcp.json for MCP agent access
  3. Add inline-review.json to .gitignore

Proceed? (Y/n)

Key Constraints

  • Ships as a separate bin entry — not runtime code; purely a setup tool
  • Config file modification — needs to handle TS, JS, and MJS variants; use AST manipulation (e.g. magicast) rather than regex for reliability
  • Non-destructive — never overwrite existing configuration; detect if Review Loop is already configured and skip gracefully
  • Minimal dependencies — the init CLI should add minimal overhead to the package

Complexity

Medium — framework detection is straightforward, but generating correct config modifications across different file formats takes care.

Consensus

2/3 STRONG YES (Agent + Product both ranked this top 5). 1/3 NO (Reviewer — not reviewer-facing). First-run experience is critical for adoption.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions