{"id":18790,"library":"single-file-cli","title":"SingleFile CLI","description":"SingleFile CLI is a command-line tool (v2.0.83) for saving complete web pages as single HTML files, including CSS, images, fonts, and other resources embedded as data URIs. It operates by launching a headless Chromium browser via the Chrome DevTools Protocol and injecting a standalone script. Unlike browser extensions, this CLI is designed for automation, batch processing, and server-side use. It runs on Deno, Node.js (>=20), and Bun (>=1.0). Key differentiators include support for crawling links, URL filtering, Docker deployment, and extensive customization of saved output. Alternatives include monolith and archiveweb.page, but SingleFile CLI uniquely combines headless browser automation with SingleFile's proven page-saving fidelity.","status":"active","version":"2.0.83","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install single-file-cli","lang":"bash","label":"npm"},{"cmd":"yarn add single-file-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add single-file-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to render and save pages; the CLI communicates with a headless browser via CDP","package":"chrome/chromium","optional":false}],"imports":[{"note":"Can be run via npx after npm install -g single-file-cli or as a global command.","wrong":"single-file <url> without npx if not installed globally","symbol":"single-file","correct":"npx single-file <url>"},{"note":"Docker image is named 'capsulecode/singlefile', not 'singlefile-cli'.","wrong":"docker run singlefile-cli <url>","symbol":"SingleFile (Docker)","correct":"docker run capsulecode/singlefile <url>"},{"note":"The npx package name is 'single-file-cli', but the command is 'single-file'.","wrong":"npx single-file-cli <url>","symbol":"CLI via npx","correct":"npx single-file <url>"}],"quickstart":{"code":"npx single-file 'https://example.com' example.html --browser-executable-path='/usr/bin/chromium-browser'","lang":"bash","description":"Saves the page https://example.com to example.html, specifying a custom Chromium executable path."},"warnings":[{"fix":"Upgrade Node.js to >=20.","message":"Node.js <20 is no longer supported","severity":"breaking","affected_versions":"<=1.x"},{"fix":"Set the --browser-executable-path option or install Chrome in the default directory.","message":"Chromium/Chrome must be installed and accessible in default location or specified via --browser-executable-path","severity":"gotcha","affected_versions":">=2.0"},{"fix":"Use 'npx single-file' or install globally with -g.","message":"Running via npm without -g requires npx prefix; otherwise command not found","severity":"gotcha","affected_versions":">=2.0"},{"fix":"Enclose the rule in quotes to avoid shell expansion.","message":"The --crawl-rewrite-rule option uses regex with sed-like syntax, which may be misinterpreted in some shells","severity":"deprecated","affected_versions":">=2.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use 'npx single-file <url>'.","cause":"npx single-file-cli instead of npx single-file","error":"Error: Cannot find module 'single-file-cli'"},{"fix":"Set --browser-executable-path or install Chrome.","cause":"Chrome/Chromium not found in default path","error":"error: Uncaught (in promise) Error: Failed to launch browser"},{"fix":"Specify an output path with writable permissions.","cause":"Insufficient write permissions to the output directory","error":"Error: EACCES: permission denied, open 'out/filename.html'"},{"fix":"Add 'https://' prefix to the URL.","cause":"Missing protocol (http/https) in URL","error":"Error: Invalid URL"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}