@runneth/cli 0.0.0-sha.3142666bf4dc.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 ADDED
@@ -0,0 +1,144 @@
1
+ # runneth-cli
2
+
3
+ `runneth-cli` gives local coding agents a fast persistent shell session.
4
+
5
+ ```bash
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
12
+ ```
13
+
14
+ ## npm Usage
15
+
16
+ Run the promoted production package from the npm `latest` channel:
17
+
18
+ ```bash
19
+ npx @runneth/cli ssh
20
+ ```
21
+
22
+ Use the npm `beta` channel to try the production build before it is promoted to
23
+ `latest`:
24
+
25
+ ```bash
26
+ npx @runneth/cli@beta ssh
27
+ ```
28
+
29
+ The first command starts a small local daemon for the current user. Later `send`
30
+ calls reuse the same shell process through a local socket, so `cd`, exported
31
+ environment variables, and other shell state persist between commands.
32
+
33
+ ## Commands
34
+
35
+ ```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
52
+ ```
53
+
54
+ Use `--stdin` for multi-line commands:
55
+
56
+ ```bash
57
+ cat <<'SCRIPT' | runneth-cli send --stdin
58
+ cd ~/project
59
+ pnpm check
60
+ SCRIPT
61
+ ```
62
+
63
+ Runtime files live under `~/.runneth-cli` by default. Set `RUNNETH_CLI_HOME` to
64
+ use a different state directory.
65
+
66
+ ## OAuth
67
+
68
+ `runneth-cli oauth login` performs OAuth protected-resource discovery, dynamic
69
+ client registration as a public MCP-style client, PKCE authorization, and token
70
+ exchange through a local loopback callback.
71
+
72
+ ```bash
73
+ runneth-cli oauth login --resource http://localhost:4100/mcp
74
+ runneth-cli oauth status --resource http://localhost:4100/mcp
75
+ ```
76
+
77
+ OAuth credentials are stored under `~/.runneth-cli/oauth` with user-only file
78
+ permissions on Unix-like systems. Commands that need an access token refresh it
79
+ internally when the server issued a refresh token.
80
+
81
+ ## SSH
82
+
83
+ `runneth-cli ssh` uses the stored OAuth credential for the resource. If no
84
+ credential exists yet, it starts the OAuth login flow first. The first SSH
85
+ connection for a resource/app pair generates an ed25519 keypair, sends the
86
+ public key to the Runneth SSH app, writes an isolated OpenSSH config, and then
87
+ starts `ssh` through the app tunnel.
88
+
89
+ ```bash
90
+ runneth-cli ssh \
91
+ --resource https://projects.motionapp.com/mcp \
92
+ --host 93c7ca56-debe-4b95-8be2-a873afe72234.app.runneth.com
93
+ ```
94
+
95
+ SSH keys, known hosts, and generated config files are stored under
96
+ `~/.runneth-cli/ssh`. The generated OpenSSH config uses an internal
97
+ `ProxyCommand` transport that attaches the OAuth bearer token to the SSH app
98
+ HTTP tunnel.
99
+
100
+ ### SSH stdio
101
+
102
+ Use `ssh stdio` when an agent needs to keep one authenticated SSH connection
103
+ open and run multiple commands or remote processes without reconnecting:
104
+
105
+ ```bash
106
+ runneth-cli ssh stdio --target primary-vm
107
+ ```
108
+
109
+ The command writes JSONL events to stdout and reads JSONL requests from stdin.
110
+ Logs and setup messages are written to stderr.
111
+
112
+ ```jsonl
113
+ {"id":"1","method":"exec","params":{"command":"pwd","timeoutMs":30000}}
114
+ {"id":"2","method":"spawn","params":{"command":"cat"}}
115
+ {"id":"2","method":"stdin","params":{"data":"hello\n"}}
116
+ {"id":"2","method":"close"}
117
+ ```
118
+
119
+ Typical responses:
120
+
121
+ ```jsonl
122
+ {"type":"ready","ok":true,"protocol":"runneth-ssh-stdio","version":1,"hostAlias":"runneth-2735833d956e","targetName":"primary-vm"}
123
+ {"id":"1","type":"stdout","data":"/agent\n"}
124
+ {"id":"1","type":"exit","ok":true,"code":0,"signal":null}
125
+ {"id":"2","type":"started","ok":true,"processId":"2","command":"cat"}
126
+ ```
127
+
128
+ ## Agent Skills
129
+
130
+ Install or update the bundled Runneth skill for Claude Code and Codex:
131
+
132
+ ```bash
133
+ runneth-cli skills install
134
+ ```
135
+
136
+ Install or update only one agent skill:
137
+
138
+ ```bash
139
+ runneth-cli skills install --agent claude
140
+ runneth-cli skills install --agent codex
141
+ ```
142
+
143
+ The command writes the same `runneth` skill to `~/.claude/skills/runneth` and/or
144
+ `~/.codex/skills/runneth`. Re-running the command updates the existing skill.
@@ -0,0 +1 @@
1
+ export declare const resolveBuildDefaultMcpResourceUrl: () => string | undefined;
@@ -0,0 +1,21 @@
1
+ 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 appendMcpPath = (url) => {
4
+ const basePath = url.pathname === "/" ? "" : url.pathname.replace(/\/+$/u, "");
5
+ url.pathname = `${basePath}/mcp`;
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();
21
+ };
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};