@termhub/agent 0.1.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.
Files changed (3) hide show
  1. package/README.md +53 -0
  2. package/dist/cli.js +1489 -0
  3. package/package.json +48 -0
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # @termhub/agent
2
+
3
+ A small CLI that runs on your own machine (macOS or Linux) and connects it to a termhub server,
4
+ so its terminals are reachable from the termhub web app over a single outbound WebSocket. It
5
+ attaches PTY sessions to `tmux`, so a terminal survives the agent restarting or your laptop
6
+ sleeping.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm i -g @termhub/agent
12
+ ```
13
+
14
+ Requires Node 20+ and `tmux` on the machine you're pairing.
15
+
16
+ ## Connect
17
+
18
+ ```bash
19
+ termhub-agent connect --url https://app.termhub.dev
20
+ ```
21
+
22
+ You'll be prompted to paste an agent token generated from the termhub web app (Machines → Add
23
+ machine). `--token <token>` and the `TERMHUB_URL`/`TERMHUB_TOKEN` environment variables work too,
24
+ for non-interactive setups. On success the agent keeps running in the foreground until Ctrl-C.
25
+
26
+ ## Run as a background service
27
+
28
+ ```bash
29
+ termhub-agent service install
30
+ ```
31
+
32
+ Installs a per-user service (a `launchd` agent on macOS, a `systemd --user` unit on Linux) that
33
+ starts the agent at login/boot and restarts it on failure. `termhub-agent service status` and
34
+ `termhub-agent service uninstall` manage it afterwards. On Linux, run
35
+ `loginctl enable-linger $USER` once so the service keeps running after you log out.
36
+
37
+ ## Other commands
38
+
39
+ - `termhub-agent status` — shows the paired server, machine name and whether the agent can reach
40
+ it right now.
41
+ - `termhub-agent disconnect` — removes the local config (`~/.termhub/config.json`); revoke the
42
+ token from the termhub web app too.
43
+ - `termhub-agent doctor` — checks the local config, server reachability, `tmux`, `node-pty` and
44
+ filesystem access to `$HOME`/`Documents`/`Desktop` (and every volume under `/Volumes` on
45
+ macOS).
46
+
47
+ ## macOS: Full Disk Access
48
+
49
+ macOS's TCC (Transparency, Consent and Control) can block the agent from listing folders such as
50
+ `~/Documents`, `~/Desktop` or an external volume, even though the agent process itself has no
51
+ special privileges. If `doctor` or `service install` reports this, grant the agent's Node binary
52
+ Full Disk Access: **Ajustes → Privacidade e Segurança → Acesso Total ao Disco**, then add the
53
+ `node` binary path `doctor` printed.