@fibteq/altair-runner 0.0.0-stage → 0.2.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/LICENSE +661 -0
- package/README.md +108 -2
- package/dist/cli.js +135 -0
- package/dist/index.js +106 -0
- package/package.json +50 -3
package/README.md
CHANGED
|
@@ -1,3 +1,109 @@
|
|
|
1
|
-
#
|
|
1
|
+
# altair-runner
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Connects your computer to an Altair server, so a project can work in one of your
|
|
4
|
+
local folders with the coding CLI you already use: Claude Code, Codex CLI or
|
|
5
|
+
Gemini CLI.
|
|
6
|
+
|
|
7
|
+
- It opens an **outbound** WebSocket to the server. No port is opened, and it works behind NAT.
|
|
8
|
+
- The server sends a task (a folder, a CLI and a prompt). The runner starts the CLI in that folder, streams its
|
|
9
|
+
progress back and returns its final answer.
|
|
10
|
+
- The CLI runs with **your own login on your computer**. altair-runner never reads, sends or stores your Claude,
|
|
11
|
+
OpenAI or Google credentials. The only secret it keeps is its own Altair runner token, in
|
|
12
|
+
`~/.altair-runner/config.json` (readable by you only).
|
|
13
|
+
- It only works in folders you shared, from Altair > Devices or with `altair-runner share`. A path from the server that is not one of them
|
|
14
|
+
(after resolving symlinks) is refused.
|
|
15
|
+
|
|
16
|
+
## Use
|
|
17
|
+
|
|
18
|
+
Requires Node 22+ and at least one of `claude`, `codex` or `gemini` on your `PATH`, already signed in.
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npx altair-runner pair ABCD-1234 --server https://altair.example.com # code from Altair > Devices
|
|
22
|
+
npx altair-runner service install # runs now and at every login
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then add folders in Altair > Devices with **Add folder**: it browses this computer's folders through the runner
|
|
26
|
+
(folder names only, never files) and shares the one you pick. The home folder itself and the disk root cannot be
|
|
27
|
+
shared. From a terminal, `altair-runner share [folder]` and `altair-runner unshare <folder>` do the same.
|
|
28
|
+
|
|
29
|
+
Other commands: `altair-runner status`, `altair-runner logout`, and `altair-runner start` to run it in a terminal
|
|
30
|
+
instead of in the background (Ctrl+C stops it).
|
|
31
|
+
|
|
32
|
+
### In the background
|
|
33
|
+
|
|
34
|
+
`altair-runner service install` copies the runner to `~/.altair-runner/bin` (so it keeps working after npx clears its
|
|
35
|
+
cache) and registers it to start at login:
|
|
36
|
+
|
|
37
|
+
| OS | How | Logs |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| macOS | launchd agent `~/Library/LaunchAgents/io.fibteq.altair-runner.plist` | `~/.altair-runner/runner.log` |
|
|
40
|
+
| Linux | systemd user service `altair-runner.service` | `journalctl --user -u altair-runner` |
|
|
41
|
+
| Windows | `altair-runner.vbs` in the Startup folder | `~/.altair-runner/runner.log` |
|
|
42
|
+
|
|
43
|
+
It keeps the `PATH` of the terminal you install it from, which is where it finds `claude`, `codex` and `gemini`.
|
|
44
|
+
On macOS and Linux it restarts after a crash, but not after a clean stop (the computer was removed in Altair, or
|
|
45
|
+
`altair-runner start` was run somewhere else with the same pairing). Run `service install` again after updating
|
|
46
|
+
(`npx altair-runner@latest service install`) or to restart it; `service status` shows its state and
|
|
47
|
+
`service uninstall` removes it. On Linux it starts when you log in; to start at boot without logging in, run
|
|
48
|
+
`loginctl enable-linger`.
|
|
49
|
+
|
|
50
|
+
### What the CLI may do
|
|
51
|
+
|
|
52
|
+
`altair-runner start --access <level>` or `altair-runner service install --access <level>` (saved for next time):
|
|
53
|
+
|
|
54
|
+
| level | Claude Code | Codex | Gemini CLI |
|
|
55
|
+
|---|---|---|---|
|
|
56
|
+
| `read` | `--permission-mode plan` | `--sandbox read-only` | `--approval-mode default` |
|
|
57
|
+
| `edit` (default) | `--permission-mode acceptEdits` | `--sandbox workspace-write` | `--approval-mode auto_edit` |
|
|
58
|
+
| `full` | `--permission-mode bypassPermissions` | `--sandbox danger-full-access` | `--approval-mode yolo` |
|
|
59
|
+
|
|
60
|
+
With `edit`, the CLI can change files in the folder but cannot run commands that would need your approval. Use
|
|
61
|
+
`full` only for folders and projects you trust: it lets the CLI run any command without asking.
|
|
62
|
+
|
|
63
|
+
Tasks in the same Altair thread continue the same Claude Code session (`--resume`), so follow-ups keep context.
|
|
64
|
+
|
|
65
|
+
### For apps that run it (the desktop app)
|
|
66
|
+
|
|
67
|
+
- `ALTAIR_SERVER` and `ALTAIR_RUNNER_TOKEN` override the saved pairing, and an env token is never written to disk.
|
|
68
|
+
An app that already has the user's session can pair without a code: `POST /api/runners/pairing` (as the user)
|
|
69
|
+
returns a code, and `POST /api/runner/pair` trades it for the runner token.
|
|
70
|
+
- `ALTAIR_RUNNER_HOME` moves the config folder.
|
|
71
|
+
- `altair-runner start --json` prints one status object per line (`connecting`, `online`, `offline`, `task`,
|
|
72
|
+
`stopped`); `altair-runner status --json` prints the config without the token.
|
|
73
|
+
- The build is a single JavaScript file with no native dependencies (`dist/cli.js`), so it can be packed into one
|
|
74
|
+
binary with Node SEA or `bun build --compile`.
|
|
75
|
+
|
|
76
|
+
## Packages
|
|
77
|
+
|
|
78
|
+
The CLI is published as [`@fibteq/altair-runner`](https://www.npmjs.com/package/@fibteq/altair-runner).
|
|
79
|
+
[`altair-runner`](https://www.npmjs.com/package/altair-runner) (in `packages/altair-runner-alias`) is a short name that
|
|
80
|
+
depends on it, so `npx altair-runner` works. `npx @fibteq/altair-runner` runs the same CLI.
|
|
81
|
+
|
|
82
|
+
`startRunner()` and `pair()` are exported too, for the desktop app to bundle the runner instead of shelling out to it.
|
|
83
|
+
|
|
84
|
+
## From this repository
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
pnpm install
|
|
88
|
+
pnpm --filter @fibteq/altair-runner build
|
|
89
|
+
node packages/altair-runner/dist/cli.js --help
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Releasing
|
|
93
|
+
|
|
94
|
+
Needs an npm account that is a member of the `fibteq` npm organization.
|
|
95
|
+
|
|
96
|
+
1. Bump `version` in `package.json` here and in `packages/altair-runner-alias/package.json`, and `RUNNER_VERSION`
|
|
97
|
+
in `src/runner.ts` (a test checks they match). Bump `RUNNER_PROTOCOL_VERSION` in `@altair/protocol` only when the
|
|
98
|
+
wire format changes; the server refuses runners on another protocol version and tells them to update.
|
|
99
|
+
2. Publish the runner first, then the short name, with `pnpm` (it replaces `workspace:` versions and uses the
|
|
100
|
+
built files from `publishConfig`):
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
npm login
|
|
104
|
+
pnpm --filter @fibteq/altair-runner publish --access public
|
|
105
|
+
pnpm --filter altair-runner publish --access public
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`prepublishOnly` builds and tests the runner before it is published. Check the contents first with
|
|
109
|
+
`pnpm --filter @fibteq/altair-runner pack` if in doubt.
|