| Crates.io | wgex |
| lib.rs | wgex |
| version | 0.1.0 |
| created_at | 2025-08-12 18:38:59.10371+00 |
| updated_at | 2025-08-12 18:38:59.10371+00 |
| description | Securely fetch, cache, and execute scripts from URLs with hash verification, TTL-based caching, and optional sandboxing. Designed for safe, repeatable script execution. |
| homepage | https://patbeagan.dev |
| repository | https://github.com/patbeagan1/Open-Source-Requests |
| max_upload_size | |
| id | 1792334 |
| size | 80,655 |
wgex is a secure, cache-aware CLI tool for fetching, verifying, and executing scripts from remote URLs. It is designed for safe, repeatable script execution with strong security guarantees, including hash verification, TTL-based caching, and optional sandboxing.
It's intended to add a little more security to installation scripts that tell you to do curl mycommand.net/install | sh
chroot-based sandboxing on Unix for isolated script execution.wgex is built with security as a top priority:
--allow-http to override (not recommended).--sandbox chroot to run scripts in a minimal chroot jail (requires root).cargo install wgex
# We'll get a warning and exit if the content from the server doesn't match the hash
wgex \
--url https://raw.githubusercontent.com/patbeagan1/dotfiles/refs/heads/master/scripts/documentation/show.py \
--sha256 f52ea09aa5300ecde0bccc76ae5e8ffe961e5b358d7d520de5e71414ef352c7b \
-- \
--magick
# arguments to the script that's being downloaded come after the double dash "--"
A tool to securely fetch, cache, and execute scripts
USAGE:
wgex [OPTIONS] --url <URL> [SCRIPT_ARGS]...
ARGS:
<SCRIPT_ARGS>... Arguments to pass to the script. To pass arguments, use '--' before the
script arguments
OPTIONS:
--allow-http
Allow plain HTTP (insecure). Defaults to false; only HTTPS is allowed by default
-h, --help
Print help information
--log-level <LOG_LEVEL>
Log level: off, error, warn, info, debug, trace. Default: off [default: off] [possible
values: off, error, warn, info, debug, trace]
--max-bytes <MAX_BYTES>
Maximum download size in bytes. Default 20 MiB [default: 20971520]
--sandbox <SANDBOX>
Sandbox mode: none or chroot. Default: none [default: none] [possible values: none,
chroot]
--sha256 <SHA256>
The expected SHA256 hash of the script
--timeout-secs <TIMEOUT_SECS>
HTTP client timeout in seconds [default: 20]
--ttl <TTL>
Time-to-live for the cache in seconds. After this time, the URL will be re-checked
[default: 86400]
--url <URL>
The URL of the script to fetch
-V, --version
Print version information