SDK
Runner
Register and manage a self-hosted GitHub Actions runner that executes pipeline stages on your own hardware.
A self-hosted runner lets the harness run agent stages on a machine you control — your laptop, a build box, or a GPU host for local models. The Runner class installs it as a service, reports its health, and tears it down cleanly.
Install a runner
from harnext import Runner
runner = Runner(repo=".") # uses the repo's GitHub remote
runner.install(
service="systemd", # or "launchd" on macOS
labels=["gpu"], # extra labels in addition to the repo-pinned one
)Idempotent by design
install()is safe to re-run — it skips work that's already done, so you can call it from provisioning scripts without guards.Status & logs
status = runner.status()
status.active # True
status.registered # True
status.online # visible to GitHub
status.labels # ["self-hosted", "harnext-9f4ac1b", "gpu"]
status.jobs_24h # {"picked_up": 18, "ok": 17, "failed": 1}
for line in runner.logs(follow=True):
print(line)Equivalent CLI
Shell
harnext runner status
harnext runner logs --follow
harnext runner uninstallUninstall
Removal is best-effort and complete: it deregisters the runner from GitHub, stops and removes the service, and drops local artifacts.
runner.uninstall()Public-repo guardrail
On public repositories, install()verifies that fork-PR approval gates are enabled before registering, so an untrusted PR can't execute on your hardware. Override only if you fully understand the exposure.