{"id":13394526,"url":"https://github.com/sindresorhus/pageres-cli","last_synced_at":"2025-05-14T00:06:56.488Z","repository":{"id":45537694,"uuid":"37809686","full_name":"sindresorhus/pageres-cli","owner":"sindresorhus","description":"Capture website screenshots","archived":false,"fork":false,"pushed_at":"2025-02-05T12:16:13.000Z","size":747,"stargazers_count":1706,"open_issues_count":0,"forks_count":72,"subscribers_count":38,"default_branch":"main","last_synced_at":"2025-05-11T20:23:13.266Z","etag":null,"topics":["capture-screenshots","command-line-app","nodejs","npm-package"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.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},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2015-06-21T13:22:33.000Z","updated_at":"2025-05-08T02:10:40.000Z","dependencies_parsed_at":"2023-11-11T11:04:34.446Z","dependency_job_id":"edcb529f-9989-4c1e-825b-1854f7ced4ad","html_url":"https://github.com/sindresorhus/pageres-cli","commit_stats":{"total_commits":199,"total_committers":20,"mean_commits":9.95,"dds":0.3919597989949749,"last_synced_commit":"2b30abf6c47cecefbf6c50fba8bec13757df9b0d"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fpageres-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fpageres-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fpageres-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fpageres-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/pageres-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254043618,"owners_count":22004978,"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":["capture-screenshots","command-line-app","nodejs","npm-package"],"created_at":"2024-07-30T17:01:22.649Z","updated_at":"2025-05-14T00:06:56.466Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# pageres-cli\n\n![](screenshot.png)\n\n![](screenshot-output.png)\n\nCapture screenshots of websites in various resolutions. A good way to make sure your websites are responsive. It's speedy and generates 100 screenshots from 10 different websites in just over a minute. It can also be used to render SVG images.\n\n*See [pageres](https://github.com/sindresorhus/pageres) for the programmatic API and issues tracker.*\n\n## Install\n\n```sh\nnpm install --global pageres-cli\n```\n\nNote to Linux users: If you get a \"No usable sandbox!\" error, you need to enable [system sandboxing](https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#setting-up-chrome-linux-sandbox).\n\n## Usage\n\nSpecify urls and screen resolutions as arguments. Order doesn't matter.\n\nIf no resolution is specified it will default to `1366x768` which is the most popular resolution.\n\n```sh\npageres \u003curl\u003e \u003cresolution\u003e\npageres \u003cresolution\u003e \u003curl\u003e\n\n# \u003curl\u003e can also be a local file path.\npageres \u003cfile\u003e \u003cresolution\u003e\n```\n\nList multiple urls and resolutions for pageres to capture all combinations.\n\n```sh\npageres \u003curl\u003e \u003cresolution\u003e ...\n\npageres https://sindresorhus.com 1024x768 1366x768 # 2 screenshots\npageres https://sindresorhus.com https://example.com 1024x768 # 2 screenshots\npageres https://sindresorhus.com https://example.com 1024x768 1366x768 # 4 screenshots\n```\n\nGroup arguments with square brackets.\n\n```sh\npageres [ \u003curl\u003e \u003cresolution\u003e ] [ \u003curl\u003e \u003cresolution\u003e ]\npageres [ \u003curl\u003e \u003cresolution\u003e ... ]\n\n# Mix grouped and single arguments\npageres [ https://example.com 1024x768 1600x900 ] https://sindresorhus.com 1366x768\n\n# Options defined inside a group will override the outer ones.\npageres [ https://example.com 1024x768 --no-crop ] https://sindresorhus.com 1366x768 --crop\n```\n\nScreenshots are saved in the current directory.\n\n### Examples\n\n```sh\n# Basic multi-url, multi-resolution usage\npageres https://sindresorhus.com https://example.com 1366x768 1600x900\n\n# Override outer option within group\npageres [ https://example.com 1366x768 1600x900 --no-crop ] [ https://sindresorhus.com 1024x768 480x320 ] --crop\n\n# Provide a custom filename template\npageres https://sindresorhus.com 1024x768 --filename='\u003c%= date %\u003e - \u003c%= url %\u003e'\n\n# Capture a specific element\npageres https://example.com 1366x768 --selector='.page-header'\n\n# Hide a specific element\npageres https://example.com 1366x768 --hide='.page-header'\n\n# Capture a local file\npageres unicorn.html 1366x768\n```\n\n### Options\n\n##### `--verbose`, `-v`\n\nVerbose output to see errors if you need to troubleshoot.\n\n##### `--crop`, `-c`\n\nCrop to the set height.\n\n```sh\npageres https://sindresorhus.com 1024x768 --crop\n```\n\n##### `--delay=\u003cnumber\u003e`, `-d`\n\nDelay screenshot capture.\n\n```sh\npageres https://sindresorhus.com 1024x768 --delay=3\n```\n\n##### `--filename=\u003ctemplate\u003e`\n\nCustom filename.\n\n```sh\npageres https://sindresorhus.com 1024x768 --filename='\u003c%= date %\u003e - \u003c%= url %\u003e'\n```\n\n##### `--overwrite`\n\nOverwrite destination file if it exists. Defaults to appending ` (n)` to the file name if `--overwrite` is not set.\n\n```sh\npageres https://sindresorhus.com 1366x768 --overwrite\n```\n\n##### `--selector=\u003celement\u003e`\n\nCapture DOM element.\n\n```sh\npageres https://example.com 1366x768 --selector='.page-header'\n```\n\n##### `--hide=\u003celement\u003e`\n\nHide DOM element. Can be set multiple times.\n\n```sh\npageres https://example.com 1366x768 --hide='.page-header'\n```\n\n##### `--no-crop`\n\nOverride a global crop option within a group.\n\n```sh\npageres [ https://example.com 1366x768 --no-crop ] https://sindresorhus.com 1024x768 --crop\n```\n\n##### `--css=\u003cstring\u003e`\n\nApply custom CSS to the webpage. Specify some CSS or the path to a CSS file.\n\n```sh\npageres https://sindresorhus.com --css='body { background: red; }'\npageres https://sindresorhus.com --css='style.css'\n```\n\n##### `--cookie=\u003ccookie\u003e`\n\nBrowser cookie. Can be set multiple times.\n\n```sh\npageres https://example.com --cookie='foo=bar'\n```\n\n##### `--header=\u003cheader\u003e`\n\nCustom HTTP request header. Can be set multiple times.\n\n```sh\npageres https://example.com --header='Cache-Control: no-cache'\n```\n\n##### `--username=\u003cusername\u003e`\n\nUsername for HTTP auth.\n\n##### `--password=\u003cpassword\u003e`\n\nPassword for HTTP auth.\n\n##### `--scale=\u003cnumber\u003e`\n\nScale webpage `n` of times.\n\n##### `--format=\u003cstring\u003e`\n\nImage format. Either `png` *(default)* or `jpg`.\n\n##### `--user-agent=\u003cstring\u003e`\n\nCustom user agent.\n\n##### `--transparent`\n\nSet background color to `transparent` instead of `white` if no background is set.\n\n##### `--darkMode`\n\nEmulate preference of dark color scheme.\n\n## Config file\n\nYou can persist your commands into a file and run it whenever with eg. `sh .pageres`:\n\n```sh\n# .pageres\npageres [ https://sindresorhus.com 1000x1000 --crop ] [ https://example.com 500x500 ]\npageres [ https://google.com 1000x1000 --crop ] [ https://github.com 500x500 ]\n```\n\n## Related\n\n- [pageres](https://github.com/sindresorhus/pageres) - API for this module\n- [capture-website-cli](https://github.com/sindresorhus/capture-website-cli) - A different take on screenshotting websites\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","Images","nodejs","Web Development","Development","Tools","\u003ca name=\"webdev\"\u003e\u003c/a\u003eWeb development","CLI Tools"],"sub_categories":["Emoji","Web Development","React Components"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fpageres-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fpageres-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fpageres-cli/lists"}