2.0.36 • Published 7 days ago

single-file-cli v2.0.36

Weekly downloads
-
License
-
Repository
-
Last release
7 days ago

SingleFile CLI (Command Line Interface)

Introduction

SingleFile can be launched from the command line by running it into a (headless) browser.

It runs through Deno as a standalone script injected into the web page via the Chrome DevTools Protocol instead of being embedded into a WebExtension.

Installation

SingleFile can be run without installing it, just download the executable file and save it in the directory of your choice here: https://github.com/gildas-lormeau/single-file-cli/releases

Make sure Chrome or a Chromium-based browser is installed in the default folder. Otherwise you might need to set the --browser-executable-path option to help SingleFile locating the path of the executable file.

Installation with Docker

  • Installation from Docker Hub

    docker pull capsulecode/singlefile

    docker tag capsulecode/singlefile singlefile

  • Manual installation

    git clone --depth 1 --recursive https://github.com/gildas-lormeau/single-file-cli.git

    cd single-file-cli

    docker build --no-cache -t singlefile .

  • Run

    docker run singlefile "https://www.wikipedia.org"

  • Run and redirect the result into a file

    docker run singlefile "https://www.wikipedia.org" > wikipedia.html

  • Run and mount a volume to get the saved file in the current directory

    • Save one page

      docker run -v %cd%:/usr/src/app/out singlefile "https://www.wikipedia.org" wikipedia.html (Windows)

      docker run -v $(pwd):/usr/src/app/out singlefile "https://www.wikipedia.org" wikipedia.html (Linux/UNIX)

    • Save one or multiple pages by using the filename template (see --filename-template option)

      docker run -v %cd%:/usr/src/app/out singlefile "https://www.wikipedia.org" --dump-content=false (Windows)

      docker run -v $(pwd):/usr/src/app/out singlefile "https://www.wikipedia.org" --dump-content=false (Linux/UNIX)

  • An alternative docker file can be found here https://github.com/screenbreak/SingleFile-dockerized. It allows you to save pages from the command line interface or through an HTTP server.

Manual installation

  • Install Deno

  • There are 3 ways to download the code of SingleFile, choose the one you prefer:

    • Download and install with npm (npm is installed with Node.js)

      npm install "single-file-cli"
      cd node_modules/single-file-cli

      You can also install SingleFile globally with -g when running npm install.

    • Download and unzip manually the master archive provided by Github

      unzip master.zip .
      cd single-file-cli-master
    • Download with git

      git clone --depth 1 --recursive https://github.com/gildas-lormeau/single-file-cli.git
      cd single-file-cli
  • Make single-file executable (Linux/Unix/BSD etc.).

    chmod +x single-file

Run

  • Syntax

    single-file <url> [output] [options ...]
  • Display help

    single-file --help
  • Examples

    single-file https://www.wikipedia.org --dump-content
    single-file https://www.wikipedia.org wikipedia.html
    • Save a list of URLs stored into list-urls.txt in the current folder
    single-file --urls-file=list-urls.txt
    single-file https://www.wikipedia.org --crawl-links=true --crawl-inner-links-only=true --crawl-max-depth=1 --crawl-rewrite-rule="^(.*)\\?.*$ $1"
    single-file https://www.wikipedia.org --crawl-links=true --crawl-inner-links-only=false --crawl-external-links-max-depth=1 --crawl-rewrite-rule="^.*wikipedia.*$"

Compile executables

  • Compile executables into /dist

    ./compile.sh

License

SingleFile and SingleFile CLI are licensed under AGPL. Code derived from third-party projects is licensed under MIT. Please contact me at gildas.lormeau <at> gmail.com if you are interested in licensing the SingleFile code for a commercial service or product.

2.0.35

8 days ago

2.0.36

7 days ago

2.0.34

15 days ago

2.0.33

23 days ago

2.0.32

23 days ago

2.0.31

26 days ago

2.0.30

29 days ago

2.0.29

1 month ago

2.0.28

1 month ago

2.0.26

1 month ago

2.0.27

1 month ago

2.0.24

1 month ago

2.0.25

1 month ago

2.0.23

1 month ago

2.0.22

1 month ago

2.0.20

1 month ago

2.0.21

1 month ago

2.0.19

1 month ago

2.0.18

1 month ago

2.0.17

1 month ago

2.0.15

1 month ago

2.0.16

1 month ago

2.0.13

1 month ago

2.0.14

1 month ago

2.0.12

1 month ago

2.0.11

1 month ago

2.0.10

2 months ago

2.0.7

2 months ago

2.0.6

2 months ago

2.0.9

2 months ago

2.0.8

2 months ago

2.0.5

2 months ago

2.0.3

2 months ago

2.0.2

2 months ago

2.0.4

2 months ago

1.1.52

3 months ago

1.1.54

3 months ago

1.1.53

3 months ago

1.1.51

3 months ago

1.1.50

3 months ago

1.1.49

4 months ago

1.1.48

4 months ago

1.1.47

4 months ago

1.1.46

5 months ago

1.1.45

5 months ago

1.1.44

5 months ago

1.1.43

5 months ago

1.1.29

6 months ago

1.1.28

6 months ago

1.1.30

6 months ago

1.1.34

6 months ago

1.1.33

6 months ago

1.1.32

6 months ago

1.1.31

6 months ago

1.1.38

5 months ago

1.1.37

5 months ago

1.1.36

5 months ago

1.1.35

6 months ago

1.1.39

5 months ago

1.1.41

5 months ago

1.1.40

5 months ago

1.1.42

5 months ago

1.1.12

7 months ago

1.1.16

6 months ago

1.1.15

6 months ago

1.1.14

7 months ago

1.1.13

7 months ago

1.1.19

6 months ago

1.1.18

6 months ago

1.1.17

6 months ago

1.1.23

6 months ago

1.1.22

6 months ago

1.1.21

6 months ago

1.1.20

6 months ago

1.1.27

6 months ago

1.1.26

6 months ago

1.1.25

6 months ago

1.1.24

6 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.1.9

7 months ago

1.1.8

7 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

7 months ago

1.1.11

7 months ago

1.1.10

7 months ago

1.0.62

9 months ago

1.0.61

9 months ago

1.0.60

9 months ago

1.0.66

9 months ago

1.0.65

9 months ago

1.0.64

9 months ago

1.0.63

9 months ago

1.0.69

8 months ago

1.0.68

8 months ago

1.0.67

8 months ago

1.0.44

10 months ago

1.0.43

10 months ago

1.0.42

10 months ago

1.0.41

11 months ago

1.0.48

10 months ago

1.0.47

10 months ago

1.0.46

10 months ago

1.0.45

10 months ago

1.0.49

10 months ago

1.0.51

10 months ago

1.0.50

10 months ago

1.0.55

9 months ago

1.0.54

9 months ago

1.0.53

9 months ago

1.0.52

9 months ago

1.0.59

9 months ago

1.0.58

9 months ago

1.0.57

9 months ago

1.0.56

9 months ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.40

12 months ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.27

1 year ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago