relayrunner 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,48 +1,151 @@
1
- # RelayRunner
1
+ # RelayRunner CLI
2
2
 
3
- Run selected GitHub Actions jobs on your own machine during development, then
4
- switch future jobs back to GitHub-hosted runners.
3
+ Connects a machine to the RelayRunner gateway so it can run your workspace's
4
+ GitHub Actions jobs. It's published to npm as
5
+ [`relayrunner`](https://www.npmjs.com/package/relayrunner) and needs Node.js 22
6
+ or newer on macOS or Linux (x64 or ARM64).
5
7
 
6
- ## Install
8
+ ```sh
9
+ npm install --global relayrunner # or use npx relayrunner
10
+ ```
7
11
 
8
- ### Install with an agent
12
+ Machines only take jobs from private repositories. To opt jobs in, see the
13
+ [root README](../../README.md#how-it-works) or
14
+ [docs/agent-install.md](../../docs/agent-install.md).
9
15
 
10
- Paste this into your agent from the checkout you want to set up:
16
+ ## `relayrunner connect`
11
17
 
12
- ```text
13
- Set up RelayRunner in this checkout using https://raw.githubusercontent.com/atticoos/RelayRunner/main/docs/agent-install.md
18
+ ```sh
19
+ npx relayrunner connect
14
20
  ```
15
21
 
16
- ### Install manually
22
+ The first run signs you in: it shows a code and opens the dashboard, where you
23
+ pick the workspace and name for this machine and approve. The machine token is
24
+ saved to `~/.relayrunner/machine.json` (mode 0600); later runs reuse it.
25
+
26
+ While it runs, the machine is online: it keeps a WebSocket open to the gateway,
27
+ runs the jobs it's sent (one at a time) and prints what happens. It reconnects
28
+ on its own if the connection drops. Ctrl-C takes it offline; a job that's
29
+ running stops with it.
30
+
31
+ - `--server <url>` or `RELAYRUNNER_URL` points it at another gateway. Changing it signs in again.
32
+ - `--name <name>` changes the suggested machine name (default: the hostname).
33
+ - `--share only-me|anyone` sets who can run jobs on this machine without asking.
34
+ It works on a machine that's already signed in too.
35
+ - If the machine is removed in the dashboard, `connect` deletes the saved token.
36
+ A running `connect` exits and asks you to run it again; a new one signs in
37
+ straight away.
38
+
39
+ A new machine runs only jobs you started (`only-me`). Right after signing in,
40
+ if the workspace has other members, `connect` asks "Who can run jobs on this
41
+ machine?": Only me, or Anyone in the workspace (teammates' and bots' jobs too).
42
+ It doesn't ask in a workspace of one, on later runs, or without a terminal to
43
+ answer. [`relayrunner share`](#relayrunner-share) changes it later.
44
+
45
+ Run inside a checkout of a private repo where no job uses RelayRunner yet,
46
+ `connect` first asks whether to set it up (default no). Yes runs the same picker
47
+ as [`relayrunner init`](#relayrunner-init). No is remembered for that repo in
48
+ `~/.relayrunner/declined-repos.json`, so it doesn't ask again; `init` still
49
+ works there. It never asks outside a repo, in a public repo, in a repo that's
50
+ already set up, or without a terminal to answer.
51
+
52
+ Jobs run in `actions/runner`, which is downloaded into
53
+ `~/.relayrunner/runner/<version>` on first connect and checked against its
54
+ SHA-256. Set `RELAYRUNNER_HOME` to keep everything somewhere else.
55
+
56
+ ## `relayrunner login`
17
57
 
18
58
  ```sh
19
- npm install --global relayrunner
20
- relayrunner --help
59
+ npx relayrunner login
21
60
  ```
22
61
 
23
- RelayRunner requires Node.js 22+, Git, and an authenticated GitHub CLI. Runner
24
- setup supports macOS and Linux on x64 and ARM64.
62
+ Signs this machine in without putting it online: the same browser sign-in as the
63
+ first `connect`, then it saves the token and exits. It's for a coding agent
64
+ setting up RelayRunner (see [docs/agent-install.md](../../docs/agent-install.md)),
65
+ which can't keep `connect` running after its session ends. Run `connect`
66
+ afterwards to take jobs.
25
67
 
26
- ## Set up a repository
68
+ If the machine is already signed in to that gateway, it says so and exits. A
69
+ token that's no longer valid is replaced. `--server`, `--name` and `--share` work as they do
70
+ for `connect`.
27
71
 
28
- If RelayRunner is installed, paste this into your agent from the target checkout:
72
+ ## `relayrunner whoami`
29
73
 
30
- ```text
31
- Use the RelayRunner skill to set up this repository. Show me the eligible jobs, let me choose which ones to opt in, and show me the workflow patch for approval before applying it.
74
+ ```sh
75
+ npx relayrunner whoami
32
76
  ```
33
77
 
34
- From a private GitHub repository checkout, discover eligible jobs and preview
35
- the workflow change for the job you want to opt in:
78
+ Asks the gateway who the saved machine token belongs to and prints the machine,
79
+ its workspace, who enrolled it (name and email) and whether it's online now.
80
+
81
+ - Not signed in: says so and exits 1.
82
+ - Removed from the workspace (or the token is no longer valid): says so and
83
+ exits 1. The saved token is left alone; the next `connect` replaces it.
84
+ - Gateway unreachable: prints what's saved locally, marked unverified, and exits 0.
85
+ - `--json` prints the same as JSON (never the token). `--server <url>` or
86
+ `RELAYRUNNER_URL` only reports a sign-in for that gateway.
87
+
88
+ ## `relayrunner init`
36
89
 
37
90
  ```sh
38
- relayrunner discover
39
- relayrunner preview --job .github/workflows/ci.yml:test
91
+ npx relayrunner init
40
92
  ```
41
93
 
42
- Use the job ID from discovery. Review the patch before approving setup with
43
- the preview's fingerprint. Setup registers a runner that executes jobs under
44
- your local account.
94
+ Run inside a checkout, it routes the repo's GitHub Actions jobs through
95
+ RelayRunner: each chosen job gets a `relay-<job>` job in front of it (the
96
+ reusable workflow in [relayrunner/actions](https://github.com/relayrunner/actions)),
97
+ and its `runs-on` becomes the relay's answer. The job's old label becomes the
98
+ fallback when no machine is free. It only edits `.github/workflows/`, keeps
99
+ comments and formatting, and never commits.
100
+
101
+ It sorts every job into one of three groups:
102
+
103
+ - **Ready**: a plain GitHub-hosted (`ubuntu-*`, `macos-*`) or Blacksmith
104
+ (`blacksmith-*`) label. A `macos-*` job only routes to macOS machines.
105
+ Warnings flag what to check first: services or containers (need Docker),
106
+ Linux package installs on a Mac, Blacksmith-only actions.
107
+ - **Already routed**: the job runs where a relay sends it.
108
+ - **Skipped, with the reason**: a matrix, a `runs-on` expression, list or
109
+ group, a reusable workflow, a deploy job (`environment`, `id-token: write`,
110
+ or secrets other than `GITHUB_TOKEN`), Windows, or an unknown label.
111
+
112
+ A public repo is refused: machines never take public repos' jobs. Visibility is
113
+ checked with an anonymous GitHub API call, so it doesn't matter which account
114
+ `gh` or git is signed in as.
115
+
116
+ - `--plan` lists the jobs and changes nothing; `--plan --json` prints them as JSON.
117
+ - `--apply <jobs>` routes jobs without prompting. Name them by id (`test`),
118
+ `file:id` (`ci.yml:test`) when an id is in several workflows, or `all` for
119
+ every ready job. Add `--json` for a JSON result.
120
+
121
+ ## `relayrunner pause` and `relayrunner resume`
122
+
123
+ ```sh
124
+ npx relayrunner pause
125
+ npx relayrunner resume
126
+ ```
127
+
128
+ Pausing stops new jobs routing to this machine while it stays connected and
129
+ enrolled. A job it's already running finishes. `resume` lets jobs route here
130
+ again. Anyone in the workspace can do the same from the machine's ⋯ menu on the
131
+ Runners page, and a running `relayrunner connect` prints when that happens.
132
+ Both exit 1 when not signed in or when the token is no longer valid.
133
+
134
+ ## `relayrunner share`
135
+
136
+ ```sh
137
+ npx relayrunner share # show the current setting
138
+ npx relayrunner share only-me # run only jobs you started
139
+ npx relayrunner share anyone # run any job in the workspace
140
+ ```
141
+
142
+ Who can run jobs on this machine. `only-me` takes only jobs you started on
143
+ GitHub; `anyone` takes any job in the workspace, including teammates' and bots'.
144
+ It's the same setting as the sharing icon on the machine's card on the Runners
145
+ page, and only the machine's owner can change it there. `relayrunner whoami`
146
+ shows it too. Exits 1 when not signed in or when the token is no longer valid.
147
+
148
+ ## Building
45
149
 
46
- The package includes the RelayRunner skill for Codex, Claude Code, and Cursor.
47
- See the [project README](https://github.com/atticoos/RelayRunner#readme) for
48
- skill installation, repository setup, and switching runners.
150
+ `pnpm --filter relayrunner build` bundles the CLI into `dist/cli.js` with
151
+ tsdown, including the workspace's `@relayrunner/machine-protocol` package.