{"id":15723158,"url":"https://github.com/scop/wrun","last_synced_at":"2025-12-30T07:49:45.202Z","repository":{"id":206291212,"uuid":"716288052","full_name":"scop/wrun","owner":"scop","description":"Web executable launcher, one command for multiple OS/architectures","archived":false,"fork":false,"pushed_at":"2024-10-19T07:41:54.000Z","size":260,"stargazers_count":4,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-25T10:04:28.329Z","etag":null,"topics":["architecture","ci","launcher","operating-system"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scop.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":"2023-11-08T20:28:00.000Z","updated_at":"2024-10-19T07:41:58.000Z","dependencies_parsed_at":"2024-06-28T21:47:08.956Z","dependency_job_id":"9d3cf1fd-d203-4477-899c-45a30c61f90e","html_url":"https://github.com/scop/wrun","commit_stats":null,"previous_names":["scop/wrun"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scop%2Fwrun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scop%2Fwrun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scop%2Fwrun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scop%2Fwrun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scop","download_url":"https://codeload.github.com/scop/wrun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222666835,"owners_count":17019883,"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":["architecture","ci","launcher","operating-system"],"created_at":"2024-10-03T22:10:30.565Z","updated_at":"2025-12-14T14:02:13.184Z","avatar_url":"https://github.com/scop.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wrun\n\n\u003e [!NOTE]\n\u003e As of 2024-12-28, wrun is deprecated and this project is archived, no future work or releases are planned.\n\u003e The problem wrun set out to solve has multiple solutions already that work great, for example (but not limited to) [mise](https://mise.jdx.dev) and [aqua](https://aquaproj.github.io).\n\n`wrun` downloads, caches, and runs an executable,\nwith the same one command for multiple OS/architectures.\n\nThe primary use case for what it was created is to be able to use a single static command line to download\nand invoke executables in git pre-commit hooks, without OS or architecture conditionals.\n\nExecutables to download can be standalone as-is, or inside archives.\nDownloads are cached locally, and optionally [checksum verified](#download-digests) on download.\n\n\u003cdetails\u003e\n\u003csummary\u003eDetailed usage message\u003c/summary\u003e\n\n```shellsession\n$ wrun --help\nwrun downloads, caches, and runs executables.\n\nOS and architecture matcher arguments for URLs to download and (if applicable) executables within archives can be used to construct command lines that work across multiple operating systems and architectures.\n\nThe OS and architecture wrun was built for are matched against the given matchers.\nOS and architecture parts of the matcher may be globs.\nOrder of the matcher arguments is significant: the first match of each is chosen.\n\nAs a special case, a matcher argument with no matcher part is treated as if it was given with the matcher */*.\nOn Windows, .exe is automatically appended to any archive exe path resulting from a */ prefixed match.\n\nURL fragments, if present, are treated as hashAlgo-hexDigest strings, and downloads are checked against them.\n\nThe first non-flag argument or -- terminates wrun arguments.\nRemaining ones are passed to the downloaded executable.\n\nEnvironment variables:\n- WRUN_ARGS_FILE: path to file containing command line arguments to prepend, one per line\n- WRUN_CACHE_HOME: cache location, defaults to wrun subdir in the user's cache dir\n- WRUN_OS_ARCH: override OS/arch for matching\n- WRUN_VERBOSE: output verbosity, false decreases, true increases\n\nUsage:\n  wrun [flags] -- [executable arguments]\n  wrun [command]\n\nAvailable Commands:\n  completion  Generate the autocompletion script for the specified shell\n  generate    generate wrun command line arguments for various tools\n  help        Help about any command\n\nFlags:\n  -p, --archive-exe-path strings   [OS/arch=]path to executable within archive matcher (separator always /, implies archive processing)\n  -n, --dry-run                    dry run, skip execution (but do download/set up cache)\n  -h, --help                       help for wrun\n  -t, --http-timeout duration      HTTP client timeout (default 5m0s)\n  -u, --url strings                [OS/arch=]URL matcher (at least one required)\n  -v, --version                    version for wrun\n\nUse \"wrun [command] --help\" for more information about a command.\n```\n\n\u003c/details\u003e\n\n## Installation\n\nPrebuilt binaries are available in\n[project releases](https://github.com/scop/wrun/releases),\napt and yum package repositories at\n[Packagecloud](https://packagecloud.io/scop/wrun).\n\nPrebuilt binaries are also available from PyPI,\nin the [`wrun-py`](https://pypi.org/project/wrun-py/) package,\ninstallable for example with `pip`:\n\n```shell\npython3 -m pip install wrun-py\n```\n\nTo build and install from sources, Go is required.\n\n```\ngo install github.com/scop/wrun@latest\n```\n\n## URL matching\n\nURLs are matched against the Go toolchain wrun was built with using\nthe `OS/architecture=` prefix given along with the URLs. Valid values\nfor these come from Go, the list is available by running\n`go tool dist list`, or from\n[Go sources](https://cs.opensource.google/go/go/+/refs/tags/go1.23.2:src/cmd/dist/build.go;l=1728-1778).\n\nOS and architecture may contain globs. The special case where the\n`OS/architecture=` prefix is left out is treated as if `*/*=` was\ngiven.\n\nOrder of specifying the URLs is significant; the first matching one\nis chosen.\n\n## Download digests\n\nTo verify downloads against known good digests, place a digest in the URL\nfragment.\nThe fragment format to use is `digestAlgo-hexDigest`.\n\nFor example:\n\n- `#sha256-2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9842`\n\n## Usage with [lefthook](https://github.com/evilmartians/lefthook)\n\nSee [`.lefthook.yaml` in this repo](.lefthook.yaml) for an example.\n\nNote that because in this repository we want to dogfood the latest wrun itself,\nwe invoke `go run .` instead of `wrun`.\n\nAnother example is in\n[scop/vault-token-helper-secret-tool](https://github.com/scop/vault-token-helper-secret-tool).\nSee [its `.lefthook.yaml`](https://github.com/scop/vault-token-helper-secret-tool/blob/main/.lefthook.yaml)\nfor how it runs wrun in the lefthook managed git pre-commit hook, and its\n[`.github/workflows/check.yml`](https://github.com/scop/vault-token-helper-secret-tool/blob/main/.github/workflows/check.yaml)\nfor how it installs wrun and installs and runs lefthook in CI.\n\n## Usage with [pre-commit](https://pre-commit.com)\n\nSee `.pre-commit-config.yaml` examples in\n[`.pre-commit-hooks.yaml`](.pre-commit-hooks.yaml).\n\n[pre-commit.ci](https://pre-commit.ci) is not supported, because it\n[disallows network access at runtime](https://github.com/pre-commit-ci/issues/issues/196#issuecomment-1810937079).\n\n## Caching\n\nCache resides by default in the `wrun` subdirectory of\nthe [user's cache directory](https://pkg.go.dev/os#UserCacheDir).\n`$WRUN_CACHE_HOME` overrides it.\n\nCache the cache dir in CI to avoid unnecessary executable downloads.\nA GitHub actions example is in [this repository's workflow configs](https://github.com/scop/wrun/blob/9438206aac358acf9f13fc8c72cf8297272dfcd3/.github/workflows/check.yaml#L14-L19).\n\n## Generating command line arguments\n\nThe `generate` subcommand can be used to generate wrun command line arguments for various tools.\n\nIt supports tools shipped in GitHub releases and PyPI executable wrapper wheels that meet its expectations\nabout asset filenames regarding their OS and architecture.\n\nSome additional tool specific generators are available as well for tools that are not served by the generic GitHub and PyPI generators.\nSee `wrun generate --help` for more information.\n\n\u003cdetails\u003e\n\u003csummary\u003egenerate output excerpts\u003c/summary\u003e\n\n```shellsession\n$ wrun generate --help\n[...]\nAvailable Commands:\n  black       generate wrun command line arguments for black\n  github      generate wrun command line arguments for tool in GitHub project asset\n  pypi        generate wrun command line arguments for tool in PyPI project wrapper wheel\n  shellcheck  generate wrun command line arguments for shellcheck\n  terraform   generate wrun command line arguments for terraform\n[...]\n\n$ wrun generate github --help\n[...]\nExamples:\nwrun generate github aquasecurity trivy\nwrun generate github astral-sh ruff\nwrun generate github astral-sh uv --tool uvx\nwrun generate github daveshanley vacuum\nwrun generate github dprint\nwrun generate github golangci golangci-lint\nwrun generate github hadolint\nwrun generate github mvdan sh --tool shfmt\nwrun generate github opentofu --tool tofu\n[...]\n\n$ wrun generate pypi --help\n[...]\nExamples:\nwrun generate pypi committed\nwrun generate pypi ruff\nwrun generate pypi typos\n[...]\n```\n\n\u003c/details\u003e\n\n### Automating executable updates\n\nBy default, `generate` generates command line arguments pointing to the version of the executable in question that it considers the latest.\nThis mode together with wrun's ability to load command line arguments from a file\ncan be used to help with automating executable updates.\n\nAn example of this is in this repo's [`.lefthook.yaml`](.lefthook.yaml) (lefthook part, see the `update-tools` \"hook\" in it),\nand [`.github/workflows/update-tools.yaml`](.github/workflows/update-tools.yaml) (CI part).\n[#98](https://github.com/scop/wrun/pull/98) is an example automated pull request automatically created by this config.\n(See the note about `go run .` vs `wrun` in the [lefthook](#usage-with-lefthook) chapter above.)\n\nThe PR creation part of that makes use of the [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request)\nGitHub action, but naturally the `generate` subcommand could be run manully and its output copy pasted to appropriate configuration file,\nand the related PR created manually.\n\n[Renovate](https://docs.renovatebot.com) e.g. along with its [regex](https://docs.renovatebot.com/modules/manager/regex/) manager\ncould be used to achieve the same. However, at time of writing (2024-12), [download digests](#download-digests) are not doable with it,\nand thus this approach, while possibly more convenient, is arguably inferior compared to the above.\n\n## License\n\nSPDX-License-Identifier: Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscop%2Fwrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscop%2Fwrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscop%2Fwrun/lists"}