From 76e64a5e5dce5f18a44965256a98c61efd448c7b Mon Sep 17 00:00:00 2001 From: Caleb Wodi Date: Sat, 14 Feb 2026 18:19:59 +0100 Subject: [PATCH] feat(web): add interactive CLI modes section --- apps/web/app/page.tsx | 1 + apps/web/components/modes.tsx | 171 ++++++++++++++++++++++++++++++++++ 2 files changed, 172 insertions(+) create mode 100644 apps/web/components/modes.tsx diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index a2a3b4c..081e767 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -6,6 +6,7 @@ export default function Page() { + ) } diff --git a/apps/web/components/modes.tsx b/apps/web/components/modes.tsx new file mode 100644 index 0000000..779d9fb --- /dev/null +++ b/apps/web/components/modes.tsx @@ -0,0 +1,171 @@ +"use client" + +import { useState } from "react" +import { cn } from "@/lib/utils" + +const modes = [ + { + flag: "default", + label: "Default", + command: "explainthisrepo facebook/react", + description: "Full repository explanation written to EXPLAIN.md", + output: [ + "Fetching repository data...", + "Analyzing file tree and structure...", + "Reading high-signal files...", + "", + "React is a JavaScript library for building user", + "interfaces using a component-based architecture...", + "", + "EXPLAIN.md created successfully.", + ], + }, + { + flag: "--quick", + label: "Quick", + command: "explainthisrepo facebook/react --quick", + description: "One-sentence summary printed to terminal", + output: [ + "Fetching repository data...", + "", + "React is a declarative JavaScript library for", + "building composable user interfaces.", + ], + }, + { + flag: "--detailed", + label: "Detailed", + command: "explainthisrepo facebook/react --detailed", + description: "Deeper explanation including architecture and structure", + output: [ + "Fetching repository data...", + "Analyzing file tree and structure...", + "Reading high-signal files...", + "Building architecture map...", + "", + "React is a UI library using a fiber-based reconciler.", + "Core packages: react, react-dom, react-reconciler.", + "Architecture: virtual DOM with concurrent rendering.", + "", + "EXPLAIN.md created successfully.", + ], + }, + { + flag: "--simple", + label: "Simple", + command: "explainthisrepo facebook/react --simple", + description: "Short, easy explanation printed to terminal", + output: [ + "Fetching repository data...", + "", + "React helps you build websites by breaking the UI", + "into reusable pieces called components.", + ], + }, + { + flag: "--stack", + label: "Stack", + command: "explainthisrepo facebook/react --stack", + description: "Tech stack breakdown from repo signals. No AI.", + output: [ + "Detecting stack from repo signals...", + "", + "Languages: JavaScript, TypeScript, C++", + "Build: Rollup, Gradle", + "Testing: Jest", + "CI/CD: GitHub Actions, CircleCI", + "Package: Yarn workspaces (monorepo)", + ], + }, +] + +export function Modes() { + const [activeMode, setActiveMode] = useState(0) + const mode = modes[activeMode] + + return ( +
+
+
+

+ Modes +

+

+ Multiple ways to understand a repo +

+

+ Choose the right level of detail. From a one-liner to a full + architectural breakdown. +

+
+ +
+ {/* Mode selector */} +
+ {modes.map((m, index) => ( + + ))} +
+ + {/* Terminal preview */} +
+
+
+
+
+
+ + {mode.label.toLowerCase()} + +
+
+
+ $ {mode.command} +
+
+ {mode.output.map((line, i) => ( +
+ {line || "\u00A0"} +
+ ))} +
+
+
+
+
+
+
+ ) +}