{"id":24650432,"url":"https://github.com/falk-werner/fetch","last_synced_at":"2026-05-15T23:40:04.754Z","repository":{"id":273000221,"uuid":"918428636","full_name":"falk-werner/fetch","owner":"falk-werner","description":"Download artifact and verify it's checksum.","archived":false,"fork":false,"pushed_at":"2025-03-10T16:36:33.000Z","size":207,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T17:36:56.562Z","etag":null,"topics":["checksum","cli","command-line","command-line-tool","curl","download","fetch","md5","sha256","tool","wget"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"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/falk-werner.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}},"created_at":"2025-01-17T23:09:29.000Z","updated_at":"2025-03-10T16:36:35.000Z","dependencies_parsed_at":"2025-02-02T10:18:53.179Z","dependency_job_id":"0c44f2ce-91ab-4fc8-967f-5531ba43fc43","html_url":"https://github.com/falk-werner/fetch","commit_stats":null,"previous_names":["falk-werner/fetch"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falk-werner%2Ffetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falk-werner%2Ffetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falk-werner%2Ffetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falk-werner%2Ffetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/falk-werner","download_url":"https://codeload.github.com/falk-werner/fetch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244685676,"owners_count":20493308,"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":["checksum","cli","command-line","command-line-tool","curl","download","fetch","md5","sha256","tool","wget"],"created_at":"2025-01-25T18:15:03.314Z","updated_at":"2026-05-15T23:39:59.723Z","avatar_url":"https://github.com/falk-werner.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build](https://github.com/falk-werner/fetch/actions/workflows/build.yaml/badge.svg)](https://github.com/falk-werner/fetch/actions/workflows/build.yaml)\n\n[![Snap Store](https://raw.githubusercontent.com/snapcore/snap-store-badges/master/EN/[EN]-snap-store-white.png)](https://snapcraft.io/fetch)\n\n# fetch\n\nDownloads an aritfact from a URL and optionally verifies it's SHA256 or MD5 checksum.\n\n## Usage\n\n```bash\nfetch -L $SOME_URL --sha256 $SHA256_HASH\n```\n\n## Motivation\n\nA typical use case is to download an artifact from a URL and verify it's checksum afterwards.\nUnfortunately, there is no commonly used tool which provides this in one step. There are\nmultiple feature requests on commonly used tools such as [curl](https://curl.se/), which \nwere closed due to a lack of interest (see [here](https://github.com/curl/curl/issues/6836)\nor [here](https://github.com/curl/curl/issues/1399)).\n\nOn the other hand, popular tools such as [rustup](https://rustup.rs/) and\n[node.js](https://nodejs.org/en/download) propose dangerous workflows for installations,\nwhere a direct download is piped into a shell:\n\n```bash\nurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nIt would be nice to enhance security of those workflows by verifiing a MD5 oder SHA256\nchecksum during download.\n\nThis can be achieved using the `fetch` utility.\n\n## Command Line Options\n\n```bash\nfetch [OPTIONS] \u003cURL\u003e\n```\n\nCommand line options are strongly inspired by [curl](https://curl.se/).\nWhile `fetch` does not use all options that `curl` provides, the options `fetch` provides are\nnamed the same as `curl`'s options. Therefore, `fetch` can be used as drop-in replacement for\n`curl` in most use cases.\n\n| Option | Type | Description |\n| ------ | ---- | ----------- |\n| -o, --output | Path | Write to file instead of stdout |\n| -X, --request | HTTP Method | Specify the request method to use |\n| -H, --header | string | Pass custom header(s) to server |\n| -A, --user-agent | string | Send user agent to server |\n| -d, --data | string | Post data |\n| --data-raw | string | Post data, '@' allowed |\n| -F, --form | string | Specify multipart form data as name=value pair |\n| -k, --insecure | flag | Allow insecure server connections |\n| -L, --location | flag | Follow redirects |\n| --max-redirs | uint | Maximum number of redirects |\n| --max-filesize | uint | Maximum file size to download |\n| --connection-timeout | uint | Maximum time allowed for connection in seconds |\n| -m, --max-time | uint | Maximum time allowed for transfer in seconds |\n| -1, --tlsv1, --tlsv1.0 | flag | Use TLSv1.0 or later |\n| --tlsv1.1 | flag | Use TLSv1.1 or later |\n| --tlsv1.2 | flag | Use TLSv1.2 or later |\n| --tlsv1.3 | flag | Use TLSv1.3 or later |\n| --proto   | string | List of enabled protocols (see below) |\n| -s, --silent | flag | Silent mode |\n| -S, --show-error | flag | show error messages, even in silent mode |\n| -v, --verbose | flag | show additional log messages |\n| -i, --include | flag | include HTTP reponse headers in the output |\n| -f, --fail | flag | Fail silently (no output at all) on HTTP errors |\n| --fail-with-body | flag | Fail on HTTP errors but save the body |\n| -x, --proxy | string | | [protocol://]host[:port] Use this proxy |\n| --cacert | string | CA certificate to verify peer against |\n| --crlfile | string |Use this CRL list |\n| --sha256 | hex-string | SHA256 checksum of the artifact to download |\n| --md5 | hex-string | MD5 checksum of the artifact to download |\n| -h, --help | flag | Print help |\n| -V, --version | flag | Print version |\n\n## Protocols\n\nThe argument of the `--proto` option is a single string that contains\nan expression that is evaluated from the left to the right. It contains\na list of protocols with an optional modifier. The following modifiers\nare defined:\n\n- `+`: adds a protocol; default if no modifier is specified explicitly\n- `-`: removed a protocol\n- `=`: sets the specified protocol only\n\nKnown protocols:\n\n- `all`: placeholder for all known protocols\n- `http`: HTTP protocol\n- `https`: HTTPS protocol\n\nExamples:\n\n- `=https`: allow HTTPS only\n- `-all,https`: allow HTTPS only\n- `-http`: don't allow HTTP\n\nNote that `fetch` uses this argument only to check, if HTTP-only mode\ncan be activated, `fetch` does never disable HTTPS. The `--proto`\noption was added to maintain compatibility with `curl`.\n\n## Missing Features\n\nFetch does not aim at full curl compatibility, since fetch focuses on\nhttp / https protocol only. We also do not aim to support each http / https\nrelated option, since some options are rarely used.\n\nThe following options are planned to be added in future:\n\n- mTLS support  \n  curl options: `-E`, `--cert`, `--cert-status`, `--cert-type`\n- .netrc support  \n  curl options: `-n`, `--netrc`, `--netrc-file`\n- show document information  \n  curl options: `-I`, `--head`\n- dump response headers info file  \n  curl options: `-D`, `--dump-reader`\n- etag support  \n  curl options: `--etag-compare`, `--etag-save`\n- put post data in url for GET request  \n  curl options: `-G`, `--get`\n- convenience helpers for often used headers  \n  curl options: `-u`, `--user`, `-r`, `--range`, `-e`, `--referer`, `-b`,  \n  `--cookie`, `-c`, `--cookie-jar`, `-U`, `--proxy-user`\n- redirect `stderr`  \n  curl option: `--stderr`\n\n## Run tests\n\nIn order to run tests, [bats](https://github.com/bats-core/bats-core) is needed.\nPlease install `bats` and build `fetch` before running the tests.\n\n```bash\nbats test\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalk-werner%2Ffetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalk-werner%2Ffetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalk-werner%2Ffetch/lists"}