← 返回命令列表

Linux command

monolith 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Save webpage as single HTML file

monolith [https://example.com] -o [page.html]

Include JavaScript

monolith -j [https://example.com] -o [page.html]

Exclude images

monolith -i [https://example.com] -o [page.html]

Isolate from network

monolith -I [https://example.com] -o [page.html]

Set custom user agent

monolith -u "[Mozilla/5.0...]" [https://example.com] -o [page.html]

Save from local file

monolith [file:///path/to/page.html] -o [output.html]

Set timeout

monolith -t [30] [https://example.com] -o [page.html]

说明

monolith saves complete webpages as single HTML files. It embeds all assets - CSS, images, fonts, JavaScript - as data URLs within the HTML, creating a fully self-contained document. Unlike browser "Save As" which creates folders of assets, monolith produces one file that works offline. This is ideal for archiving, documentation, and sharing. The isolation mode (-I) creates truly offline pages by removing external references. Combined with -j to remove JavaScript, it creates static snapshots without any network dependencies. Asset exclusion options reduce file size when full fidelity isn't needed. Excluding images or fonts significantly shrinks output. The tool handles CSS @import and relative URLs correctly. Local files can be processed using file:// URLs. This enables converting existing HTML with external assets into self-contained documents. Error handling with -e continues processing when individual resources fail to load, useful for pages with broken links or blocked resources.

参数

-o _FILE_, --output _FILE_
Output file.
-j, --no-js
Exclude JavaScript.
-c, --no-css
Exclude CSS.
-i, --no-images
Exclude images.
-f, --no-frames
Exclude iframes.
-F, --no-fonts
Exclude fonts.
-v, --no-video
Exclude video.
-a, --no-audio
Exclude audio.
-I, --isolate
Disable network requests.
-e, --ignore-errors
Continue on resource errors.
-t _SEC_, --timeout _SEC_
Request timeout.
-u _AGENT_, --user-agent _AGENT_
Custom User-Agent.
-b _URL_, --base-url _URL_
Base URL for relative paths.
-d _DOMAIN_, --domain _DOMAIN_
Limit to domain.
-k, --insecure
Accept invalid certificates.
-s, --silent
Suppress output.

FAQ

What is the monolith command used for?

monolith saves complete webpages as single HTML files. It embeds all assets - CSS, images, fonts, JavaScript - as data URLs within the HTML, creating a fully self-contained document. Unlike browser "Save As" which creates folders of assets, monolith produces one file that works offline. This is ideal for archiving, documentation, and sharing. The isolation mode (-I) creates truly offline pages by removing external references. Combined with -j to remove JavaScript, it creates static snapshots without any network dependencies. Asset exclusion options reduce file size when full fidelity isn't needed. Excluding images or fonts significantly shrinks output. The tool handles CSS @import and relative URLs correctly. Local files can be processed using file:// URLs. This enables converting existing HTML with external assets into self-contained documents. Error handling with -e continues processing when individual resources fail to load, useful for pages with broken links or blocked resources.

How do I run a basic monolith example?

Run `monolith [https://example.com] -o [page.html]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o _FILE_, --output _FILE_ do in monolith?

Output file.