@runneth/cli 0.0.0-sha.9ccaa5c17826.production → 0.0.0-sha.cf0e2f4e39c3.production
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 +98 -26
- package/dist/build-defaults.d.ts +6 -1
- package/dist/build-defaults.js +32 -17
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +1453 -1032
- package/dist/index.d.ts +8387 -90
- package/dist/index.js +2 -547
- package/dist/src.js +11290 -0
- package/package.json +6 -2
- package/dist/copy.d.ts +0 -25
- package/dist/copy.js +0 -492
- package/dist/oauth.d.ts +0 -80
- package/dist/oauth.js +0 -592
- package/dist/paths.d.ts +0 -2
- package/dist/paths.js +0 -25
- package/dist/skills.d.ts +0 -15
- package/dist/skills.js +0 -89
- package/dist/ssh-stdio.d.ts +0 -63
- package/dist/ssh-stdio.js +0 -608
- package/dist/ssh.d.ts +0 -129
- package/dist/ssh.js +0 -835
package/README.md
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npx @runneth/cli open
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
runneth send 'cd ~/project && pnpm test'
|
|
8
|
+
runneth send 'git status --short'
|
|
9
|
+
runneth oauth login
|
|
10
|
+
runneth chat --workspace <workspace-id>
|
|
11
|
+
runneth conversation create --workspace <workspace-id> --json
|
|
12
|
+
runneth ssh
|
|
13
|
+
runneth close
|
|
12
14
|
```
|
|
13
15
|
|
|
14
16
|
## npm Usage
|
|
@@ -33,28 +35,33 @@ environment variables, and other shell state persist between commands.
|
|
|
33
35
|
## Commands
|
|
34
36
|
|
|
35
37
|
```bash
|
|
36
|
-
runneth
|
|
37
|
-
runneth
|
|
38
|
-
runneth
|
|
39
|
-
runneth
|
|
40
|
-
runneth
|
|
41
|
-
runneth
|
|
42
|
-
runneth
|
|
43
|
-
runneth
|
|
44
|
-
runneth
|
|
45
|
-
runneth
|
|
46
|
-
runneth-
|
|
47
|
-
runneth
|
|
48
|
-
runneth
|
|
49
|
-
runneth
|
|
50
|
-
runneth
|
|
51
|
-
runneth
|
|
38
|
+
runneth open [--name default] [--cwd <path>] [--shell <path>]
|
|
39
|
+
runneth send [--name default] [--timeout-ms 600000] [--stdin] -- <command...>
|
|
40
|
+
runneth status [--name default]
|
|
41
|
+
runneth list
|
|
42
|
+
runneth close [--name default]
|
|
43
|
+
runneth oauth login [--resource <url>] [--client-name "Runneth MCP"] [--scope <scope>] [--no-open]
|
|
44
|
+
runneth oauth status [--resource <url>]
|
|
45
|
+
runneth oauth logout [--resource <url>]
|
|
46
|
+
runneth chat --workspace <workspace-id> [--api <builder-url>] [--resource <url>] [--auth mondrian|builder] [--conversation <id>]
|
|
47
|
+
runneth conversation create --workspace <workspace-id> --json [--title <title>]
|
|
48
|
+
runneth conversation send --workspace <workspace-id> --conversation <id> --json (--message <text> | --stdin)
|
|
49
|
+
runneth conversation state --workspace <workspace-id> --conversation <id> --json
|
|
50
|
+
runneth conversation session --workspace <workspace-id> --jsonl
|
|
51
|
+
runneth ssh target add <name> (--host <host> | --ssh-url <url>) [--resource <url>] [--default]
|
|
52
|
+
runneth ssh target import <file>
|
|
53
|
+
runneth ssh target list
|
|
54
|
+
runneth ssh target use <name>
|
|
55
|
+
runneth ssh [--target <name>] [--unique-key | --identity-file <path>] [-- remote-command]
|
|
56
|
+
runneth ssh stdio [--target <name>] [--unique-key | --identity-file <path>]
|
|
57
|
+
runneth skills install [--agent claude|codex|all]
|
|
58
|
+
runneth shutdown
|
|
52
59
|
```
|
|
53
60
|
|
|
54
61
|
Use `--stdin` for multi-line commands:
|
|
55
62
|
|
|
56
63
|
```bash
|
|
57
|
-
cat <<'SCRIPT' | runneth
|
|
64
|
+
cat <<'SCRIPT' | runneth send --stdin
|
|
58
65
|
cd ~/project
|
|
59
66
|
pnpm check
|
|
60
67
|
SCRIPT
|
|
@@ -70,14 +77,79 @@ client registration as a public MCP-style client, PKCE authorization, and token
|
|
|
70
77
|
exchange through a local loopback callback.
|
|
71
78
|
|
|
72
79
|
```bash
|
|
73
|
-
runneth
|
|
74
|
-
runneth
|
|
80
|
+
runneth oauth login --resource http://localhost:4100/mcp
|
|
81
|
+
runneth oauth status --resource http://localhost:4100/mcp
|
|
75
82
|
```
|
|
76
83
|
|
|
77
84
|
OAuth credentials are stored under `~/.runneth-cli/oauth` with user-only file
|
|
78
85
|
permissions on Unix-like systems. Commands that need an access token refresh it
|
|
79
86
|
internally when the server issued a refresh token.
|
|
80
87
|
|
|
88
|
+
## Chat
|
|
89
|
+
|
|
90
|
+
`runneth-cli chat` starts an interactive terminal conversation against Builder's
|
|
91
|
+
canonical Runneth conversation API. Official environment builds carry the
|
|
92
|
+
correct Builder URL in the package; use `--api` only for local or custom Builder
|
|
93
|
+
deployments.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
runneth chat --workspace "$MONDRIAN_WORKSPACE_ID"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
If no stored OAuth credential exists, chat starts the same browser-based OAuth
|
|
100
|
+
flow as SSH and stores the credential under `~/.runneth-cli/oauth`. Use
|
|
101
|
+
`--token`, `RUNNETH_TOKEN`, `MONDRIAN_TOKEN`, or `BUILDER_AGENT_CHAT_TOKEN` only
|
|
102
|
+
for automation and local API mocks that should bypass OAuth.
|
|
103
|
+
|
|
104
|
+
Inside the terminal UI, use `/state` to redraw the current conversation and
|
|
105
|
+
`/exit` to quit.
|
|
106
|
+
|
|
107
|
+
## Conversation Commands
|
|
108
|
+
|
|
109
|
+
`runneth-cli conversation` is the machine-oriented conversation interface for
|
|
110
|
+
agents and scripts. It uses the same auth, workspace scoping, and conversation
|
|
111
|
+
API as `runneth chat`, but avoids terminal banners and ANSI UI output.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
runneth conversation create --workspace "$MONDRIAN_WORKSPACE_ID" --title "SSH routine setup" --json
|
|
115
|
+
runneth conversation send --workspace "$MONDRIAN_WORKSPACE_ID" --conversation "$CONVERSATION_ID" --message "Create a routine" --json
|
|
116
|
+
runneth conversation state --workspace "$MONDRIAN_WORKSPACE_ID" --conversation "$CONVERSATION_ID" --json
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`send` waits for the assistant response by default. `send` and `state` require an
|
|
120
|
+
explicit `--conversation`; the CLI does not track an implicit active
|
|
121
|
+
conversation for machine commands.
|
|
122
|
+
|
|
123
|
+
Long-lived agents can keep one authenticated process open with JSONL over
|
|
124
|
+
stdin/stdout:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
runneth conversation session --workspace "$MONDRIAN_WORKSPACE_ID" --jsonl
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The session `ready` frame reports the resolved client target context, not a
|
|
131
|
+
separate active conversation identity. Authoritative user and conversation
|
|
132
|
+
identity comes from the `conversation` object returned by `create` and `state`.
|
|
133
|
+
|
|
134
|
+
Typical requests:
|
|
135
|
+
|
|
136
|
+
```jsonl
|
|
137
|
+
{"id":"1","method":"create","params":{"title":"SSH routine setup"}}
|
|
138
|
+
{"id":"2","method":"send","params":{"conversationId":"11111111-1111-4111-8111-111111111111","text":"Create a routine"}}
|
|
139
|
+
{"id":"3","method":"state","params":{"conversationId":"11111111-1111-4111-8111-111111111111"}}
|
|
140
|
+
{"id":"4","method":"close"}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Typical responses:
|
|
144
|
+
|
|
145
|
+
```jsonl
|
|
146
|
+
{"type":"ready","ok":true,"protocol":"runneth-conversation-stdio","version":1,"authMode":"mondrian","workspaceId":"65cbcb84095884aaf08dc76a"}
|
|
147
|
+
{"id":"1","type":"created","ok":true,"conversation":{"id":"11111111-1111-4111-8111-111111111111"}}
|
|
148
|
+
{"id":"2","type":"sent","ok":true,"send":{"assistantMessageId":"55555555-5555-4555-8555-555555555555"}}
|
|
149
|
+
{"id":"2","type":"state","ok":true,"state":{"conversation":{"id":"11111111-1111-4111-8111-111111111111"}}}
|
|
150
|
+
{"id":"2","type":"complete","ok":true,"assistantMessage":{"id":"55555555-5555-4555-8555-555555555555","status":"completed"}}
|
|
151
|
+
```
|
|
152
|
+
|
|
81
153
|
## SSH
|
|
82
154
|
|
|
83
155
|
`runneth-cli ssh` uses the stored OAuth credential for the resource. If no
|
|
@@ -87,7 +159,7 @@ public key to the Runneth SSH app, writes an isolated OpenSSH config, and then
|
|
|
87
159
|
starts `ssh` through the app tunnel.
|
|
88
160
|
|
|
89
161
|
```bash
|
|
90
|
-
runneth
|
|
162
|
+
runneth ssh \
|
|
91
163
|
--resource https://projects.motionapp.com/mcp \
|
|
92
164
|
--host 93c7ca56-debe-4b95-8be2-a873afe72234.app.runneth.com
|
|
93
165
|
```
|
|
@@ -103,7 +175,7 @@ Use `ssh stdio` when an agent needs to keep one authenticated SSH connection
|
|
|
103
175
|
open and run multiple commands or remote processes without reconnecting:
|
|
104
176
|
|
|
105
177
|
```bash
|
|
106
|
-
runneth
|
|
178
|
+
runneth ssh stdio --target primary-vm
|
|
107
179
|
```
|
|
108
180
|
|
|
109
181
|
The command writes JSONL events to stdout and reads JSONL requests from stdin.
|
package/dist/build-defaults.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/build-defaults.d.ts
|
|
2
|
+
declare const resolveBuildDefaultMcpResourceUrl: () => string | undefined;
|
|
3
|
+
declare const resolveBuildDefaultMondrianApiUrl: () => string | undefined;
|
|
4
|
+
declare const resolveBuildDefaultRunnethApiUrl: () => string | undefined;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { resolveBuildDefaultMcpResourceUrl, resolveBuildDefaultMondrianApiUrl, resolveBuildDefaultRunnethApiUrl };
|
package/dist/build-defaults.js
CHANGED
|
@@ -1,21 +1,36 @@
|
|
|
1
|
+
//#region src/build-defaults.ts
|
|
1
2
|
const BUILD_DEFAULT_MONDRIAN_API_URL = "https://projects.motionapp.com/";
|
|
2
|
-
const
|
|
3
|
+
const BUILD_DEFAULT_RUNNETH_API_URL = "https://build-be.runneth.com/";
|
|
3
4
|
const appendMcpPath = (url) => {
|
|
4
|
-
|
|
5
|
-
url.pathname = `${basePath}/mcp`;
|
|
5
|
+
url.pathname = `${url.pathname === "/" ? "" : url.pathname.replace(/\/+$/u, "")}/mcp`;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const url = new URL(rawApiUrl);
|
|
14
|
-
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
15
|
-
throw new Error("Build default MONDRIAN_API_URL must use http or https");
|
|
16
|
-
}
|
|
17
|
-
url.hash = "";
|
|
18
|
-
url.search = "";
|
|
19
|
-
appendMcpPath(url);
|
|
20
|
-
return url.toString();
|
|
7
|
+
const resolveBuildDefaultMcpResourceUrl = () => {
|
|
8
|
+
const apiUrl = resolveBuildDefaultMondrianApiUrl();
|
|
9
|
+
if (apiUrl === void 0) return;
|
|
10
|
+
const url = new URL(apiUrl);
|
|
11
|
+
appendMcpPath(url);
|
|
12
|
+
return url.toString();
|
|
21
13
|
};
|
|
14
|
+
const normalizeBuildDefaultUrl = (input) => {
|
|
15
|
+
const rawApiUrl = input.value.trim();
|
|
16
|
+
if (rawApiUrl.length === 0 || rawApiUrl.startsWith("__RUNNETH_CLI_DEFAULT_") && rawApiUrl.endsWith("_API_URL__")) return;
|
|
17
|
+
const url = new URL(rawApiUrl);
|
|
18
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") throw new Error(`Build default ${input.envName} must use http or https`);
|
|
19
|
+
url.hash = "";
|
|
20
|
+
url.search = "";
|
|
21
|
+
return url.toString().replace(/\/+$/u, "");
|
|
22
|
+
};
|
|
23
|
+
const resolveBuildDefaultMondrianApiUrl = () => {
|
|
24
|
+
return normalizeBuildDefaultUrl({
|
|
25
|
+
envName: "MONDRIAN_API_URL",
|
|
26
|
+
value: BUILD_DEFAULT_MONDRIAN_API_URL
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const resolveBuildDefaultRunnethApiUrl = () => {
|
|
30
|
+
return normalizeBuildDefaultUrl({
|
|
31
|
+
envName: "BACKEND_URL",
|
|
32
|
+
value: BUILD_DEFAULT_RUNNETH_API_URL
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { resolveBuildDefaultMcpResourceUrl, resolveBuildDefaultMondrianApiUrl, resolveBuildDefaultRunnethApiUrl };
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {};
|
|
1
|
+
export { };
|