Gangmax Blog

SingleFile CLI

From here.

SingleFile is software to save a complete web page into a single HTML file(via browser extension and a CLI tool). The CLI version “single-file-cil“ can be used as below.

Note that the instructions below show how to install and use this CLI tool with Docker which is the simplest way, however it requires you have Docker installed. You can also run from code without Docker, but it requires more work to do, such as installing the dependencies manually.

# Pull the Docker image of "single-file-cil".
docker pull capsulecode/singlefile
# Create a tag for the Docker image.
docker tag capsulecode/singlefile singlefile
# Run the tool by given the web page URL and save it to a file.
docker run singlefile "" > wechat.html

To better understand how the Docker image works, you can read the “Dockerfile” here.