web2fig is a terminal-first .NET MVP for analyzing a website, reviewing extracted design signals in a CLI/TUI flow, and exporting a truthful Figma-ready bundle with a markdown style report for human review.
- Built-in CLI commands for analysis, inspection, export, and session browsing are implemented.
- The default composition root wires a local file-backed session store, the heuristic
WebsiteAnalysisEngine, and theBundleAnalysisExporter. - The shipped exporter does not generate a native
.figfile; it writes a machine-readable Figma-ready JSON bundle plus a markdown style report, manifest, summary, and diagnostics artifacts.
- .NET 10 SDK installed.
- PowerShell on Windows for
run-local.ps1(optional but convenient).
git clone <your-fork-or-repo-url>
cd .\web2fig
dotnet restore .\web2fig.slnxweb2fig analyze <url> [options]
web2fig inspect <session-id> [--interactive]
web2fig export <session-id> [options]
web2fig sessions list [options]
web2fig --help
dotnet run --project .\src\Web2Fig.Cli\Web2Fig.Cli.csproj -- analyze https://example.com
dotnet run --project .\src\Web2Fig.Cli\Web2Fig.Cli.csproj -- analyze https://example.com --interactive --viewports desktop,mobile
dotnet run --project .\src\Web2Fig.Cli\Web2Fig.Cli.csproj -- sessions list --status completed
dotnet run --project .\src\Web2Fig.Cli\Web2Fig.Cli.csproj -- inspect <session-id>
dotnet run --project .\src\Web2Fig.Cli\Web2Fig.Cli.csproj -- export <session-id> --output .\artifacts\<session-id>analyze <url> --interactiveprompts for scope, viewports, and diagnostics, then opens the review flow.inspect <session-id> --interactiveopens the saved session in the review flow.export <session-id> --interactiveprompts for export settings before writing artifacts.- Interactive prompts require a real terminal with keyboard input; redirected or piped input will fail fast if
--interactiveis requested.
The built-in exporter writes two complementary deliverables:
<name>.style-report.mdis the primary human-readable deliverable. Open this first for a narrative summary of layout structure, colors, typography, iconography, spacing, theme signals, responsive notes, and exporter limitations.<name>.figma-ready.jsonis a machine-readable bridge/replay/export artifact. It is not a native.figfile, and it is not something users manually edit in Figma directly. Instead, it preserves the extracted design model for downstream tooling, automation, replayable exports, debugging, and future conversion workflows.
Until native .fig output exists, a practical workflow is:
- Read
<name>.style-report.mdto understand the site's visual system and the exporter's fidelity notes. - Check
<name>.manifest.jsonto see what was exported, what was skipped, and which files belong to the bundle. - Keep
<name>.figma-ready.jsonand optional<name>.analysis.jsonfor scripting, regression tests, custom importers, or future exporters that can consume the structured data. - Use
<name>.summary.txtand<name>.diagnostics.logfor quick CLI-friendly review and troubleshooting.
The built-in exporter writes these files into the chosen output directory:
<name>.style-report.md- primary human-readable style and layout report<name>.figma-ready.json- machine-readable bridge/export bundle<name>.manifest.json- machine-readable manifest of bundle contents and issues<name>.summary.txt- compact plain-text summary<name>.diagnostics.log- diagnostic log for warnings and traceability<name>.analysis.json- optional intermediate analysis JSON (unless--no-intermediate-jsonis used)
Saved sessions are stored under the local application data folder. On Windows, the default location is %LOCALAPPDATA%\web2fig\sessions.
- Analysis is heuristic and based on static HTML/CSS inspection; the MVP does not execute JavaScript or reproduce late-hydrated client-side state.
- Multi-viewport output currently reuses one structural pass and annotates responsive limitations honestly.
- The review flow is read-only; it supports inspection and export, not manual design editing.
- Requesting
--native-figrecords the intent and emits a warning, but the shipped exporter still writes the markdown style report plus machine-readable JSON artifacts rather than a native.figfile.
run-local.ps1 now uses a target-driven contract:
appruns the CLI locally.testsruns all tests in the solution.unit-testsruns only unit test projects undertests\.e2e-testsruns E2E/integration-style test projects undertests\.
.\run-local.ps1 app
.\run-local.ps1 app analyze https://example.com
.\run-local.ps1 tests
.\run-local.ps1 unit-tests
.\run-local.ps1 -Configuration Release app export <session-id> --output .\artifacts\<session-id>This repository currently ships only unit test projects, so .\run-local.ps1 e2e-tests will fail fast until an E2E or integration test project is added under tests\.
dotnet build .\web2fig.slnx --nologo
dotnet run --project .\src\Web2Fig.Cli\Web2Fig.Cli.csproj -- --helpdotnet test .\web2fig.slnx --nologoFormatting before verification:
dotnet format .\web2fig.slnxdocs\specs Product and MVP specifications
src\Web2Fig.Core Analysis contracts and core engine/exporter implementations
src\Web2Fig.Cli Spectre.Console CLI/TUI host
tests\ Unit tests for the CLI and core services
run-local.ps1 Target-driven local app/test helper script
