### Install and Run Sprawlens CLI Source: https://github.com/mizchi/sprawlens/blob/main/README.md Install Sprawlens and run it on a local repository to analyze its structure and open it in a browser. Alternatively, run it during development without building. ```bash # from a checkout of this repo (built bin): pnpm install && pnpm build node packages/cli/dist/index.js # analyze + open the browser # or during development, without building: pnpm cli serve ``` -------------------------------- ### Sprawlens Development Commands Source: https://github.com/mizchi/sprawlens/blob/main/README.md Commands for developing Sprawlens, including installing dependencies, running tests, type checking, and starting development servers for the visualization and detail server. ```bash pnpm install pnpm test # vitest across all packages pnpm -r exec tsc --noEmit -p tsconfig.json # typecheck (per package) pnpm --filter @sprawlens/viz dev # the map dev server pnpm dev:server # detail/diff server for the viz dev pnpm build # build viz + bundle the CLI bin ``` -------------------------------- ### Rebuilding moonbit-parser.js with esbuild Source: https://github.com/mizchi/sprawlens/blob/main/packages/analyzer-moonbit/vendor/README.md This command demonstrates how to minify the MoonBit parser's JavaScript output into a self-contained ES module using esbuild. Ensure you have esbuild installed (`npm install -g esbuild`). ```bash npx esbuild /_build/js/debug/build/sprawlens_wrap/sprawlens_wrap.js \ --minify --format=esm --outfile=moonbit-parser.js ``` -------------------------------- ### Serve Repository Structure Map Source: https://github.com/mizchi/sprawlens/blob/main/packages/cli/README.md Analyze a repository and open its structure map in a web browser. The path to the repository is required. ```bash npx @sprawlens/cli serve ``` -------------------------------- ### Report Language and LSP Details Source: https://github.com/mizchi/sprawlens/blob/main/packages/cli/README.md Generate a report detailing language detection, LSP availability, and specific features for a given repository. The path to the repository is required. ```bash npx @sprawlens/cli doctor ``` -------------------------------- ### Display Treemap in Terminal Source: https://github.com/mizchi/sprawlens/blob/main/packages/cli/README.md Print a diff-tinted treemap representation of the repository structure directly in the terminal. The path to the repository is required. ```bash npx @sprawlens/cli tui ``` -------------------------------- ### Extract MoonBit AST as JSON Source: https://github.com/mizchi/sprawlens/blob/main/packages/analyzer-moonbit/vendor/README.md Use the `extract` function to parse MoonBit source code and obtain its Abstract Syntax Tree (AST) as a JSON string. This function relies on the MoonBit parser compiled to JavaScript. ```javascript import { extract } from "./moonbit-parser.js"; const source = "fn main() { println(\"Hello, world!\"); }\n"; const astJson = extract(source); console.log(astJson); ``` -------------------------------- ### Sprawlens Git History Commands (TypeScript) Source: https://github.com/mizchi/sprawlens/blob/main/README.md Commands to snapshot Git commits for analysis and to diff consecutive snapshots. These commands are specifically for TypeScript projects. ```bash pnpm cli collect --commits 50 # snapshot N commits into .codesprawl/ pnpm cli analyze # diff consecutive snapshots ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.