
dittu
io.github.Manish-Tamang由 GitHub 账号 Manish-Tamang 发布v0.3.0更新于 Oct 29, 2026
Clone any website's frontend into Next.js or Astro and verify it with pixel diffs.
概览
把网站前端克隆为 Next.js 或 Astro 项目,并用像素差异比对验证还原度。
- 可以做什么
- 在 Chromium 中抓取线上页面,包括滚动动效、懒加载内容与按视口计算的布局
- 将抓取的 DOM、原始 CSS 与下载的资源导出为静态预览、Next.js App Router 项目或拆分成分区组件的 Astro 项目
- 支持多页抓取,重写内部链接并生成共享的页头页脚组件
- 验证克隆结果:在桌面与移动端分别截图原站与克隆站,给出像素匹配分数与差异图
- 适用场景
- 适合需要把营销站、落地页、作品集或文档站重建或迁移为可编辑的 Next.js 或 Astro 代码库,或需要高保真复刻设计参考并在重构后检查视觉回归的场景。
- 运行要求
- 以 npm 包形式通过 npx 在本地以 stdio 运行;setup 命令会为受支持的编码代理注册 MCP 服务器并安装技能。需要 Chromium/Playwright,在 Linux 或 WSL 上可能需安装系统依赖。未声明任何账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 dittu,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
dittu: Clone Any Website
Turn any website into an editable Next.js or Astro project, verified pixel by pixel.
Layout, CSS, fonts, images and scroll animations. Not the backend. One CLI, one MCP server, and skills for your coding agent.
[npm version] [npm downloads] [CI] [License: MIT] [Node]
[GitHub stars] [GitHub forks] [GitHub issues] [Last commit]
[TypeScript] [Playwright] [Next.js] [Astro] [Tailwind CSS] [MCP]
Quick start
Set up your agent
Registers the dittu MCP server and installs the skills for every agent it
finds: Claude Code, Cursor, Gemini CLI, Codex. Check your machine first
with npx @manishtamang/dittu doctor (on Linux/WSL you may need
sudo npx playwright install-deps chromium).
Ask your agent
Clone https://gole.codes into Next.js and make the pricing cards a reusable component.
The agent calls clone_website, reads the scores, refactors the generated
components, and calls verify_clone to prove nothing visual changed.
Use the terminal
Update dittu
How dittu works
Most cloners screenshot a page and ask an LLM to redraw it. dittu copies what the browser actually rendered, then checks the result:
- Capture: Chromium loads the page, scrolls it so lazy content and scroll reveals fire, then freezes JS timers so carousels hold still. A second render at 390 px records layout that JS computes per viewport.
- Serialize the live DOM, not the server HTML. Next.js/React sites come out as their final markup without hydration scripts or RSC payloads. Nesting the HTML parser would restructure gets repaired, so React hydrates cleanly.
- Keep the original CSS in cascade order, including CSS-in-JS rules that exist only in the CSSOM. Media queries, hover states and keyframes keep working.
- Download every asset from the same session and rewrite URLs.
- Export to a static preview, a Next.js App Router project (JSX) and an Astro project, split into section components.
- Replay motion: recorded scroll reveals, Framer Motion
animatecalls and loops run again through a 2 KB runtime. - Verify: screenshot original and clone the same way at desktop and mobile
and score them.
--buildscores the built apps, not just the preview.
Details: docs/architecture.md.
What you can clone
Benchmarks
Methodology and limits: docs/fidelity.md.
FAQ
Does it copy the backend? No. Data fetching, auth, APIs and form handling are not copied. You get the frontend, ready to wire to your own logic.
Why is the generated JSX full of {" "}? Whitespace between inline elements
changes layout in HTML but is dropped by JSX. dittu keeps it explicit so the clone
renders identically. Refactor freely, and re-run verify to check.
Can I get Tailwind classes instead of CSS? Yes: --styling tailwind. Every
rule that can be expressed exactly becomes Tailwind utilities (sites built with
Tailwind v4 keep their own classes); the rest stays CSS, so scores don't drop.
See Tailwind output.
Is the 95% score honest? It's raw pixel identity over the full page, including height differences, at desktop and mobile. Diff images are saved next to the scores so you can check.
Can I clone any site I want? Technically mostly yes. Legally, see the disclaimer.
Documentation
Disclaimer
dittu is for learning, prototyping, design references and migrating sites you own. Cloning a site doesn't give you rights to its brand, copy, images or code. Read DISCLAIMER.md.
Related projects
ditto.site by ion-design takes the same capture-what-the-browser-rendered approach as a hosted API and MCP service. dittu differs by running as a local CLI, keeping the site's original CSS by default (Tailwind output is opt-in and only where it renders identically), exporting Astro alongside Next.js, and scoring every clone with pixel-diff verification.
Contributing
See CONTRIBUTING.md. Agents working in this repo: AGENTS.md.
License
来源:README.md,提交 c595a04
工具
0版本历史
3- v0.3.0最新Oct 29, 2026
- v0.2.0Oct 25, 2026
- v0.1.0Oct 24, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分