Registry / web-framework / single-file-cli

single-file-cli

JSON →
library2.0.83jsnpmunverified

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.

npm install single-file-cli
INSTALL
IMPORT
SIG · SINGLE-FILE-CLI
S
single-file-cli
web-frameworkjavascriptv2.0.83
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

single-file
npx single-file <url>
single-file <url> without npx if not installed globally
Can be run via npx after npm install -g single-file-cli or as a global command.
SingleFile (Docker)
docker run capsulecode/singlefile <url>
docker run singlefile-cli <url>
Docker image is named 'capsulecode/singlefile', not 'singlefile-cli'.
CLI via npx
npx single-file <url>
npx single-file-cli <url>
The npx package name is 'single-file-cli', but the command is 'single-file'.

Saves the page https://example.com to example.html, specifying a custom Chromium executable path.

npx single-file 'https://example.com' example.html --browser-executable-path='/usr/bin/chromium-browser'
single-file --version
Debug
Known issues
breakingNode.js <20 is no longer supported
fix
Upgrade Node.js to >=20.
affects: <=1.x
gotchaChromium/Chrome must be installed and accessible in default location or specified via --browser-executable-path
fix
Set the --browser-executable-path option or install Chrome in the default directory.
affects: >=2.0
gotchaRunning via npm without -g requires npx prefix; otherwise command not found
fix
Use 'npx single-file' or install globally with -g.
affects: >=2.0
deprecatedThe --crawl-rewrite-rule option uses regex with sed-like syntax, which may be misinterpreted in some shells
fix
Enclose the rule in quotes to avoid shell expansion.
affects: >=2.0
Errors
Common errors & fixes
Error: Cannot find module 'single-file-cli'
npx single-file-cli instead of npx single-file
fix
Use 'npx single-file <url>'.
error: Uncaught (in promise) Error: Failed to launch browser
Chrome/Chromium not found in default path
fix
Set --browser-executable-path or install Chrome.
Error: EACCES: permission denied, open 'out/filename.html'
Insufficient write permissions to the output directory
fix
Specify an output path with writable permissions.
Error: Invalid URL
Missing protocol (http/https) in URL
fix
Add 'https://' prefix to the URL.
Upgrade
Version history
2.0.83latest on npm
Audit
Dependencies
chrome/chromiumrequiredRequired to render and save pages; the CLI communicates with a headless browser via CDP
Agent activity
10 hits · last 30 days
node
6
Amazon
1
OpenAI (training)
1
Resources
single-file-cli — npm install single-file-cli · libregistry