https://github.com/shellshape/webshot
A simple CLI tool to create screenshots from web pages in the terminal.
https://github.com/shellshape/webshot
cli rust screenshot terminal tool web-screenshot
Last synced: 4 months ago
JSON representation
A simple CLI tool to create screenshots from web pages in the terminal.
- Host: GitHub
- URL: https://github.com/shellshape/webshot
- Owner: shellshape
- License: mit
- Created: 2024-01-29T22:11:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-26T19:57:12.000Z (over 1 year ago)
- Last Synced: 2025-03-02T20:15:19.559Z (11 months ago)
- Topics: cli, rust, screenshot, terminal, tool, web-screenshot
- Language: Rust
- Homepage:
- Size: 48.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webshot
A simple CLI tool to create screenshots from web pages in the terminal.
This tool uses the [headless_chrome](https://crates.io/crates/headless_chrome) crate, which requires a local installation of Chrome or Chromium.
> **Information**
> This is the successor for my old tool [zekroTJA/webshot](https://github.com/zekroTJA/webshot), which uses [puppeteer](https://pptr.dev).
## Usage
```
$ webshot --help
Simply screenshot websites from your terminal
Usage: webshot [OPTIONS]
Arguments:
URL of the web page to be captured
Options:
-c, --config Path to a config file
-o, --output Output directory or file name
-W, --width Screen width
-H, --height Screen height
-s, --scale Scale factor
--wait-for Wait for DOM element (query selector) [default: body]
-h, --help Print help
-V, --version Print version
```
## Install
You can either download the latest release builds form the [Releases page](https://github.com/shellshape/webshot/releases) or you can install it using cargo install.
```
cargo install --git https://github.com/shellshape/webshot
```
## Configuration
You can create a configuration to define some default parameters. The tool will look for a config file in one of the following locations.
| | Local | Home Config |
|--|-------|-------------|
| **Linux** | `./webshot.*` | `$HOME/.config/webshot/config.*` |
| **Windows** | `.\webshot.*` | `%APPDATA%\webshot\config.*` |
| **OSX** | `./webshot.*` | `$HOME/Library/Application Support/webshot/config.*` |
Supported config types are the following.
- YAML (`.yaml`)
- TOML (`.toml`)
- JSON (`.json`)
An example config could look as following.
```toml
default_width = 1920
default_height = 1080
default_scale = 1.5
```