Skip to Content

Install Service

Run git0 in the background so website download buttons install the right release and show progress in the button.

git0 can run as a small background service that turns any website's download button into a one-click installer. The button hands the service a repository; the service picks the release asset built for your OS and CPU, downloads it, installs it, and opens the app, while the button fills up as a progress bar.

git0 --service=install     # start at login and register git0:// links
git0 --service=status      # is it running, and what is it installing
git0 --service=uninstall   # remove it
git0 --service            # or run it in the foreground, on 127.0.0.1:47100

It installs as a per-user service, because launching a desktop app has to happen inside your session: a systemd --user unit on Linux, a LaunchAgent on macOS, and a logon task on Windows. No admin rights are needed to install it.

Add the button to a site

<a href="https://github.com/owner/repo/releases/latest" data-git0-repo="owner/repo">Download</a>
<script src="https://unpkg.com/git0/demo/git0-button.js"></script>

When the service is running, clicking the link does not download a file. The button morphs into a progress bar showing the download, then the install, then the launch. When the service is not running, the link behaves as a normal link. demo/index.html has a live and a simulated example.

Links also work without the script: git0://install/owner/repo is registered with the OS on Linux and Windows, and http://127.0.0.1:47100/install?repo=owner/repo works everywhere.

What it installs

OSPreferred asset, in orderResult
Linux.AppImage, .deb, .rpm, .tar.gz, bare binaryAppImage and binaries go to ~/.git0/apps; .deb/.rpm install through the desktop's password prompt (pkexec)
macOS.dmg, .pkg, .zip/.tar.gzThe .app is copied to ~/Applications; a .pkg opens Installer
Windowssetup .exe, .msi, .zipThe installer runs with its own UI; a portable .zip is extracted to ~/.git0/apps

Asset names are matched on whole words, so darwin is never mistaken for win. An exact CPU match beats an unlabelled build, and an unlabelled build beats Rosetta or 32-bit fallbacks. Checksums, signatures and source archives are never picked. A command-line tool is installed but not launched, because it would start with no terminal attached.

Security

Any website can ask, but only you can say yes. The first install of a repository opens a git0 page from 127.0.0.1 asking you to allow it, and the website cannot answer that prompt for you: the page carries a one-time token, is served without CORS headers so other sites can't read it, and refuses to be framed. Tick "Always allow" to skip the prompt for that repository next time (stored in ~/.git0/service.json). The service listens on loopback only, rejects requests whose Host isn't loopback (DNS rebinding), and caps pending prompts at five.

HTTP API

RouteReturns
GET /health{ ok, name: "git0", version, os, arch }
POST /install { "repo": "owner/repo" }the job, plus statusUrl and approveUrl
GET /status/:idstatus (awaiting-approval, resolving, downloading, installing, launching, done, error, denied), progress 0–1, receivedBytes, totalBytes, asset, tag, installedPath, launched, error
GET /jobsevery job

Last updated on

On this page