{"id":13476646,"url":"https://github.com/gildas-lormeau/single-file-cli","last_synced_at":"2025-05-15T05:07:10.135Z","repository":{"id":37521237,"uuid":"498404221","full_name":"gildas-lormeau/single-file-cli","owner":"gildas-lormeau","description":"CLI tool for saving a faithful copy of a complete web page in a single HTML file (based on SingleFile)","archived":false,"fork":false,"pushed_at":"2025-03-31T22:54:48.000Z","size":5407,"stargazers_count":769,"open_issues_count":46,"forks_count":76,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-14T10:23:54.342Z","etag":null,"topics":["archiving","cli","crawler","deno","dockerfile","nodejs","scraping-websites","single-file","web-archiving","web-crawler","web-scraper","web-scraping"],"latest_commit_sha":null,"homepage":"https://www.getsinglefile.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gildas-lormeau.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-31T15:59:15.000Z","updated_at":"2025-04-13T06:12:20.000Z","dependencies_parsed_at":"2023-10-14T20:46:07.784Z","dependency_job_id":"f769cda2-c3d1-47e9-837d-c43d9ed96c71","html_url":"https://github.com/gildas-lormeau/single-file-cli","commit_stats":{"total_commits":671,"total_committers":9,"mean_commits":74.55555555555556,"dds":"0.014903129657228065","last_synced_commit":"a05d1bdfc0590383ad9fc583b02ca07d33098da9"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gildas-lormeau%2Fsingle-file-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gildas-lormeau%2Fsingle-file-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gildas-lormeau%2Fsingle-file-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gildas-lormeau%2Fsingle-file-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gildas-lormeau","download_url":"https://codeload.github.com/gildas-lormeau/single-file-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276447,"owners_count":22043867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archiving","cli","crawler","deno","dockerfile","nodejs","scraping-websites","single-file","web-archiving","web-crawler","web-scraper","web-scraping"],"created_at":"2024-07-31T16:01:32.941Z","updated_at":"2025-05-15T05:07:05.116Z","avatar_url":"https://github.com/gildas-lormeau.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","cli"],"sub_categories":[],"readme":"# SingleFile CLI (Command Line Interface)\n\n## Introduction\n\n[SingleFile](https://www.getsinglefile.com) can be launched from the command line by running it into a (headless) browser. \n\nIt runs through Deno as a standalone script injected into the web page via the Chrome DevTools Protocol instead of being embedded into a WebExtension.\n\n## Installation\n\nSingleFile 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\n\nMake 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.\n\n## Installation with Docker\n\n- Installation from Docker Hub\n\n  `docker pull capsulecode/singlefile`\n\n  `docker tag capsulecode/singlefile singlefile`\n\n- Manual installation\n\n  `git clone --depth 1 --recursive https://github.com/gildas-lormeau/single-file-cli.git`\n\n  `cd single-file-cli`\n\n  `docker build --no-cache -t singlefile .`\n\n- Run\n\n  `docker run singlefile \"https://www.wikipedia.org\"`\n\n- Run and redirect the result into a file\n\n  `docker run singlefile \"https://www.wikipedia.org\" \u003e wikipedia.html`\n\n- Run and mount a volume to get the saved file in the current directory\n\n  - Save one page\n\n    `docker run -v %cd%:/usr/src/app/out singlefile \"https://www.wikipedia.org\" wikipedia.html`\n    (Windows)\n\n    `docker run -v $(pwd):/usr/src/app/out singlefile \"https://www.wikipedia.org\" wikipedia.html`\n    (Linux/UNIX)\n\n  - Save one or multiple pages by using the filename template (see\n    `--filename-template` option)\n\n    `docker run -v %cd%:/usr/src/app/out singlefile \"https://www.wikipedia.org\" --dump-content=false`\n    (Windows)\n\n    `docker run -v $(pwd):/usr/src/app/out singlefile \"https://www.wikipedia.org\" --dump-content=false`\n    (Linux/UNIX)\n\n- An alternative docker file can be found here\n  https://github.com/screenbreak/SingleFile-dockerized. It allows you to save\n  pages from the command line interface or through an HTTP server.\n\n## Manual installation\n\n- Install [Deno](https://deno.com/)\n\n- There are 3 ways to download the code of SingleFile, choose the one you prefer:\n  \n  - Install with `npm` and run `single-file` via `npx` (`npm` and `npx` are installed with Node.js)\n  \n    ```sh\n    npm install \"single-file-cli\"\n    npx single-file ...\n    ```\n\n    You can also install SingleFile globally with `-g` when running `npm install`.\n\n  - Download and unzip manually the\n    [master archive](https://github.com/gildas-lormeau/single-file-cli/archive/master.zip)\n    provided by Github\n\n    ```sh\n    unzip master.zip .\n    cd single-file-cli-master\n    ```\n\n  - Download with `git`\n\n    ```sh\n    git clone --depth 1 --recursive https://github.com/gildas-lormeau/single-file-cli.git\n    cd single-file-cli\n    ```\n\n- Make `single-file` executable (Linux/Unix/BSD etc.).\n\n  ```sh\n  chmod +x single-file\n  ```\n\n## Run\n\n- Syntax\n\n  ```sh\n  single-file \u003curl\u003e [output] [options ...]\n  ```\n\n- Display help\n\n  ```sh\n  single-file --help\n  ```\n\n- Examples\n\n  - Dump the HTML content of https://www.wikipedia.org into the console\n\n  ```sh\n  single-file https://www.wikipedia.org --dump-content\n  ```\n\n  - Save https://www.wikipedia.org into `wikipedia.html` in the current folder\n\n  ```sh\n  single-file https://www.wikipedia.org wikipedia.html\n  ```\n\n  - Save a list of URLs stored into `list-urls.txt` in the current folder\n\n  ```sh\n  single-file --urls-file=list-urls.txt\n  ```\n\n  - Save https://www.wikipedia.org and crawl its internal links with the query\n    parameters removed from the URL\n\n  ```sh\n  single-file https://www.wikipedia.org --crawl-links=true --crawl-inner-links-only=true --crawl-max-depth=1 --crawl-rewrite-rule=\"^(.*)\\\\?.*$ $1\"\n  ```\n\n  - Save https://www.wikipedia.org and external links only\n\n  ```sh\n  single-file https://www.wikipedia.org --crawl-links=true --crawl-inner-links-only=false --crawl-external-links-max-depth=1 --crawl-rewrite-rule=\"^.*wikipedia.*$\"\n  ```\n\n## Compile executables\n\n - Compile executables into `/dist`\n\n  ```sh\n  ./compile.sh\n  ```\n\n\n## License\n\nSingleFile and SingleFile CLI are licensed under AGPL. Code derived from third-party projects is licensed under MIT. Please contact me at gildas.lormeau \u0026lt;at\u0026gt; gmail.com if you are interested in licensing the SingleFile code for a commercial service or product.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgildas-lormeau%2Fsingle-file-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgildas-lormeau%2Fsingle-file-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgildas-lormeau%2Fsingle-file-cli/lists"}