@akms/mcp-ssh 0.1.3 → 0.1.5
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 +282 -262
- package/lib/cli.cjs +16 -12
- package/lib/cli.cjs.map +1 -1
- package/lib/cli.js +16 -12
- package/lib/cli.js.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +69 -69
package/lib/cli.cjs
CHANGED
|
@@ -35,7 +35,7 @@ var CWD_MARKER = "__AKMS_SSH_CWD__";
|
|
|
35
35
|
var MAX_DIRECTORY_ENTRIES = 1e3;
|
|
36
36
|
var SERVER_NAME = "akms-mcp-ssh";
|
|
37
37
|
var PACKAGE_NAME = "@akms/mcp-ssh";
|
|
38
|
-
var SERVER_VERSION = "0.1.
|
|
38
|
+
var SERVER_VERSION = "0.1.5";
|
|
39
39
|
|
|
40
40
|
// src/_defs/command-rules.ts
|
|
41
41
|
var CRITICAL_PATH_PATTERN = new RegExp(
|
|
@@ -4834,7 +4834,7 @@ async function manageHost(prompter, output, target, entries, name) {
|
|
|
4834
4834
|
}
|
|
4835
4835
|
}
|
|
4836
4836
|
}
|
|
4837
|
-
async function
|
|
4837
|
+
async function runConfigCommand(options) {
|
|
4838
4838
|
const { input, output } = options;
|
|
4839
4839
|
const targets = options.targets ?? listConfigTargets();
|
|
4840
4840
|
let target = targets[0];
|
|
@@ -5644,12 +5644,11 @@ function createSshMcpServer() {
|
|
|
5644
5644
|
}
|
|
5645
5645
|
|
|
5646
5646
|
// src/cli.ts
|
|
5647
|
-
var SETUP_COMMAND_NAMES = ["setup", "config"];
|
|
5648
5647
|
function parseArguments(argv) {
|
|
5649
|
-
const parsed = { showHelp: false, showVersion: false, checkOnly: false,
|
|
5648
|
+
const parsed = { showHelp: false, showVersion: false, checkOnly: false, configMode: false };
|
|
5650
5649
|
let rest = argv;
|
|
5651
|
-
if (argv[0]
|
|
5652
|
-
parsed.
|
|
5650
|
+
if (argv[0] === "config") {
|
|
5651
|
+
parsed.configMode = true;
|
|
5653
5652
|
rest = argv.slice(1);
|
|
5654
5653
|
}
|
|
5655
5654
|
for (let index = 0; index < rest.length; index += 1) {
|
|
@@ -5683,17 +5682,17 @@ var HELP_TEXT = [
|
|
|
5683
5682
|
"",
|
|
5684
5683
|
"Usage:",
|
|
5685
5684
|
" akms-mcp-ssh [--check]",
|
|
5686
|
-
" akms-mcp-ssh
|
|
5685
|
+
" akms-mcp-ssh config [--target <client>]",
|
|
5687
5686
|
"",
|
|
5688
5687
|
"Commands:",
|
|
5689
|
-
"
|
|
5688
|
+
" config Manage the SSH hosts registered in an MCP client's config \u2014",
|
|
5690
5689
|
" list, add, edit, remove, check, print. Asks plain questions,",
|
|
5691
5690
|
" so the SSH_* names below never have to be typed.",
|
|
5692
5691
|
"",
|
|
5693
5692
|
"Options:",
|
|
5694
5693
|
" --check Connect to the configured host, report the result, and exit.",
|
|
5695
5694
|
" Prints the host key fingerprint so it can be pinned.",
|
|
5696
|
-
" --target <id>
|
|
5695
|
+
" --target <id> config: claude-code | codex | claude-desktop | cursor",
|
|
5697
5696
|
" (default: the first one installed)",
|
|
5698
5697
|
" -v, --version Print the version and exit",
|
|
5699
5698
|
" -h, --help Print this help and exit",
|
|
@@ -5727,7 +5726,7 @@ var HELP_TEXT = [
|
|
|
5727
5726
|
].join("\n");
|
|
5728
5727
|
async function runCheckCommand(profile) {
|
|
5729
5728
|
if (profile == null) {
|
|
5730
|
-
process.stdout.write(`No SSH host is registered \u2014 set ${SINGLE_HOST_ENV.HOST} and ${SINGLE_HOST_ENV.USER}, or run: akms-mcp-ssh
|
|
5729
|
+
process.stdout.write(`No SSH host is registered \u2014 set ${SINGLE_HOST_ENV.HOST} and ${SINGLE_HOST_ENV.USER}, or run: akms-mcp-ssh config
|
|
5731
5730
|
`);
|
|
5732
5731
|
return 1;
|
|
5733
5732
|
}
|
|
@@ -5739,6 +5738,11 @@ async function runCheckCommand(profile) {
|
|
|
5739
5738
|
}
|
|
5740
5739
|
async function main() {
|
|
5741
5740
|
const _logger = $logger.child({ context: "cli" });
|
|
5741
|
+
if (process.argv[2] === "setup") {
|
|
5742
|
+
process.stderr.write("The setup command has been removed. Use akms-mcp-ssh config.\n");
|
|
5743
|
+
process.exitCode = 1;
|
|
5744
|
+
return;
|
|
5745
|
+
}
|
|
5742
5746
|
const cliArguments = parseArguments(process.argv.slice(2));
|
|
5743
5747
|
if (cliArguments.showHelp == true) {
|
|
5744
5748
|
process.stderr.write(`${HELP_TEXT}
|
|
@@ -5750,11 +5754,11 @@ async function main() {
|
|
|
5750
5754
|
`);
|
|
5751
5755
|
return;
|
|
5752
5756
|
}
|
|
5753
|
-
if (cliArguments.
|
|
5757
|
+
if (cliArguments.configMode == true) {
|
|
5754
5758
|
if (process.env[LOG_LEVEL_ENV] == null) {
|
|
5755
5759
|
process.env[LOG_LEVEL_ENV] = "warn";
|
|
5756
5760
|
}
|
|
5757
|
-
const exitCode = await
|
|
5761
|
+
const exitCode = await runConfigCommand({
|
|
5758
5762
|
input: process.stdin,
|
|
5759
5763
|
output: process.stdout,
|
|
5760
5764
|
targetId: cliArguments.targetId
|