opencode-remote-login 0.1.1 → 0.1.2

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 (2) hide show
  1. package/README.md +37 -45
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # opencode-remote-login
2
2
 
3
- Dispatch opencode sessions to remote hosts via SSH and continue tasks there.
3
+ Dispatch opencode sessions to remote hosts via SSH. Migrate context, execute tasks remotely, and optionally pull results back.
4
4
 
5
5
  ## Install
6
6
 
@@ -8,17 +8,13 @@ Dispatch opencode sessions to remote hosts via SSH and continue tasks there.
8
8
  opencode plug opencode-remote-login
9
9
  ```
10
10
 
11
- Or add to `opencode.jsonc` manually:
11
+ This adds the plugin to your `opencode.jsonc`. The `remote_login` tool becomes available immediately.
12
12
 
13
- ```json
14
- {
15
- "plugin": ["opencode-remote-login"]
16
- }
17
- ```
13
+ ## Configure hosts
18
14
 
19
- ## Setup
15
+ Hosts are defined via a `hosts` entry in one of these locations (checked in order):
20
16
 
21
- 1. Create `~/.config/opencode/hosts.json`:
17
+ **Option 1 `~/.config/opencode/hosts.json`**
22
18
 
23
19
  ```json
24
20
  {
@@ -27,22 +23,14 @@ Or add to `opencode.jsonc` manually:
27
23
  "host": "wenjun@192.168.100.100",
28
24
  "agent": "build",
29
25
  "model": "opencode/big-pickle"
30
- },
31
- "dev": "user@10.0.0.5"
26
+ }
32
27
  }
33
28
  }
34
29
  ```
35
30
 
36
- 2. Configure SSH key-based auth:
37
-
38
- ```bash
39
- ssh-copy-id user@192.168.1.100
40
- ```
41
-
42
- ### Alternative: inline config
31
+ **Option 2 Inline in `opencode.jsonc`**
43
32
 
44
33
  ```jsonc
45
- // opencode.jsonc
46
34
  {
47
35
  "plugin": [
48
36
  ["opencode-remote-login", {
@@ -54,53 +42,57 @@ ssh-copy-id user@192.168.1.100
54
42
  }
55
43
  ```
56
44
 
57
- ## Host config
45
+ ### Host fields
46
+
47
+ | Field | Required | Description |
48
+ | ------- | -------- | -------------------------------------- |
49
+ | `host` | Yes | SSH address (`user@host`) |
50
+ | `agent` | No | Override agent on the remote |
51
+ | `model` | No | Override model in `provider/id` format |
58
52
 
59
- Each host entry supports:
53
+ Only host **names** are shown to the LLM; SSH addresses stay on disk.
60
54
 
61
- | Field | Description |
62
- | ------- | ---------------------------------------- |
63
- | `host` | SSH address (`user@host`) |
64
- | `agent` | Agent name to use on the remote (optional) |
65
- | `model` | Model in `provider/id` format (optional) |
55
+ ### SSH setup
66
56
 
67
- Only host **names** are exposed to the LLM. SSH addresses and credentials stay private.
57
+ ```bash
58
+ ssh-copy-id user@192.168.100.100
59
+ ```
68
60
 
69
61
  ## Usage
70
62
 
71
- ### One-way mode (default)
63
+ ### One-way
72
64
 
73
- Dispatch and return immediately. The remote host takes over autonomously.
65
+ Hand off the session and return. The remote host picks up the task autonomously.
74
66
 
75
67
  ```
76
- > call remote_login host=pi, fix the login bug in auth.ts
68
+ > call remote_login host=pi, fix the auth bug
77
69
  ```
78
70
 
79
- ### Round-trip mode
71
+ ### Round-trip
80
72
 
81
- Dispatch, wait for remote to complete, then pull the updated session back locally. The original agent and model are automatically restored on return.
73
+ Wait for the remote to finish, then pull results back. The original agent and model are restored automatically on return.
82
74
 
83
75
  ```
84
- > call remote_login mode=round-trip host=pi, investigate the memory leak in worker.ts
76
+ > call remote_login mode=round-trip host=pi, find the memory leak
85
77
  ```
86
78
 
87
- ### With working directory
79
+ ### Target directory
88
80
 
89
81
  ```
90
- > call remote_login host=pi directory=/home/wenjun/projects/myapp
82
+ > call remote_login host=pi directory=/home/wenjun/projects/app
91
83
  ```
92
84
 
85
+ Omit to default to `~`.
86
+
93
87
  ## How it works
94
88
 
95
89
  ```
96
- local opencode remote opencode
97
- ───────────── ───────────────
98
- 1. export session (JSON)
99
- 2. patch agent/model from host config
100
- 3. SCP remote import
101
- 4. Trigger remote task (nohup)
102
- 5. [round-trip] poll for back-file
103
- 6. [round-trip] SCP ← remote export
104
- 7. [round-trip] restore original agent/model
105
- 8. [round-trip] local import
90
+ local remote
91
+ ───── ──────
92
+ export session JSON
93
+ patch agent/model per host config ────→ SCP + import session
94
+ nohup opencode run --session=<id>
95
+ [round-trip] poll for completion ←── export session JSON
96
+ [round-trip] restore agent/model
97
+ [round-trip] import back
106
98
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-remote-login",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./server": "./src/index.ts"