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.

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

把網站前端複製成 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 中

  1. 開啟 儀表板中的 dittu,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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]

[dittu MCP server on Glama]

Quick start · How it works · Benchmarks · Docs

$ dittu clone https://gole.codes --build
› Capturing https://gole.codes  1,680,755 chars of markup, 6 stylesheets, 33 animations, 13 JS-responsive elements✓ Static preview → dittu-out/gole.codes/preview✓ Next.js project → dittu-out/gole.codes/next✓ Astro project → dittu-out/gole.codes/astro
Visual match (1 − differing pixels / total)  preview  /home    1440px   99.95%  next     /home    1440px   99.95%  astro    /home    1440px   99.95%  preview  /home     390px   99.89%  next     /home     390px   99.89%  astro    /home     390px   99.89%✓ All checks ≥ 95% (lowest 99.89%)

Quick start

Set up your agent

bash
npx @manishtamang/dittu setup

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

bash
npx @manishtamang/dittu                                        # interactive: banner, then pick URL, frameworks, pages…npx @manishtamang/dittu clone https://gole.codes -y           # no questions: preview + Next.js + Astro, scorednpx @manishtamang/dittu clone https://gole.codes -p 5 --build # crawl 5 pages, build and score the appsnpx @manishtamang/dittu clone https://gole.codes -s tailwind # Tailwind classes where lossless, rest stays CSSnpx @manishtamang/dittu verify dittu-out/gole.codes --targets nextnpx @manishtamang/dittu serve dittu-out/gole.codes

Update dittu

bash
npx @manishtamang/dittu@latest setup

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:

  1. 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.
  2. 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.
  3. 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.
  4. Download every asset from the same session and rewrite URLs.
  5. Export to a static preview, a Next.js App Router project (JSX) and an Astro project, split into section components.
  6. Replay motion: recorded scroll reveals, Framer Motion animate calls and loops run again through a 2 KB runtime.
  7. Verify: screenshot original and clone the same way at desktop and mobile and score them. --build scores the built apps, not just the preview.

Details: docs/architecture.md.

What you can clone

Site typeSupport
Marketing sites, landing pages, portfolios, docs✅ 99%+ typical
Next.js / React / Vue / Svelte / Astro builds✅ post-hydration DOM
Tailwind, CSS modules, styled-components, emotion✅ original CSS kept
Scroll reveals (AOS, Framer Motion, GSAP, IntersectionObserver)✅ recorded and replayed
Layout JS computes per viewport✅ mobile render → media-query overrides
Multi-page sites✅ --pages N, internal links rewired, shared header/footer components
Canvas / WebGL scenes⚠️ still image
Carousels, tabs, menus, forms⚠️ look is copied, behaviour is not
Pages behind login or bot protection❌

Benchmarks

SiteStackDesktopMobileBuilt apps
gole.codesNext.js, heavy animation99.95%99.89%Next.js + Astro: same
nextjs.orgNext.js99.79%99.99%99.78–99.79%
ui.shadcn.comNext.js + Tailwind100.00%100.00%100.00%
astro.buildAstro100.00%100.00%
manishtamang.com (3 pages)Next.js99.89–99.99%99.80–100%same

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

MIT

來源:README.md,提交 c595a04

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v0.3.0最新Oct 29, 2026
  2. v0.2.0Oct 25, 2026
  3. v0.1.0Oct 24, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分