mcp-ssh-manager 4.1.0 → 4.2.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.
- package/CHANGELOG.md +138 -0
- package/CLAUDE.md +3 -5
- package/Formula/ssh-manager.rb +2 -2
- package/INSTALLATION.md +4 -0
- package/README.md +22 -4
- package/cli/codex.js +67 -0
- package/cli/guard.js +69 -0
- package/cli/lib/config.sh +102 -37
- package/cli/ssh-manager +13 -0
- package/cli/ssh-manager.js +1 -1
- package/desktop/electron/electron-builder.yml +3 -0
- package/desktop/electron/locale.mjs +34 -0
- package/desktop/electron/main.js +52 -65
- package/desktop/electron/native-menu.mjs +44 -0
- package/desktop/electron/native.zh-CN.json +58 -0
- package/desktop/electron/package-lock.json +2 -2
- package/desktop/electron/package.json +1 -1
- package/desktop/electron/smoke-test.mjs +11 -1
- package/dist/ui/app.css +1 -1
- package/dist/ui/app.js +123 -115
- package/docs/MIGRATION.md +1 -1
- package/docs/SECURITY_MODES.md +15 -8
- package/docs/SEO.md +1 -1
- package/package.json +15 -3
- package/scripts/test-upgrade-from-published.mjs +24 -2
- package/server.json +2 -2
- package/src/audit.js +6 -15
- package/src/background-job.js +44 -0
- package/src/backup-manager.js +24 -29
- package/src/config-loader.js +5 -1
- package/src/database-manager.js +13 -31
- package/src/dump-guard.js +79 -0
- package/src/health-monitor.js +8 -4
- package/src/index.js +183 -21
- package/src/logger.js +3 -1
- package/src/quiet-stderr.js +15 -0
- package/src/ssh-guard.js +344 -0
- package/src/ssh-manager.js +51 -0
- package/src/tunnel-manager.js +14 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,144 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.2.0] - 2026-11-13
|
|
11
|
+
|
|
12
|
+
**A Chinese interface, a fuller audit log, and a guard against raw ssh.** Nothing
|
|
13
|
+
to change on upgrade: the guard and the background mode are off unless you use
|
|
14
|
+
them, and the audit log only gains lines when `AUDIT_LOG` is already on (the
|
|
15
|
+
release pipeline upgrades 3.8.5, 3.8.6, 3.8.7 and every 4.0.x and 4.1.x from the
|
|
16
|
+
registry to this version and back). Two things do behave differently without
|
|
17
|
+
being asked: a tool that fails now sets `isError` in its reply, and the interface
|
|
18
|
+
follows a Chinese system language until you choose one.
|
|
19
|
+
|
|
20
|
+
The Windows installer is still **not Authenticode-signed**, for the same reason
|
|
21
|
+
as 4.0.0: Windows shows *"Windows protected your PC"*, *More info → Run anyway*,
|
|
22
|
+
and `ssh-manager app` checks the installer against the SHA-256 in
|
|
23
|
+
`release-manifest-win32.json`. macOS builds are signed and notarized.
|
|
24
|
+
|
|
25
|
+
Many of these came from reading what the forks of this project changed: thanks
|
|
26
|
+
to @jaredshuai, @SEU-zhc, @fyq163 and @xutianhao6 for the work and the ideas.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- **`ssh-manager codex setup` and `ssh-manager codex status`.** `setup` points
|
|
31
|
+
OpenAI Codex at this engine: only the `ssh-manager` table of
|
|
32
|
+
`~/.codex/config.toml` is replaced, the rest of the file stays, the entry names
|
|
33
|
+
the npm engine, and a second run changes nothing; without an npm install it says
|
|
34
|
+
how to get one and writes nothing. `status` says what Codex runs today. They were
|
|
35
|
+
documented (with `migrate`, `test` and `convert`, which have no meaning with the
|
|
36
|
+
V4 engine; `ssh-manager export servers.toml` writes the servers as TOML) and none
|
|
37
|
+
of them existed. The entry that `ConfigLoader.saveToCodexConfig` wrote named
|
|
38
|
+
`<current directory>/src/index.js`, a file that exists only in a source checkout,
|
|
39
|
+
so for an npm install Codex started no engine; it now names the module's own
|
|
40
|
+
folder. Found thanks to @jaredshuai's fork.
|
|
41
|
+
- **A Chinese interface (简体中文).** Options → Appearance has a *Language / 语言*
|
|
42
|
+
selector, for the desktop application and the web interface; the desktop menus,
|
|
43
|
+
dialogs and notifications follow it. Until you choose, the interface follows the
|
|
44
|
+
system language (Chinese for a `zh` locale, English for anything else), and the
|
|
45
|
+
choice is remembered. English is exactly as it was. Server names, commands,
|
|
46
|
+
paths and what a remote host prints are never translated. The translation is
|
|
47
|
+
@xutianhao6's, from his fork's community build: adapted here, completed for the
|
|
48
|
+
strings it missed and proofread. Thank you.
|
|
49
|
+
- **`ssh_execute` with `background: true`** starts a command detached from the
|
|
50
|
+
SSH session and returns at once with `{ pid, logFile }`, for a job that
|
|
51
|
+
outlives the timeout (a training run, a long build). Read its output with
|
|
52
|
+
`ssh_tail` (`follow: false`), check or stop it with `ssh_process_manager`.
|
|
53
|
+
The log file is never chosen by the caller: a free path would let a command
|
|
54
|
+
that passes the `readonly` policy overwrite any file the SSH user can write,
|
|
55
|
+
so the engine creates a private one with `mktemp`. The launcher works under a
|
|
56
|
+
csh or tcsh login shell; Windows targets are refused with a clear error. The
|
|
57
|
+
idea is @SEU-zhc's.
|
|
58
|
+
- **`ssh-manager guard`**, an opt-in hook for Claude Code that refuses (or, with
|
|
59
|
+
`--mode ask`, asks about) `ssh`, `scp`, `sftp` and a remote `rsync` run from the
|
|
60
|
+
agent's own shell, where the approval, the policy and the audit log do not
|
|
61
|
+
apply, and tells the agent which MCP tool to use. `install` edits only its own
|
|
62
|
+
entry in `~/.claude/settings.json` (a copy is kept the first time), `remove`
|
|
63
|
+
restores the file, `print` and `status` write nothing. It reads the command
|
|
64
|
+
text: a guard against accidents, not a security boundary. The idea is
|
|
65
|
+
@fyq163's, whose hook only reminded.
|
|
66
|
+
- **`SSH_LOG_STDERR=false`** keeps the engine silent on stderr, for a client that
|
|
67
|
+
draws a terminal interface on that stream (OpenCode and Kilo were the
|
|
68
|
+
reports). The log file still receives the log lines; nothing changes unless
|
|
69
|
+
the variable is set. The idea is @fyq163's.
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
|
|
73
|
+
- **With `AUDIT_LOG` set, every tool that targets the server records its
|
|
74
|
+
outcome**, not only a denial or an approval decision: `ssh_tail`, `ssh_sync`,
|
|
75
|
+
`ssh_deploy`, `ssh_db_*`, `ssh_backup_*`, `ssh_process_manager` and the rest now
|
|
76
|
+
leave a line with `success`, and `error` when they failed. A tool that records
|
|
77
|
+
its own exit code still writes exactly one line. Tools that only read local
|
|
78
|
+
state (server list, aliases, tunnel list) leave none. The design is
|
|
79
|
+
@jaredshuai's.
|
|
80
|
+
- **A tool that fails now says so in the MCP reply**: the 36 tools that answered
|
|
81
|
+
"❌ … failed" as plain text now also set `isError`, which is what a client
|
|
82
|
+
expects (and what the audit log needs to tell a failure from a success).
|
|
83
|
+
|
|
84
|
+
### Fixed
|
|
85
|
+
|
|
86
|
+
- **A failed dump no longer reports success.** `mysqldump … | gzip > file` (and
|
|
87
|
+
`pg_dump`) reports the exit code of its last command: with a wrong password, a
|
|
88
|
+
missing database or a full disk the dump died, gzip still succeeded, and
|
|
89
|
+
`ssh_db_dump` and `ssh_backup_create` answered success with an empty archive of
|
|
90
|
+
20 bytes. The cron script made by `ssh_backup_schedule` did the same every night,
|
|
91
|
+
and its retention cleanup then deleted the good archives. A dump that fails now
|
|
92
|
+
fails, with the dump program's own message, and leaves no file; the dump still
|
|
93
|
+
streams, with no temporary file. The cron script has `set -o pipefail`, removes a
|
|
94
|
+
failed archive and stops before the cleanup. Found thanks to @jaredshuai's fork.
|
|
95
|
+
- **A corrupt archive is no longer restored in part.** `gunzip -c dump.gz | mysql`
|
|
96
|
+
ran the database program on whatever gunzip had read, so a truncated archive was
|
|
97
|
+
restored half-way with no error. A gzip file is now tested whole before
|
|
98
|
+
`ssh_db_import` or `ssh_backup_restore` start the database program (MySQL and
|
|
99
|
+
PostgreSQL). A plain dump under a `.gz` name, which a backup made without
|
|
100
|
+
compression used to leave, is still restored.
|
|
101
|
+
- **A MongoDB backup can be restored.** It was written as `<id>.tar.gz` but
|
|
102
|
+
measured and restored as `<id>.gz`: a size of 0 and no way back. One place now
|
|
103
|
+
knows the path, a restore checks the file is there before it starts, and
|
|
104
|
+
archives made by older versions (they were already `<id>.tar.gz`) become
|
|
105
|
+
restorable. `ssh_db_dump` reports the path it really wrote.
|
|
106
|
+
- **`ssh-manager server remove prod` removes `prod`, not `prod_eu` too.** The CLI
|
|
107
|
+
matched a server's lines by the bare prefix `SSH_SERVER_PROD_`, which every
|
|
108
|
+
longer name starts with, so the other server lost its host, user and password.
|
|
109
|
+
Lines are now matched by the setting names the engine reads. Found thanks to
|
|
110
|
+
@jaredshuai's fork.
|
|
111
|
+
- **Editing a server from the CLI keeps its settings.** It deleted all the
|
|
112
|
+
server's lines and wrote seven back, so a read-only server became unrestricted:
|
|
113
|
+
its mode, allow and deny patterns, audit log, group and proxy jump were dropped.
|
|
114
|
+
Only the settings the wizard asks for are replaced now, in place.
|
|
115
|
+
- **A password with a `#` survives the CLI.** `ssh-manager server add` wrote
|
|
116
|
+
`a#b c"d` bare, and the engine read it back as `a` (dotenv starts a comment at
|
|
117
|
+
any `#`). A value is quoted only when dotenv would misread it, so every other
|
|
118
|
+
value is written exactly as before; one that cannot be carried is refused with a
|
|
119
|
+
reason and nothing is written.
|
|
120
|
+
- **The health check no longer counts container layers as disks.** On a Docker
|
|
121
|
+
host every `overlay` layer repeated the same usage, and `tmpfs`, `devtmpfs` and
|
|
122
|
+
`squashfs` mounts counted as full disks (a snap mount is always at 100 %), which
|
|
123
|
+
raised duplicate or false disk alerts. The check now records each mount's
|
|
124
|
+
filesystem type and skips those, keeping `/` even inside a container, and an
|
|
125
|
+
alert fires when usage reaches the threshold, not only when it passes it. In the
|
|
126
|
+
interface, the health card keeps long mount paths and alert text inside its
|
|
127
|
+
borders. Thanks to @xutianhao6.
|
|
128
|
+
- **Remote tunnels (`ssh_tunnel_create` with `type: "remote"`, `ssh -R`) never
|
|
129
|
+
worked**: they failed with `this.ssh.forwardIn is not a function`, because the
|
|
130
|
+
connection wrapper only had `forwardOut`. They work now, and closing one
|
|
131
|
+
cancels the forward and removes its listener. A failed creation is reported as
|
|
132
|
+
an error. Found thanks to @jaredshuai's fork.
|
|
133
|
+
- **Six simultaneous calls on a cold engine opened six SSH connections**, all kept
|
|
134
|
+
open and five of them unreachable, a burst of logins that a server's
|
|
135
|
+
`MaxStartups` or fail2ban can refuse. Callers now wait for the connection being
|
|
136
|
+
established; a failed attempt is not remembered. Found thanks to
|
|
137
|
+
@jaredshuai's fork.
|
|
138
|
+
|
|
139
|
+
### Security
|
|
140
|
+
|
|
141
|
+
- **A database password no longer reaches the audit log or the approval request
|
|
142
|
+
in clear text.** `dbPassword` and `db_password` (taken by the backup, restore,
|
|
143
|
+
dump and import tools) were missing from a list of names to redact, so a
|
|
144
|
+
refused or approved call wrote the password into the audit file and showed it
|
|
145
|
+
in the approval request. The audit log now redacts any key that looks like a
|
|
146
|
+
secret, with the same rule as the logger. Found thanks to @jaredshuai's fork.
|
|
147
|
+
|
|
10
148
|
## [4.1.0] - 2026-11-13
|
|
11
149
|
|
|
12
150
|
**Choose the agent key per server, and sudo in the audit log.** Nothing to
|
package/CLAUDE.md
CHANGED
|
@@ -44,11 +44,9 @@ ssh-manager server show SERVER # Show server details
|
|
|
44
44
|
|
|
45
45
|
### OpenAI Codex Integration
|
|
46
46
|
```bash
|
|
47
|
-
ssh-manager codex setup #
|
|
48
|
-
ssh-manager codex
|
|
49
|
-
ssh-manager
|
|
50
|
-
ssh-manager codex convert to-toml # Convert .env to TOML
|
|
51
|
-
ssh-manager codex convert to-env # Convert TOML to .env
|
|
47
|
+
ssh-manager codex setup # Point Codex at this engine (~/.codex/config.toml)
|
|
48
|
+
ssh-manager codex status # What Codex runs today
|
|
49
|
+
ssh-manager export servers.toml # Servers as TOML (.toml, .env, .csv and .xlsx are written)
|
|
52
50
|
```
|
|
53
51
|
|
|
54
52
|
### Tool Management (NEW in v3.1)
|
package/Formula/ssh-manager.rb
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
class SshManager < Formula
|
|
14
14
|
desc "SSH server management for AI agents, with approval and audit"
|
|
15
15
|
homepage "https://github.com/bvisible/mcp-ssh-manager"
|
|
16
|
-
url "https://registry.npmjs.org/mcp-ssh-manager/-/mcp-ssh-manager-4.0.
|
|
17
|
-
sha256 "
|
|
16
|
+
url "https://registry.npmjs.org/mcp-ssh-manager/-/mcp-ssh-manager-4.1.0.tgz"
|
|
17
|
+
sha256 "c0a5df702f4014aeb9f8b13b4bb91fcc2ed5433d6917ec14fb1d4cc59742bf74"
|
|
18
18
|
license "MIT"
|
|
19
19
|
|
|
20
20
|
depends_on "node"
|
package/INSTALLATION.md
CHANGED
|
@@ -143,6 +143,10 @@ export SSH_MANAGER_ENV="/path/to/your/.env"
|
|
|
143
143
|
|
|
144
144
|
# Optional: Set default log level
|
|
145
145
|
export SSH_LOG_LEVEL="INFO"
|
|
146
|
+
|
|
147
|
+
# Optional: keep the engine silent on stderr, for a client that draws a terminal
|
|
148
|
+
# interface on it. The log file (SSH_LOG_FILE) still receives the log lines.
|
|
149
|
+
export SSH_LOG_STDERR=false
|
|
146
150
|
```
|
|
147
151
|
|
|
148
152
|
## 📦 Project Scope Installation
|
package/README.md
CHANGED
|
@@ -20,8 +20,11 @@
|
|
|
20
20
|
<div align="center">
|
|
21
21
|
|
|
22
22
|
[](https://www.npmjs.com/package/mcp-ssh-manager)
|
|
23
|
+
[](docs/DOWNLOAD-STATS.md)
|
|
23
24
|
[](https://www.npmjs.com/package/mcp-ssh-manager)
|
|
24
|
-
[](https://github.com/bvisible/mcp-ssh-manager/releases/latest)
|
|
26
|
+
[](https://github.com/bvisible/mcp-ssh-manager/stargazers)
|
|
27
|
+
[](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v4.2.0)
|
|
25
28
|
[](https://claude.ai/code)
|
|
26
29
|
[](https://openai.com/codex)
|
|
27
30
|
[](https://modelcontextprotocol.io)
|
|
@@ -54,9 +57,9 @@ An MCP SSH server is the most dangerous tool you can hand an agent: a shell on m
|
|
|
54
57
|
|
|
55
58
|
## Choose your workspace
|
|
56
59
|
|
|
57
|
-
**Desktop application (`4.
|
|
60
|
+
**Desktop application (`4.2.0`):** one installation with its own runtime,
|
|
58
61
|
terminal, file browser and server settings. No separate Node.js or npm
|
|
59
|
-
installation. [Download it](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v4.
|
|
62
|
+
installation. [Download it](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v4.2.0):
|
|
60
63
|
|
|
61
64
|
| Platform | File | Signature |
|
|
62
65
|
|---|---|---|
|
|
@@ -64,7 +67,7 @@ installation. [Download it](https://github.com/bvisible/mcp-ssh-manager/releases
|
|
|
64
67
|
| Windows x64 / arm64 | `…-setup.exe` | **Not code-signed yet.** Windows shows *"Windows protected your PC"*: *More info → Run anyway*. Check the file against the SHA-256 in `release-manifest-win32.json` on the release (`ssh-manager app` does it for you). Signing comes in a later release. |
|
|
65
68
|
| Linux x64 | `.deb`, `.AppImage` | Unsigned, as Linux packages usually are |
|
|
66
69
|
|
|
67
|
-
**Already using npm / the CLI?** `npm update -g mcp-ssh-manager` brings 4.
|
|
70
|
+
**Already using npm / the CLI?** `npm update -g mcp-ssh-manager` brings 4.2.0,
|
|
68
71
|
and the V4 engine runs without an interface, from your existing `.env`, TOML or
|
|
69
72
|
process variables — no automatic import, no forced wizard, no approval prompt
|
|
70
73
|
unless you enable one per server. The one behaviour that tightens is **SSH
|
|
@@ -316,6 +319,19 @@ AES-256-GCM, master key in your OS keychain (a `0600` file where there is none
|
|
|
316
319
|
|
|
317
320
|
**The key belongs to this machine.** A vault copied to a new laptop is ciphertext nobody can open — `vault backup` writes a copy encrypted under a passphrase you choose, which is what makes the move survivable. Your `.env` is never modified, not by `import`, not by the interface, and a setup half in each is a normal state rather than a broken one. Upgrading changes nothing on its own: see **[docs/MIGRATION.md](docs/MIGRATION.md)**.
|
|
318
321
|
|
|
322
|
+
### Keep the agent on the tools
|
|
323
|
+
|
|
324
|
+
Approval, modes and the audit log only see what goes through these tools. An agent that also has a terminal can run `ssh prod rm -rf …` there and none of it applies. For Claude Code, an opt-in hook closes that door:
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
ssh-manager guard install # refuse ssh, scp, sftp and remote rsync in the agent's shell
|
|
328
|
+
ssh-manager guard install --mode ask # …or ask you each time
|
|
329
|
+
ssh-manager guard print # show what it would write, change nothing
|
|
330
|
+
ssh-manager guard remove
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
The agent is told why and which tool to use instead (`ssh_execute`, `ssh_upload`, `ssh_sync`, `ssh_tunnel_create`). It is a guard against accidents, not a security boundary: it reads the command text. Keep SSH keys and agent sockets away from the account the agent runs as. Nothing is installed unless you run `install`; it edits only its own entry in `~/.claude/settings.json`, and keeps a copy of the file as it was.
|
|
334
|
+
|
|
319
335
|
### The unglamorous parts, which are the ones that bite
|
|
320
336
|
|
|
321
337
|
- **Your sudo password never reaches the remote command line.** It travels on the SSH channel's stdin, so it isn't visible in `ps`, in `/proc/<pid>/cmdline`, or in an `auditd` trail — unlike the `echo "$pass" | sudo -S` pattern common in this category ([#34](https://github.com/bvisible/mcp-ssh-manager/issues/34)).
|
|
@@ -697,6 +713,8 @@ The hero animation ships twice, light and dark, swapped by `<picture>` on `prefe
|
|
|
697
713
|
|
|
698
714
|
## What's new
|
|
699
715
|
|
|
716
|
+
**[4.2.0](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v4.2.0) — a Chinese interface, a fuller audit log, and a guard against raw ssh.** The interface and the desktop menus come in 简体中文 (*Options → Appearance → Language*; thanks to @xutianhao6). With `AUDIT_LOG` on, every tool now records what it did, not only a few. `ssh_execute` can start a long job in the background (`background: true`, an idea from @SEU-zhc), and the opt-in `ssh-manager guard` keeps an agent from running `ssh` in its own shell, where approval and audit do not apply (an idea from @fyq163). Fixed, thanks to @jaredshuai's fork: **backups that reported success when the dump had failed** (an empty archive, every night from `ssh_backup_schedule`), a corrupt archive restored in part, MongoDB backups that could not be restored, `ssh-manager server remove` deleting a look-alike server, editing a server turning read-only into unrestricted, remote tunnels that never worked, a database password in the audit log, and six simultaneous calls opening six connections. `ssh-manager codex setup` now exists. A tool that fails now sets `isError` in its reply. See the [CHANGELOG](CHANGELOG.md#420---2026-11-13).
|
|
717
|
+
|
|
700
718
|
**[4.1.0](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v4.1.0) — choose the agent key per server, and sudo in the audit log.** A server can name the one key of your SSH agent it uses, so an agent that holds many keys (a password manager's, say) no longer runs into `MaxAuthTries` before the right one is offered (thanks to @RebornOnce, [#128](https://github.com/bvisible/mcp-ssh-manager/pull/128)); with `AUDIT_LOG` on, `ssh_execute_sudo`, downloads, group commands and commands sent to a session now record what they did, never the sudo password ([#134](https://github.com/bvisible/mcp-ssh-manager/pull/134), thanks to @orshih6, reported by @revert12); [`llms-install.md`](llms-install.md) lets an agent set the server up for you; dependencies refreshed. Nothing to change on upgrade. See the [CHANGELOG](CHANGELOG.md#410---2026-11-13).
|
|
701
719
|
|
|
702
720
|
**[4.0.3](https://github.com/bvisible/mcp-ssh-manager/releases/tag/v4.0.3) — a security release; upgrade.** `ssh_db_query`, the read-only tool, could run shell commands on the server through the `psql` and `mysql` clients' own commands (`\!`), including on servers in `readonly` or `restricted` mode ([GHSA-qmf5-hrhv-5hjm](https://github.com/bvisible/mcp-ssh-manager/security/advisories/GHSA-qmf5-hrhv-5hjm), reported by @orshih6). Every version before it is affected. A MySQL query must now be one line without backslashes. See the [CHANGELOG](CHANGELOG.md#403---2026-11-05).
|
package/cli/codex.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `ssh-manager codex` — point OpenAI Codex at this engine.
|
|
3
|
+
//
|
|
4
|
+
// ssh-manager codex setup Write Codex's ssh-manager entry (~/.codex/config.toml)
|
|
5
|
+
// ssh-manager codex status What Codex runs today
|
|
6
|
+
//
|
|
7
|
+
// It uses the same code as the interface's AI tools panel (src/agent-clients.js): only
|
|
8
|
+
// the ssh-manager table of the file is replaced, every other table and comment stays,
|
|
9
|
+
// and the entry names the engine that npm installed. The commands were documented
|
|
10
|
+
// (setup, migrate, test, convert) long before they existed; setup and status are the
|
|
11
|
+
// two that have a meaning with the V4 engine. Idea from jaredshuai's fork, which found
|
|
12
|
+
// the other way of writing the entry pointing into a source checkout.
|
|
13
|
+
//
|
|
14
|
+
// Native Node rather than Bash, so it works on Windows without Git Bash.
|
|
15
|
+
// Exit codes: 0 done, 1 could not, 2 a command that does not exist.
|
|
16
|
+
import { fileURLToPath } from 'node:url';
|
|
17
|
+
import { agentContext, agentsStatus, useEngine } from '../src/agent-clients.js';
|
|
18
|
+
import { BOLD, DIM, RESET } from './style.js';
|
|
19
|
+
|
|
20
|
+
const USAGE = `
|
|
21
|
+
${BOLD}ssh-manager codex${RESET} — OpenAI Codex
|
|
22
|
+
|
|
23
|
+
ssh-manager codex setup Point Codex at this engine (the ssh-manager table of ~/.codex/config.toml)
|
|
24
|
+
ssh-manager codex status Whether Codex is installed and what its ssh-manager entry runs
|
|
25
|
+
|
|
26
|
+
${DIM}Servers for Codex: ssh-manager export servers.toml writes them in TOML.${RESET}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
const describe = state => (state.engine === 'npm' ? 'the npm engine' : state.engine === 'app' ? "the desktop app's engine"
|
|
30
|
+
: state.engine === 'other' ? 'another ssh-manager (a checkout or a custom command)' : 'nothing yet');
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @param {string[]} args
|
|
34
|
+
* @param {import('../src/agent-clients.js').Context} [context]
|
|
35
|
+
* @param {{ log: (text: string) => void, error: (text: string) => void }} [out]
|
|
36
|
+
* @returns {Promise<number>} the exit code
|
|
37
|
+
*/
|
|
38
|
+
export async function codexCommand(args, context = agentContext(), out = console) {
|
|
39
|
+
const [command] = args;
|
|
40
|
+
if (!command || ['help', '-h', '--help'].includes(command)) { out.log(USAGE); return command ? 0 : 2; }
|
|
41
|
+
if (command !== 'setup' && command !== 'status') {
|
|
42
|
+
out.error(`Unknown command: codex ${command}\n${USAGE}`);
|
|
43
|
+
return 2;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
if (command === 'status') {
|
|
47
|
+
const state = (await agentsStatus(context)).clients.find(client => client.id === 'codex');
|
|
48
|
+
out.log(`Codex ${state.installed ? 'is installed' : 'was not found here'}; its ssh-manager entry runs ${describe(state)}${state.version ? ` ${state.version}` : ''}.`);
|
|
49
|
+
out.log(`${DIM}${state.configPath}${RESET}`);
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
52
|
+
const state = await useEngine('codex', 'npm', context);
|
|
53
|
+
out.log(`Codex now runs ${describe(state)}${state.version ? ` ${state.version}` : ''}.`);
|
|
54
|
+
out.log(`${DIM}${state.configPath}${RESET}`);
|
|
55
|
+
out.log('Start a new Codex session for it to take effect.');
|
|
56
|
+
return 0;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
out.error(error.message.includes('not installed with npm')
|
|
59
|
+
? 'mcp-ssh-manager is not installed with npm here: run `npm install -g mcp-ssh-manager` first.'
|
|
60
|
+
: error.message);
|
|
61
|
+
return 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
66
|
+
codexCommand(process.argv.slice(2)).then(code => process.exit(code));
|
|
67
|
+
}
|
package/cli/guard.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// ssh-manager guard: an opt-in Claude Code hook that refuses (or asks about) an
|
|
3
|
+
// `ssh`, `scp`, `sftp` or remote `rsync` run from the agent's shell, because it
|
|
4
|
+
// would skip the approval, the policy and the audit log of the MCP tools.
|
|
5
|
+
// Nothing is changed unless `install` is run; `print` shows what it would do.
|
|
6
|
+
import {
|
|
7
|
+
MODES, claudeSettingsPath, guardStatus, hookCommand, hookScriptPath, installGuard, removeGuard,
|
|
8
|
+
} from '../src/ssh-guard.js';
|
|
9
|
+
|
|
10
|
+
const HELP = `Usage: ssh-manager guard <command> [options]
|
|
11
|
+
|
|
12
|
+
Keep an AI agent from running ssh, scp, sftp or a remote rsync in its own shell,
|
|
13
|
+
where ssh-manager's approval, policy and audit log do not see it. Claude Code only.
|
|
14
|
+
|
|
15
|
+
Commands:
|
|
16
|
+
install Add the hook to Claude Code's settings (and copy its script)
|
|
17
|
+
remove Take the hook out again
|
|
18
|
+
status Say whether it is installed, and in which mode
|
|
19
|
+
print Show what install would write, and change nothing
|
|
20
|
+
|
|
21
|
+
Options:
|
|
22
|
+
--mode deny|ask deny (default) refuses the command and tells the agent to use
|
|
23
|
+
the MCP tools; ask lets you decide each time
|
|
24
|
+
--settings FILE Claude Code settings file (default: ~/.claude/settings.json,
|
|
25
|
+
or $CLAUDE_CONFIG_DIR/settings.json)
|
|
26
|
+
--delete-script With remove: also delete the copied script
|
|
27
|
+
|
|
28
|
+
This is a guard against accidents, not a security boundary: it reads the command
|
|
29
|
+
text. Keep SSH keys and agent sockets away from the account the agent runs as.
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
function option(args, name) {
|
|
33
|
+
const index = args.indexOf(name);
|
|
34
|
+
return index === -1 ? undefined : args[index + 1];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const [command, ...args] = process.argv.slice(2);
|
|
38
|
+
const settingsFile = option(args, '--settings') || claudeSettingsPath();
|
|
39
|
+
const mode = option(args, '--mode') || 'deny';
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
if (!command || ['help', '-h', '--help'].includes(command)) {
|
|
43
|
+
process.stdout.write(HELP);
|
|
44
|
+
} else if (command === 'install') {
|
|
45
|
+
if (!MODES.includes(mode)) throw new Error(`--mode must be one of ${MODES.join(', ')}`);
|
|
46
|
+
const done = installGuard({ mode, settingsFile });
|
|
47
|
+
console.log(`Installed in ${done.settingsFile} (mode: ${done.mode}).`);
|
|
48
|
+
console.log(`The hook script is ${done.script}.`);
|
|
49
|
+
console.log('Restart the Claude Code sessions that are open for it to apply.');
|
|
50
|
+
} else if (command === 'remove') {
|
|
51
|
+
const done = removeGuard({ settingsFile, deleteScript: args.includes('--delete-script') });
|
|
52
|
+
console.log(done.removed ? `Removed from ${done.settingsFile}.` : `Nothing to remove in ${done.settingsFile}.`);
|
|
53
|
+
} else if (command === 'status') {
|
|
54
|
+
const status = guardStatus({ settingsFile });
|
|
55
|
+
console.log(status.installed ? `Installed in ${status.settingsFile} (mode: ${status.mode}).` : `Not installed (${status.settingsFile}).`);
|
|
56
|
+
if (status.installed && !status.scriptPresent) console.log('The hook script is missing: run `ssh-manager guard install` again.');
|
|
57
|
+
} else if (command === 'print') {
|
|
58
|
+
if (!MODES.includes(mode)) throw new Error(`--mode must be one of ${MODES.join(', ')}`);
|
|
59
|
+
console.log(`Would add to ${settingsFile}:\n`);
|
|
60
|
+
console.log(JSON.stringify({ hooks: { PreToolUse: [{ matcher: 'Bash', hooks: [{ type: 'command', command: hookCommand(hookScriptPath(), mode) }] }] } }, null, 2));
|
|
61
|
+
console.log('\nNothing was changed.');
|
|
62
|
+
} else {
|
|
63
|
+
process.stderr.write(`Unknown command: ${command}\n\n${HELP}`);
|
|
64
|
+
process.exit(2);
|
|
65
|
+
}
|
|
66
|
+
} catch (error) {
|
|
67
|
+
process.stderr.write(`${error.message}\n`);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
package/cli/lib/config.sh
CHANGED
|
@@ -120,6 +120,64 @@ load_servers() {
|
|
|
120
120
|
printf '%s\n' "${servers[@]}" | sort -u
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
# The settings of a server, as the engine reads them (src/config-loader.js; a test
|
|
124
|
+
# keeps the two lists in step). A server's lines are found by these names and never
|
|
125
|
+
# by the bare prefix: removing "prod" used to remove the lines of "prod_eu" too.
|
|
126
|
+
SERVER_ENV_FIELDS="HOST USER PASSWORD KEYPATH CERTPATH AGENT_PUBLIC_KEY_PATH PASSPHRASE PORT DEFAULT_DIR SUDO_PASSWORD DESCRIPTION GROUP PLATFORM PROXYJUMP PROXYCOMMAND FORWARD_AGENT ANNOUNCE_AGENT MODE ALLOW_PATTERNS DENY_PATTERNS AUDIT_LOG APPROVAL"
|
|
127
|
+
|
|
128
|
+
# Copy stdin to stdout without the lines of server $1 (upper case) whose setting is
|
|
129
|
+
# in $2 (space separated). With a file as $3, its lines take the place of the first
|
|
130
|
+
# line dropped, so a server keeps its place and every setting that is not rewritten.
|
|
131
|
+
# Compared as text, never as a pattern: a name cannot steer it.
|
|
132
|
+
rewrite_server_lines() {
|
|
133
|
+
awk -v name="$1" -v fields="$2" -v block="${3:-}" '
|
|
134
|
+
BEGIN {
|
|
135
|
+
n = split(fields, f, " "); for (i = 1; i <= n; i++) drop[f[i]] = 1
|
|
136
|
+
prefix = "SSH_SERVER_" name "_"; done = 0
|
|
137
|
+
}
|
|
138
|
+
{
|
|
139
|
+
if (index($0, prefix) == 1) {
|
|
140
|
+
eq = index($0, "=")
|
|
141
|
+
if (eq > 0) {
|
|
142
|
+
field = substr($0, length(prefix) + 1, eq - length(prefix) - 1)
|
|
143
|
+
if (field in drop) {
|
|
144
|
+
if (block != "" && !done) { while ((getline line < block) > 0) print line; close(block); done = 1 }
|
|
145
|
+
next
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
print
|
|
150
|
+
}
|
|
151
|
+
END { if (block != "" && !done) { print ""; while ((getline line < block) > 0) print line; close(block) } }'
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
# One KEY=value line, written so that the engine's dotenv reads the value back as it
|
|
155
|
+
# was. A plain value stays bare, as before; one that dotenv would misread (a "#"
|
|
156
|
+
# starts a comment anywhere in it, a leading quote or space is eaten) is quoted with
|
|
157
|
+
# the delimiter it does not contain: single quotes and backticks have no escapes.
|
|
158
|
+
# With a third argument the value is quoted even when plain (descriptions and
|
|
159
|
+
# patterns always were), with double quotes unless it holds one.
|
|
160
|
+
env_line() {
|
|
161
|
+
local key="$1" value="$2" quote="${3:-}"
|
|
162
|
+
case "$value" in
|
|
163
|
+
*$'\n'*|*$'\r'*) print_error "The value of $key cannot hold a line break" >&2; return 1 ;;
|
|
164
|
+
esac
|
|
165
|
+
if [ -n "$quote" ] && [[ "$value" != *\"* ]]; then
|
|
166
|
+
printf '%s="%s"\n' "$key" "$value"
|
|
167
|
+
elif [[ "$value" != *"#"* ]] && [[ "$value" != [\'\"\`\ ]* ]] && [[ "$value" != *" " ]]; then
|
|
168
|
+
printf '%s=%s\n' "$key" "$value"
|
|
169
|
+
elif [[ "$value" != *\'* ]]; then
|
|
170
|
+
printf "%s='%s'\n" "$key" "$value"
|
|
171
|
+
elif [[ "$value" != *\"* ]]; then
|
|
172
|
+
printf '%s="%s"\n' "$key" "$value"
|
|
173
|
+
elif [[ "$value" != *'`'* ]]; then
|
|
174
|
+
printf '%s=`%s`\n' "$key" "$value"
|
|
175
|
+
else
|
|
176
|
+
print_error "The value of $key holds all three quote characters (' \" \`) and has to be quoted: the .env format cannot carry it" >&2
|
|
177
|
+
return 1
|
|
178
|
+
fi
|
|
179
|
+
}
|
|
180
|
+
|
|
123
181
|
# Get server configuration
|
|
124
182
|
get_server_config() {
|
|
125
183
|
local server="$1"
|
|
@@ -147,8 +205,9 @@ get_server_config() {
|
|
|
147
205
|
return 1
|
|
148
206
|
fi
|
|
149
207
|
|
|
150
|
-
# Only remove surrounding quotes if they exist
|
|
151
|
-
|
|
208
|
+
# Only remove surrounding quotes if they exist (the three dotenv accepts),
|
|
209
|
+
# preserve quotes within the value
|
|
210
|
+
if [[ "$value" =~ ^\"(.*)\"$ ]] || [[ "$value" =~ ^\'(.*)\'$ ]] || [[ "$value" =~ ^\`(.*)\`$ ]]; then
|
|
152
211
|
printf '%s' "${BASH_REMATCH[1]}"
|
|
153
212
|
else
|
|
154
213
|
printf '%s' "$value"
|
|
@@ -187,36 +246,39 @@ add_server_to_env() {
|
|
|
187
246
|
# Backup .env file
|
|
188
247
|
cp "$SSH_MANAGER_ENV" "$SSH_MANAGER_ENV.bak"
|
|
189
248
|
|
|
190
|
-
# Add server configuration
|
|
191
|
-
|
|
249
|
+
# Add server configuration. Built before anything is written, so a value that
|
|
250
|
+
# cannot be carried by the .env format (see env_line) leaves the file as it was.
|
|
251
|
+
local block
|
|
252
|
+
block="$(
|
|
192
253
|
echo ""
|
|
193
254
|
echo "# Server: $name"
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
255
|
+
env_line "SSH_SERVER_${name_upper}_HOST" "$host" &&
|
|
256
|
+
env_line "SSH_SERVER_${name_upper}_USER" "$user" &&
|
|
257
|
+
env_line "SSH_SERVER_${name_upper}_PORT" "$port" || exit 1
|
|
197
258
|
|
|
198
259
|
if [ "$auth_type" = "password" ]; then
|
|
199
|
-
|
|
260
|
+
env_line "SSH_SERVER_${name_upper}_PASSWORD" "$auth_value" || exit 1
|
|
200
261
|
else
|
|
201
|
-
|
|
262
|
+
env_line "SSH_SERVER_${name_upper}_KEYPATH" "$auth_value" || exit 1
|
|
202
263
|
fi
|
|
203
264
|
|
|
204
265
|
if [ -n "$description" ]; then
|
|
205
|
-
|
|
266
|
+
env_line "SSH_SERVER_${name_upper}_DESCRIPTION" "$description" quote || exit 1
|
|
206
267
|
fi
|
|
207
268
|
|
|
208
269
|
# Security mode (v3.5.0+) — only emit non-empty / non-default values to
|
|
209
270
|
# keep generated .env diff-free for users who skip these prompts.
|
|
210
271
|
if [ -n "$mode" ] && [ "$mode" != "unrestricted" ]; then
|
|
211
|
-
|
|
272
|
+
env_line "SSH_SERVER_${name_upper}_MODE" "$mode" || exit 1
|
|
212
273
|
fi
|
|
213
274
|
if [ -n "$allow_patterns" ]; then
|
|
214
|
-
|
|
275
|
+
env_line "SSH_SERVER_${name_upper}_ALLOW_PATTERNS" "$allow_patterns" quote || exit 1
|
|
215
276
|
fi
|
|
216
277
|
if [ -n "$audit_log" ]; then
|
|
217
|
-
|
|
278
|
+
env_line "SSH_SERVER_${name_upper}_AUDIT_LOG" "$audit_log" || exit 1
|
|
218
279
|
fi
|
|
219
|
-
|
|
280
|
+
)" || { rm -f "$SSH_MANAGER_ENV.bak"; return 1; }
|
|
281
|
+
printf '%s\n' "$block" >> "$SSH_MANAGER_ENV"
|
|
220
282
|
|
|
221
283
|
print_success "Server '$name' added successfully"
|
|
222
284
|
}
|
|
@@ -243,37 +305,39 @@ update_server_in_env() {
|
|
|
243
305
|
# Backup .env file
|
|
244
306
|
cp "$SSH_MANAGER_ENV" "$SSH_MANAGER_ENV.bak"
|
|
245
307
|
|
|
246
|
-
#
|
|
247
|
-
|
|
248
|
-
#
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
echo "SSH_SERVER_${name_upper}_USER=$user"
|
|
259
|
-
echo "SSH_SERVER_${name_upper}_PORT=$port"
|
|
308
|
+
# The settings this function writes replace, in place, the ones the server had;
|
|
309
|
+
# every other setting of the server (mode, allow and deny patterns, audit log,
|
|
310
|
+
# group, proxy jump, platform...) stays exactly as it was. It used to delete all
|
|
311
|
+
# of them and write seven back, so editing a read-only server made it unrestricted.
|
|
312
|
+
# A changed login method drops the old one (a password or a key path, not both).
|
|
313
|
+
local block temp
|
|
314
|
+
block=$(mktemp)
|
|
315
|
+
temp=$(mktemp)
|
|
316
|
+
(
|
|
317
|
+
env_line "SSH_SERVER_${name_upper}_HOST" "$host" &&
|
|
318
|
+
env_line "SSH_SERVER_${name_upper}_USER" "$user" &&
|
|
319
|
+
env_line "SSH_SERVER_${name_upper}_PORT" "$port" || exit 1
|
|
260
320
|
|
|
261
321
|
if [ "$auth_type" = "password" ]; then
|
|
262
|
-
|
|
322
|
+
env_line "SSH_SERVER_${name_upper}_PASSWORD" "$auth_value" || exit 1
|
|
263
323
|
else
|
|
264
|
-
|
|
324
|
+
env_line "SSH_SERVER_${name_upper}_KEYPATH" "$auth_value" || exit 1
|
|
265
325
|
fi
|
|
266
326
|
|
|
267
327
|
if [ -n "$description" ]; then
|
|
268
|
-
|
|
328
|
+
env_line "SSH_SERVER_${name_upper}_DESCRIPTION" "$description" quote || exit 1
|
|
269
329
|
fi
|
|
270
330
|
|
|
271
331
|
if [ -n "$default_dir" ]; then
|
|
272
|
-
|
|
332
|
+
env_line "SSH_SERVER_${name_upper}_DEFAULT_DIR" "$default_dir" || exit 1
|
|
273
333
|
fi
|
|
274
|
-
|
|
334
|
+
) > "$block" || { rm -f "$block" "$temp" "$SSH_MANAGER_ENV.bak"; return 1; }
|
|
275
335
|
|
|
276
|
-
|
|
336
|
+
rewrite_server_lines "$name_upper" "HOST USER PORT PASSWORD KEYPATH DESCRIPTION DEFAULT_DIR" "$block" < "$SSH_MANAGER_ENV" > "$temp"
|
|
337
|
+
# Written through the file, not renamed over it: its mode stays what it was.
|
|
338
|
+
cat "$temp" > "$SSH_MANAGER_ENV"
|
|
339
|
+
|
|
340
|
+
rm -f "$temp" "$block"
|
|
277
341
|
print_success "Server '$name' updated successfully"
|
|
278
342
|
}
|
|
279
343
|
|
|
@@ -290,10 +354,11 @@ remove_server_from_env() {
|
|
|
290
354
|
# Backup .env file
|
|
291
355
|
cp "$SSH_MANAGER_ENV" "$SSH_MANAGER_ENV.bak"
|
|
292
356
|
|
|
293
|
-
# Remove all lines for this server
|
|
357
|
+
# Remove all lines for this server, and only this server's (see SERVER_ENV_FIELDS)
|
|
294
358
|
local temp=$(mktemp)
|
|
295
|
-
|
|
296
|
-
|
|
359
|
+
rewrite_server_lines "$name_upper" "$SERVER_ENV_FIELDS" < "$SSH_MANAGER_ENV" > "$temp"
|
|
360
|
+
cat "$temp" > "$SSH_MANAGER_ENV"
|
|
361
|
+
rm -f "$temp"
|
|
297
362
|
|
|
298
363
|
print_success "Server '$name' removed successfully"
|
|
299
364
|
}
|
package/cli/ssh-manager
CHANGED
|
@@ -99,6 +99,9 @@ show_help() {
|
|
|
99
99
|
vault status Where it and its key live
|
|
100
100
|
vault add|remove <name> One server in or out
|
|
101
101
|
vault backup|restore <file> A recovery file, under a passphrase
|
|
102
|
+
codex setup|status Point Codex at this engine
|
|
103
|
+
guard install|remove|status Keep agents off raw ssh in their shell
|
|
104
|
+
guard print What install would write, nothing changed
|
|
102
105
|
import <file> A spreadsheet, CSV, ~/.ssh/config, FileZilla,
|
|
103
106
|
PuTTY, Termius or MobaXterm export (detected)
|
|
104
107
|
import --from <tool> ssh-config · filezilla · transmit
|
|
@@ -382,6 +385,16 @@ main() {
|
|
|
382
385
|
# reads — one code path, so the two cannot disagree.
|
|
383
386
|
node "$SCRIPT_DIR/portability.js" "$command" "$@"
|
|
384
387
|
;;
|
|
388
|
+
codex)
|
|
389
|
+
# Codex's ssh-manager entry, through the same code as the interface's
|
|
390
|
+
# AI tools panel. Node, so it writes the file the way the engine does.
|
|
391
|
+
node "$SCRIPT_DIR/codex.js" "$@"
|
|
392
|
+
;;
|
|
393
|
+
guard)
|
|
394
|
+
# Opt-in Claude Code hook against raw ssh. Node, like vault: it edits
|
|
395
|
+
# a JSON file, and the same code is what runs as the hook.
|
|
396
|
+
node "$SCRIPT_DIR/guard.js" "$@"
|
|
397
|
+
;;
|
|
385
398
|
vault)
|
|
386
399
|
# v4 encrypted credential store. Implemented in Node because it uses
|
|
387
400
|
# the same SecretStore the MCP server reads from — one code path for
|
package/cli/ssh-manager.js
CHANGED
|
@@ -28,7 +28,7 @@ const isWindows = platform() === 'win32';
|
|
|
28
28
|
const args = process.argv.slice(2);
|
|
29
29
|
|
|
30
30
|
// These commands are native Node and also work on Windows without Git Bash.
|
|
31
|
-
const nativeCommands = { control: 'control.js', vault: 'vault.js', import: 'portability.js', export: 'portability.js', app: 'app.js' };
|
|
31
|
+
const nativeCommands = { control: 'control.js', vault: 'vault.js', import: 'portability.js', export: 'portability.js', app: 'app.js', guard: 'guard.js', codex: 'codex.js' };
|
|
32
32
|
if (Object.hasOwn(nativeCommands, args[0])) {
|
|
33
33
|
const commandArgs = ['import', 'export'].includes(args[0]) ? args : args.slice(1);
|
|
34
34
|
const result = spawnSync(process.execPath, [join(__dirname, nativeCommands[args[0]]), ...commandArgs], { stdio: 'inherit' });
|