Skip to main content

Thin wrapper to uvx-run a tool from github.com/<user>/<tool>[@<ref>].

Project description

uvx-gh

Thin wrapper to uvx-run a tool published as a GitHub repo at github.com/<user>/<tool>[@<ref>].

Install

# One-off run
uvx uvx-gh alice/foo

# Or install
pip install uvx-gh
# pip install git+https://github.com/qsoyq/uvx-gh.git    # latest from GitHub

Usage

uvx-gh [uvx-options...] USER/TOOL[@REF] [tool-args...]
uvx-gh [uvx-options...] --user USER TOOL[@REF] [tool-args...]

The USER/TOOL short path takes priority over --user. Either is required.

Ref suffix

Spec Behavior
alice/foo use locally cached HEAD sha; first call resolves via git ls-remote and persists
alice/foo@latest force re-resolve HEAD via git ls-remote and overwrite the cached sha
alice/foo@v1.2.3 pin to git ref (tag / branch / sha) directly — bypasses the sha cache

Why the sha cache?

uvx --from git+https://... (without a pinned commit) makes uv re-fetch HEAD from GitHub on every call — that's a network roundtrip per invocation. uvx-gh resolves HEAD itself via the smart-HTTP ls-remote protocol (using dulwich, no system git needed) and pins the URL to the resolved sha (git+...@<sha>). After the first run, subsequent calls hit the local cache and incur zero network traffic until you explicitly use @latest.

Cache location:

  • $UVX_GH_CACHE_HOME if set
  • otherwise $XDG_CACHE_HOME/uvx-gh/ (default ~/.cache/uvx-gh/)

Layout: <cache_dir>/github.com/<user>/<tool> containing the sha as a single line.

Pass-through

Anything the wrapper does not recognize is forwarded:

  • Tokens before TOOL_SPEC go to uvx (e.g. --python 3.12, --with extras)
  • Tokens after TOOL_SPEC go to the tool itself
  • -- ends wrapper-arg parsing; everything after -- is treated as tool args
uvx-gh --python 3.12 alice/foo --port 8080
# → uvx --python 3.12 --from git+https://github.com/alice/foo foo --port 8080

uvx-gh -- alice/foo --user bob
# → uvx --from git+https://github.com/alice/foo foo --user bob
#   (--user bob is forwarded to foo, NOT consumed by uvx-gh)

Requirements

uvx-gh depends on the uv toolchain (which provides the uvx binary). It does not require the system git CLI — HEAD resolution uses dulwich (pure Python, bundled as a runtime dep).

Install uv:

Platform Command
macOS brew install uv
Linux curl -LsSf https://astral.sh/uv/install.sh | sh
Windows winget install --id=astral-sh.uv -e
Any pipx install uv

uvx-gh runs a pre-flight check at startup and exits with a friendly message if uvx is not on PATH.

Notes

  • On Windows, os.execvp is emulated; signal/exit-code semantics differ slightly from POSIX.
  • The UVX_VALUE_FLAGS whitelist in uvx_gh/commands/main.py is hand-synced with uv's value-taking flags. Use --flag=value form to bypass the whitelist if a new uv flag is missing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uvx_gh-0.1.1.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uvx_gh-0.1.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file uvx_gh-0.1.1.tar.gz.

File metadata

  • Download URL: uvx_gh-0.1.1.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uvx_gh-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b7ebfd856d81fbae3a423e9a4786bff3b720040e768f43b352f6cd56ceea722a
MD5 fc385190050d235794d4d94a79db10c0
BLAKE2b-256 23767cc8f3b437af4033baa9e4ea92d4c3c269e7ee1c84c2e497689e05c34b9e

See more details on using hashes here.

File details

Details for the file uvx_gh-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: uvx_gh-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uvx_gh-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 279218dda3e987dfe6a578f218de9ecc3b7721b51341b74564ce63bb209692f6
MD5 b1867fc405f5ebfe6a783393d0ed5501
BLAKE2b-256 7300d7503dca35858b03b3de1bfaf73491a2e2b383768626e5035a1e82c65e67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page