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.

1
2
3
4
5
6
# 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 "https://mp.weixin.qq.com/s/_MQmML08NWAtbhf8uxvZUg" > wechat.html

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

Comments