@runneth/cli 0.0.0-sha.372b2c9d0e4f.production → 0.0.0-sha.786bc749f54f.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 CHANGED
@@ -4,11 +4,12 @@
4
4
 
5
5
  ```bash
6
6
  npx @runneth/cli open
7
- npx @runneth/cli send 'cd ~/project && pnpm test'
8
- npx @runneth/cli send 'git status --short'
9
- npx @runneth/cli oauth login
10
- npx @runneth/cli ssh
11
- npx @runneth/cli close
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 ssh
12
+ runneth close
12
13
  ```
13
14
 
14
15
  ## npm Usage
@@ -33,28 +34,29 @@ environment variables, and other shell state persist between commands.
33
34
  ## Commands
34
35
 
35
36
  ```bash
36
- runneth-cli open [--name default] [--cwd <path>] [--shell <path>]
37
- runneth-cli send [--name default] [--timeout-ms 600000] [--stdin] -- <command...>
38
- runneth-cli status [--name default]
39
- runneth-cli list
40
- runneth-cli close [--name default]
41
- runneth-cli oauth login [--resource <url>] [--client-name "Runneth MCP"] [--scope <scope>] [--no-open]
42
- runneth-cli oauth status [--resource <url>]
43
- runneth-cli oauth logout [--resource <url>]
44
- runneth-cli ssh target add <name> (--host <host> | --ssh-url <url>) [--resource <url>] [--default]
45
- runneth-cli ssh target import <file>
46
- runneth-cli ssh target list
47
- runneth-cli ssh target use <name>
48
- runneth-cli ssh [--target <name>] [--unique-key | --identity-file <path>] [-- remote-command]
49
- runneth-cli ssh stdio [--target <name>] [--unique-key | --identity-file <path>]
50
- runneth-cli skills install [--agent claude|codex|all]
51
- runneth-cli shutdown
37
+ runneth open [--name default] [--cwd <path>] [--shell <path>]
38
+ runneth send [--name default] [--timeout-ms 600000] [--stdin] -- <command...>
39
+ runneth status [--name default]
40
+ runneth list
41
+ runneth close [--name default]
42
+ runneth oauth login [--resource <url>] [--client-name "Runneth MCP"] [--scope <scope>] [--no-open]
43
+ runneth oauth status [--resource <url>]
44
+ runneth oauth logout [--resource <url>]
45
+ runneth chat --workspace <workspace-id> [--api <builder-url>] [--resource <url>] [--auth mondrian|builder] [--conversation <id>]
46
+ runneth ssh target add <name> (--host <host> | --ssh-url <url>) [--resource <url>] [--default]
47
+ runneth ssh target import <file>
48
+ runneth ssh target list
49
+ runneth ssh target use <name>
50
+ runneth ssh [--target <name>] [--unique-key | --identity-file <path>] [-- remote-command]
51
+ runneth ssh stdio [--target <name>] [--unique-key | --identity-file <path>]
52
+ runneth skills install [--agent claude|codex|all]
53
+ runneth shutdown
52
54
  ```
53
55
 
54
56
  Use `--stdin` for multi-line commands:
55
57
 
56
58
  ```bash
57
- cat <<'SCRIPT' | runneth-cli send --stdin
59
+ cat <<'SCRIPT' | runneth send --stdin
58
60
  cd ~/project
59
61
  pnpm check
60
62
  SCRIPT
@@ -70,14 +72,33 @@ client registration as a public MCP-style client, PKCE authorization, and token
70
72
  exchange through a local loopback callback.
71
73
 
72
74
  ```bash
73
- runneth-cli oauth login --resource http://localhost:4100/mcp
74
- runneth-cli oauth status --resource http://localhost:4100/mcp
75
+ runneth oauth login --resource http://localhost:4100/mcp
76
+ runneth oauth status --resource http://localhost:4100/mcp
75
77
  ```
76
78
 
77
79
  OAuth credentials are stored under `~/.runneth-cli/oauth` with user-only file
78
80
  permissions on Unix-like systems. Commands that need an access token refresh it
79
81
  internally when the server issued a refresh token.
80
82
 
83
+ ## Chat
84
+
85
+ `runneth-cli chat` starts an interactive terminal conversation against Builder's
86
+ canonical Runneth conversation API. Official environment builds carry the
87
+ correct Builder URL in the package; use `--api` only for local or custom Builder
88
+ deployments.
89
+
90
+ ```bash
91
+ runneth chat --workspace "$MONDRIAN_WORKSPACE_ID"
92
+ ```
93
+
94
+ If no stored OAuth credential exists, chat starts the same browser-based OAuth
95
+ flow as SSH and stores the credential under `~/.runneth-cli/oauth`. Use
96
+ `--token`, `RUNNETH_TOKEN`, `MONDRIAN_TOKEN`, or `BUILDER_AGENT_CHAT_TOKEN` only
97
+ for automation and local API mocks that should bypass OAuth.
98
+
99
+ Inside the terminal UI, use `/state` to redraw the current conversation and
100
+ `/exit` to quit.
101
+
81
102
  ## SSH
82
103
 
83
104
  `runneth-cli ssh` uses the stored OAuth credential for the resource. If no
@@ -87,7 +108,7 @@ public key to the Runneth SSH app, writes an isolated OpenSSH config, and then
87
108
  starts `ssh` through the app tunnel.
88
109
 
89
110
  ```bash
90
- runneth-cli ssh \
111
+ runneth ssh \
91
112
  --resource https://projects.motionapp.com/mcp \
92
113
  --host 93c7ca56-debe-4b95-8be2-a873afe72234.app.runneth.com
93
114
  ```
@@ -103,7 +124,7 @@ Use `ssh stdio` when an agent needs to keep one authenticated SSH connection
103
124
  open and run multiple commands or remote processes without reconnecting:
104
125
 
105
126
  ```bash
106
- runneth-cli ssh stdio --target primary-vm
127
+ runneth ssh stdio --target primary-vm
107
128
  ```
108
129
 
109
130
  The command writes JSONL events to stdout and reads JSONL requests from stdin.
@@ -1 +1,6 @@
1
- export declare const resolveBuildDefaultMcpResourceUrl: () => string | undefined;
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 };
@@ -1,21 +1,36 @@
1
+ //#region src/build-defaults.ts
1
2
  const BUILD_DEFAULT_MONDRIAN_API_URL = "https://projects.motionapp.com/";
2
- const BUILD_DEFAULT_MONDRIAN_API_URL_PLACEHOLDER = "__RUNNETH_CLI_DEFAULT_MONDRIAN_API_URL__";
3
+ const BUILD_DEFAULT_RUNNETH_API_URL = "https://build-be.runneth.com/";
3
4
  const appendMcpPath = (url) => {
4
- const basePath = url.pathname === "/" ? "" : url.pathname.replace(/\/+$/u, "");
5
- url.pathname = `${basePath}/mcp`;
5
+ url.pathname = `${url.pathname === "/" ? "" : url.pathname.replace(/\/+$/u, "")}/mcp`;
6
6
  };
7
- export const resolveBuildDefaultMcpResourceUrl = () => {
8
- const rawApiUrl = BUILD_DEFAULT_MONDRIAN_API_URL.trim();
9
- if (rawApiUrl.length === 0 ||
10
- rawApiUrl === BUILD_DEFAULT_MONDRIAN_API_URL_PLACEHOLDER) {
11
- return undefined;
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
- #!/usr/bin/env node
2
- export {};
1
+ export { };