@ethanfly/sshx 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +308 -2
- package/bin/sshx.js +22 -0
- package/dist/cli/connect.d.ts +26 -0
- package/dist/cli/connect.d.ts.map +1 -0
- package/dist/cli/connect.js +183 -0
- package/dist/cli/connect.js.map +1 -0
- package/dist/cli/exec.d.ts +8 -0
- package/dist/cli/exec.d.ts.map +1 -0
- package/dist/cli/exec.js +53 -0
- package/dist/cli/exec.js.map +1 -0
- package/dist/cli/host.d.ts +35 -0
- package/dist/cli/host.d.ts.map +1 -0
- package/dist/cli/host.js +312 -0
- package/dist/cli/host.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +306 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/keygen.d.ts +9 -0
- package/dist/cli/keygen.d.ts.map +1 -0
- package/dist/cli/keygen.js +38 -0
- package/dist/cli/keygen.js.map +1 -0
- package/dist/cli/sftp.d.ts +9 -0
- package/dist/cli/sftp.d.ts.map +1 -0
- package/dist/cli/sftp.js +105 -0
- package/dist/cli/sftp.js.map +1 -0
- package/dist/cli/tunnel.d.ts +8 -0
- package/dist/cli/tunnel.d.ts.map +1 -0
- package/dist/cli/tunnel.js +79 -0
- package/dist/cli/tunnel.js.map +1 -0
- package/dist/cli/utils.d.ts +40 -0
- package/dist/cli/utils.d.ts.map +1 -0
- package/dist/cli/utils.js +115 -0
- package/dist/cli/utils.js.map +1 -0
- package/dist/core/client.d.ts +49 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +269 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/config.d.ts +101 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +617 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/exec.d.ts +25 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +88 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/keygen.d.ts +45 -0
- package/dist/core/keygen.d.ts.map +1 -0
- package/dist/core/keygen.js +233 -0
- package/dist/core/keygen.js.map +1 -0
- package/dist/core/known-hosts.d.ts +30 -0
- package/dist/core/known-hosts.d.ts.map +1 -0
- package/dist/core/known-hosts.js +201 -0
- package/dist/core/known-hosts.js.map +1 -0
- package/dist/core/session.d.ts +44 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +160 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/sftp.d.ts +80 -0
- package/dist/core/sftp.d.ts.map +1 -0
- package/dist/core/sftp.js +368 -0
- package/dist/core/sftp.js.map +1 -0
- package/dist/core/tunnel.d.ts +86 -0
- package/dist/core/tunnel.d.ts.map +1 -0
- package/dist/core/tunnel.js +405 -0
- package/dist/core/tunnel.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/skill/mcp-server.d.ts +4 -0
- package/dist/skill/mcp-server.d.ts.map +1 -0
- package/dist/skill/mcp-server.js +284 -0
- package/dist/skill/mcp-server.js.map +1 -0
- package/dist/skill/runner.d.ts +2 -0
- package/dist/skill/runner.d.ts.map +1 -0
- package/dist/skill/runner.js +97 -0
- package/dist/skill/runner.js.map +1 -0
- package/dist/skill/tools.d.ts +106 -0
- package/dist/skill/tools.d.ts.map +1 -0
- package/dist/skill/tools.js +218 -0
- package/dist/skill/tools.js.map +1 -0
- package/dist/tui/app.d.ts +29 -0
- package/dist/tui/app.d.ts.map +1 -0
- package/dist/tui/app.js +334 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/form.d.ts +20 -0
- package/dist/tui/form.d.ts.map +1 -0
- package/dist/tui/form.js +132 -0
- package/dist/tui/form.js.map +1 -0
- package/dist/tui/index.d.ts +4 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +6 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/screen.d.ts +24 -0
- package/dist/tui/screen.d.ts.map +1 -0
- package/dist/tui/screen.js +134 -0
- package/dist/tui/screen.js.map +1 -0
- package/dist/tui/screens/hosts.d.ts +40 -0
- package/dist/tui/screens/hosts.d.ts.map +1 -0
- package/dist/tui/screens/hosts.js +272 -0
- package/dist/tui/screens/hosts.js.map +1 -0
- package/dist/tui/theme.d.ts +15 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +57 -0
- package/dist/tui/theme.js.map +1 -0
- package/package.json +51 -4
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { HostProfile } from '../core/config.js';
|
|
2
|
+
export interface HostListCliOptions {
|
|
3
|
+
json?: boolean;
|
|
4
|
+
tag?: string;
|
|
5
|
+
search?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function runHostList(options?: HostListCliOptions): Promise<void>;
|
|
8
|
+
export interface HostAddCliOptions extends Partial<HostProfile> {
|
|
9
|
+
user?: string;
|
|
10
|
+
yes?: boolean;
|
|
11
|
+
force?: boolean;
|
|
12
|
+
identity?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function runHostAdd(options?: HostAddCliOptions): Promise<void>;
|
|
15
|
+
export interface HostEditCliOptions extends Partial<HostProfile> {
|
|
16
|
+
user?: string;
|
|
17
|
+
identity?: string;
|
|
18
|
+
jump?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function printHostNotFound(idOrName: string): void;
|
|
21
|
+
export declare function runHostEdit(idOrName: string, options?: HostEditCliOptions): Promise<void>;
|
|
22
|
+
export declare function runHostRemove(idOrName: string, options?: {
|
|
23
|
+
force?: boolean;
|
|
24
|
+
yes?: boolean;
|
|
25
|
+
}): Promise<void>;
|
|
26
|
+
export declare function runHostShow(idOrName: string, options?: {
|
|
27
|
+
json?: boolean;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
export declare function runHostExport(filePath?: string): Promise<void>;
|
|
30
|
+
export declare function runHostImport(filePath: string, options?: {
|
|
31
|
+
overwrite?: boolean;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
export declare function runHostTest(idOrName: string): Promise<void>;
|
|
34
|
+
export declare function runHostImportSshConfig(customPath?: string): Promise<void>;
|
|
35
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/cli/host.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,WAAW,EAAuB,MAAM,mBAAmB,CAAC;AAI3F,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCjF;AAED,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAAC,WAAW,CAAC;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkF/E;AAED,MAAM,WAAW,kBAAmB,SAAQ,OAAO,CAAC,WAAW,CAAC;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAaxD;AAED,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+EnG;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBrH;AAED,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCnG;AAED,wBAAsB,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOpE;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ1G;AAED,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBjE;AAED,wBAAsB,sBAAsB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO/E"}
|
package/dist/cli/host.js
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { defaultConfigManager, resolvePortablePath } from '../core/config.js';
|
|
2
|
+
import { SSHConnection } from '../core/client.js';
|
|
3
|
+
import { colors, prompt, renderTable } from './utils.js';
|
|
4
|
+
export async function runHostList(options = {}) {
|
|
5
|
+
let hosts = defaultConfigManager.getHosts();
|
|
6
|
+
if (options.tag) {
|
|
7
|
+
const filterTag = options.tag.toLowerCase();
|
|
8
|
+
hosts = hosts.filter(h => (h.tags || []).some(t => t.toLowerCase() === filterTag));
|
|
9
|
+
}
|
|
10
|
+
if (options.search) {
|
|
11
|
+
const q = options.search.toLowerCase();
|
|
12
|
+
hosts = hosts.filter(h => h.name.toLowerCase().includes(q) ||
|
|
13
|
+
h.host.toLowerCase().includes(q) ||
|
|
14
|
+
h.username.toLowerCase().includes(q) ||
|
|
15
|
+
(h.notes && h.notes.toLowerCase().includes(q)) ||
|
|
16
|
+
(h.tags && h.tags.some(t => t.toLowerCase().includes(q))));
|
|
17
|
+
}
|
|
18
|
+
if (options.json) {
|
|
19
|
+
process.stdout.write(JSON.stringify(hosts, null, 2) + '\n');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (hosts.length === 0) {
|
|
23
|
+
process.stdout.write(`${colors.dim}No saved hosts found matching your criteria. Use 'sshx host add' or 'sshx host import-ssh-config' to add one.${colors.reset}\n`);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const rows = hosts.map(h => [
|
|
27
|
+
h.name,
|
|
28
|
+
`${h.username}@${h.host}:${h.port}`,
|
|
29
|
+
h.authType,
|
|
30
|
+
(h.tags || []).join(', ') || '-',
|
|
31
|
+
h.lastConnected ? new Date(h.lastConnected).toLocaleDateString() : 'Never'
|
|
32
|
+
]);
|
|
33
|
+
process.stdout.write(renderTable(['Name', 'Address', 'Auth', 'Tags', 'Last Connected'], rows) + '\n');
|
|
34
|
+
}
|
|
35
|
+
export async function runHostAdd(options = {}) {
|
|
36
|
+
const isInteractive = process.stdin.isTTY && !options.name && !options.host;
|
|
37
|
+
let name = options.name;
|
|
38
|
+
let host = options.host;
|
|
39
|
+
let username = options.username || options.user;
|
|
40
|
+
let port = options.port !== undefined ? Number(options.port) : undefined;
|
|
41
|
+
let authType = options.authType;
|
|
42
|
+
let password = options.password;
|
|
43
|
+
let privateKeyPath = options.privateKeyPath || options.identity;
|
|
44
|
+
let tags = options.tags;
|
|
45
|
+
let notes = options.notes;
|
|
46
|
+
if (isInteractive) {
|
|
47
|
+
process.stdout.write(`${colors.bold}${colors.cyan}=== Add New SSH Host Profile ===${colors.reset}\n`);
|
|
48
|
+
name = await prompt(`${colors.bold}Profile Name:${colors.reset} `);
|
|
49
|
+
while (!name) {
|
|
50
|
+
process.stdout.write(`${colors.red}Profile name is required.${colors.reset}\n`);
|
|
51
|
+
name = await prompt(`${colors.bold}Profile Name:${colors.reset} `);
|
|
52
|
+
}
|
|
53
|
+
host = await prompt(`${colors.bold}Hostname or IP:${colors.reset} `);
|
|
54
|
+
while (!host) {
|
|
55
|
+
process.stdout.write(`${colors.red}Hostname or IP is required.${colors.reset}\n`);
|
|
56
|
+
host = await prompt(`${colors.bold}Hostname or IP:${colors.reset} `);
|
|
57
|
+
}
|
|
58
|
+
const userAns = await prompt(`${colors.bold}Username (default: root):${colors.reset} `);
|
|
59
|
+
username = userAns.trim() || 'root';
|
|
60
|
+
const portAns = await prompt(`${colors.bold}Port (default: 22):${colors.reset} `);
|
|
61
|
+
port = parseInt(portAns, 10) || 22;
|
|
62
|
+
const authChoice = await prompt(`${colors.bold}Auth method [1=Key, 2=Password] (default: 1):${colors.reset} `);
|
|
63
|
+
authType = authChoice.trim() === '2' ? 'password' : 'privateKey';
|
|
64
|
+
if (authType === 'password') {
|
|
65
|
+
password = await prompt(`${colors.bold}Password:${colors.reset} `, true);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const keyAns = await prompt(`${colors.bold}Private key path (default: ~/.ssh/id_ed25519):${colors.reset} `);
|
|
69
|
+
privateKeyPath = keyAns.trim() || '~/.ssh/id_ed25519';
|
|
70
|
+
}
|
|
71
|
+
const tagsAns = await prompt(`${colors.bold}Tags (comma separated, e.g. prod,aws):${colors.reset} `);
|
|
72
|
+
tags = tagsAns.split(',').map(s => s.trim()).filter(Boolean);
|
|
73
|
+
const notesAns = await prompt(`${colors.bold}Notes (optional):${colors.reset} `);
|
|
74
|
+
notes = notesAns.trim() || undefined;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// Non-interactive fallback
|
|
78
|
+
if (!name || !host) {
|
|
79
|
+
process.stderr.write(`${colors.red}Error: Both --name and --host must be specified.${colors.reset}\n`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
username = username || 'root';
|
|
83
|
+
port = port !== undefined ? Number(port) : 22;
|
|
84
|
+
authType = authType || (password ? 'password' : (privateKeyPath ? 'privateKey' : 'password'));
|
|
85
|
+
}
|
|
86
|
+
// Check if profile with same name already exists
|
|
87
|
+
const existing = defaultConfigManager.getHost(name);
|
|
88
|
+
if (existing && !options.force && isInteractive) {
|
|
89
|
+
const overwrite = await prompt(`${colors.yellow}Host '${name}' already exists. Overwrite? [y/N]: ${colors.reset}`);
|
|
90
|
+
if (overwrite.toLowerCase() !== 'y' && overwrite.toLowerCase() !== 'yes') {
|
|
91
|
+
process.stdout.write(`${colors.dim}Operation cancelled.${colors.reset}\n`);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const newProfile = defaultConfigManager.addHost({
|
|
96
|
+
name,
|
|
97
|
+
host,
|
|
98
|
+
username,
|
|
99
|
+
port,
|
|
100
|
+
authType,
|
|
101
|
+
password,
|
|
102
|
+
privateKeyPath,
|
|
103
|
+
tags: tags || [],
|
|
104
|
+
notes
|
|
105
|
+
});
|
|
106
|
+
process.stdout.write(`${colors.green}✓ Saved host profile '${newProfile.name}' (${newProfile.id})${colors.reset}\n`);
|
|
107
|
+
}
|
|
108
|
+
export function printHostNotFound(idOrName) {
|
|
109
|
+
process.stderr.write(`${colors.red}Error: Host profile '${idOrName}' not found.${colors.reset}\n`);
|
|
110
|
+
const suggestions = defaultConfigManager.suggestHosts(idOrName);
|
|
111
|
+
if (suggestions.length > 0) {
|
|
112
|
+
process.stderr.write(`\n${colors.yellow}Did you mean one of these?${colors.reset}\n`);
|
|
113
|
+
for (const s of suggestions) {
|
|
114
|
+
process.stderr.write(` ${colors.cyan}• ${s.name}${colors.reset} (${s.username}@${s.host}:${s.port})\n`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const all = defaultConfigManager.getHosts();
|
|
118
|
+
if (all.length > 0) {
|
|
119
|
+
process.stderr.write(`\nRun '${colors.bold}sshx host list${colors.reset}' to view all saved host profiles.\n`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export async function runHostEdit(idOrName, options = {}) {
|
|
123
|
+
const current = defaultConfigManager.getHost(idOrName);
|
|
124
|
+
if (!current) {
|
|
125
|
+
printHostNotFound(idOrName);
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
const hasFlags = options.name !== undefined ||
|
|
129
|
+
options.host !== undefined ||
|
|
130
|
+
options.port !== undefined ||
|
|
131
|
+
options.username !== undefined ||
|
|
132
|
+
options.user !== undefined ||
|
|
133
|
+
options.authType !== undefined ||
|
|
134
|
+
options.password !== undefined ||
|
|
135
|
+
options.privateKeyPath !== undefined ||
|
|
136
|
+
options.identity !== undefined ||
|
|
137
|
+
options.tags !== undefined ||
|
|
138
|
+
options.notes !== undefined ||
|
|
139
|
+
options.jump !== undefined;
|
|
140
|
+
let updates = {};
|
|
141
|
+
if (hasFlags) {
|
|
142
|
+
if (options.name !== undefined)
|
|
143
|
+
updates.name = options.name;
|
|
144
|
+
if (options.host !== undefined)
|
|
145
|
+
updates.host = options.host;
|
|
146
|
+
if (options.port !== undefined)
|
|
147
|
+
updates.port = Number(options.port);
|
|
148
|
+
if (options.username !== undefined || options.user !== undefined)
|
|
149
|
+
updates.username = options.username || options.user;
|
|
150
|
+
if (options.authType !== undefined)
|
|
151
|
+
updates.authType = options.authType;
|
|
152
|
+
if (options.password !== undefined)
|
|
153
|
+
updates.password = options.password;
|
|
154
|
+
if (options.privateKeyPath !== undefined)
|
|
155
|
+
updates.privateKeyPath = options.privateKeyPath;
|
|
156
|
+
if (options.identity !== undefined)
|
|
157
|
+
updates.privateKeyPath = options.identity;
|
|
158
|
+
if (options.tags !== undefined)
|
|
159
|
+
updates.tags = options.tags;
|
|
160
|
+
if (options.notes !== undefined)
|
|
161
|
+
updates.notes = options.notes;
|
|
162
|
+
if (options.jump !== undefined)
|
|
163
|
+
updates.proxyJump = options.jump;
|
|
164
|
+
}
|
|
165
|
+
else if (process.stdin.isTTY) {
|
|
166
|
+
// Interactive edit wizard
|
|
167
|
+
process.stdout.write(`${colors.bold}${colors.cyan}=== Edit Host Profile: ${current.name} ===${colors.reset}\n`);
|
|
168
|
+
process.stdout.write(`${colors.dim}Press Enter to keep current value.${colors.reset}\n\n`);
|
|
169
|
+
const nameAns = await prompt(`${colors.bold}Profile Name [${current.name}]:${colors.reset} `);
|
|
170
|
+
if (nameAns.trim())
|
|
171
|
+
updates.name = nameAns.trim();
|
|
172
|
+
const hostAns = await prompt(`${colors.bold}Hostname or IP [${current.host}]:${colors.reset} `);
|
|
173
|
+
if (hostAns.trim())
|
|
174
|
+
updates.host = hostAns.trim();
|
|
175
|
+
const userAns = await prompt(`${colors.bold}Username [${current.username}]:${colors.reset} `);
|
|
176
|
+
if (userAns.trim())
|
|
177
|
+
updates.username = userAns.trim();
|
|
178
|
+
const portAns = await prompt(`${colors.bold}Port [${current.port}]:${colors.reset} `);
|
|
179
|
+
if (portAns.trim())
|
|
180
|
+
updates.port = parseInt(portAns.trim(), 10) || current.port;
|
|
181
|
+
const authChoice = await prompt(`${colors.bold}Auth method [1=Key, 2=Password] [current: ${current.authType}]:${colors.reset} `);
|
|
182
|
+
if (authChoice.trim() === '1') {
|
|
183
|
+
updates.authType = 'privateKey';
|
|
184
|
+
const keyAns = await prompt(`${colors.bold}Private key path [${current.privateKeyPath || '~/.ssh/id_ed25519'}]:${colors.reset} `);
|
|
185
|
+
updates.privateKeyPath = keyAns.trim() || current.privateKeyPath || '~/.ssh/id_ed25519';
|
|
186
|
+
}
|
|
187
|
+
else if (authChoice.trim() === '2') {
|
|
188
|
+
updates.authType = 'password';
|
|
189
|
+
const passAns = await prompt(`${colors.bold}New Password (leave empty to keep):${colors.reset} `, true);
|
|
190
|
+
if (passAns)
|
|
191
|
+
updates.password = passAns;
|
|
192
|
+
}
|
|
193
|
+
const currentTags = (current.tags || []).join(', ');
|
|
194
|
+
const tagsAns = await prompt(`${colors.bold}Tags [${currentTags || 'none'}]:${colors.reset} `);
|
|
195
|
+
if (tagsAns.trim()) {
|
|
196
|
+
updates.tags = tagsAns.split(',').map(s => s.trim()).filter(Boolean);
|
|
197
|
+
}
|
|
198
|
+
const notesAns = await prompt(`${colors.bold}Notes [${current.notes || 'none'}]:${colors.reset} `);
|
|
199
|
+
if (notesAns.trim())
|
|
200
|
+
updates.notes = notesAns.trim();
|
|
201
|
+
}
|
|
202
|
+
const updated = defaultConfigManager.updateHost(current.id, updates);
|
|
203
|
+
if (updated) {
|
|
204
|
+
process.stdout.write(`${colors.green}✓ Successfully updated host profile '${updated.name}' (${updated.id})${colors.reset}\n`);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
process.stderr.write(`${colors.red}Failed to update host profile.${colors.reset}\n`);
|
|
208
|
+
process.exit(1);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
export async function runHostRemove(idOrName, options = {}) {
|
|
212
|
+
const profile = defaultConfigManager.getHost(idOrName);
|
|
213
|
+
if (!profile) {
|
|
214
|
+
printHostNotFound(idOrName);
|
|
215
|
+
process.exit(1);
|
|
216
|
+
}
|
|
217
|
+
const skipConfirm = options.force || options.yes;
|
|
218
|
+
if (!skipConfirm && process.stdin.isTTY) {
|
|
219
|
+
const confirm = await prompt(`${colors.yellow}Are you sure you want to remove host '${profile.name}' (${profile.username}@${profile.host})? [y/N]: ${colors.reset}`);
|
|
220
|
+
if (confirm.toLowerCase() !== 'y' && confirm.toLowerCase() !== 'yes') {
|
|
221
|
+
process.stdout.write(`${colors.dim}Operation cancelled.${colors.reset}\n`);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const success = defaultConfigManager.deleteHost(profile.id);
|
|
226
|
+
if (success) {
|
|
227
|
+
process.stdout.write(`${colors.green}✓ Removed host profile '${profile.name}'${colors.reset}\n`);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
process.stderr.write(`${colors.red}Failed to remove host profile '${idOrName}'.${colors.reset}\n`);
|
|
231
|
+
process.exit(1);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
export async function runHostShow(idOrName, options = {}) {
|
|
235
|
+
const profile = defaultConfigManager.getHost(idOrName);
|
|
236
|
+
if (!profile) {
|
|
237
|
+
printHostNotFound(idOrName);
|
|
238
|
+
process.exit(1);
|
|
239
|
+
}
|
|
240
|
+
if (options.json) {
|
|
241
|
+
process.stdout.write(JSON.stringify(profile, null, 2) + '\n');
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
process.stdout.write(`\n${colors.bold}${colors.cyan}Host Profile Details: ${profile.name}${colors.reset}\n`);
|
|
245
|
+
process.stdout.write(`${'─'.repeat(45)}\n`);
|
|
246
|
+
process.stdout.write(` ${colors.bold}ID:${colors.reset} ${profile.id}\n`);
|
|
247
|
+
process.stdout.write(` ${colors.bold}Name:${colors.reset} ${profile.name}\n`);
|
|
248
|
+
process.stdout.write(` ${colors.bold}Address:${colors.reset} ${profile.username}@${profile.host}:${profile.port}\n`);
|
|
249
|
+
process.stdout.write(` ${colors.bold}Auth Method:${colors.reset} ${profile.authType}\n`);
|
|
250
|
+
if (profile.privateKeyPath) {
|
|
251
|
+
const resolved = resolvePortablePath(profile.privateKeyPath, defaultConfigManager.getConfigDir());
|
|
252
|
+
process.stdout.write(` ${colors.bold}Key Path:${colors.reset} ${profile.privateKeyPath}\n`);
|
|
253
|
+
if (resolved !== profile.privateKeyPath) {
|
|
254
|
+
process.stdout.write(` ${colors.bold}Key (Resolved):${colors.reset} ${resolved}\n`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (profile.proxyJump) {
|
|
258
|
+
process.stdout.write(` ${colors.bold}Jump Host:${colors.reset} ${profile.proxyJump}\n`);
|
|
259
|
+
}
|
|
260
|
+
if (profile.proxyCommand) {
|
|
261
|
+
process.stdout.write(` ${colors.bold}ProxyCommand:${colors.reset} ${profile.proxyCommand}\n`);
|
|
262
|
+
}
|
|
263
|
+
process.stdout.write(` ${colors.bold}Tags:${colors.reset} ${(profile.tags || []).join(', ') || '-'}\n`);
|
|
264
|
+
if (profile.notes) {
|
|
265
|
+
process.stdout.write(` ${colors.bold}Notes:${colors.reset} ${profile.notes}\n`);
|
|
266
|
+
}
|
|
267
|
+
process.stdout.write(` ${colors.bold}Last Connected:${colors.reset} ${profile.lastConnected ? new Date(profile.lastConnected).toLocaleString() : 'Never'}\n\n`);
|
|
268
|
+
}
|
|
269
|
+
export async function runHostExport(filePath) {
|
|
270
|
+
const jsonStr = defaultConfigManager.exportHosts(filePath);
|
|
271
|
+
if (filePath) {
|
|
272
|
+
process.stdout.write(`${colors.green}✓ Successfully exported host profiles to '${filePath}'.${colors.reset}\n`);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
process.stdout.write(jsonStr + '\n');
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
export async function runHostImport(filePath, options = {}) {
|
|
279
|
+
try {
|
|
280
|
+
const res = defaultConfigManager.importHosts(filePath, options.overwrite ? 'overwrite' : 'merge');
|
|
281
|
+
process.stdout.write(`${colors.green}✓ Successfully imported hosts: ${res.imported} new, ${res.updated} updated (Total: ${res.total})${colors.reset}\n`);
|
|
282
|
+
}
|
|
283
|
+
catch (err) {
|
|
284
|
+
process.stderr.write(`${colors.red}Import failed: ${err.message || String(err)}${colors.reset}\n`);
|
|
285
|
+
process.exit(1);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
export async function runHostTest(idOrName) {
|
|
289
|
+
const profile = defaultConfigManager.getHost(idOrName);
|
|
290
|
+
if (!profile) {
|
|
291
|
+
printHostNotFound(idOrName);
|
|
292
|
+
process.exit(1);
|
|
293
|
+
}
|
|
294
|
+
process.stdout.write(`Testing connection to ${profile.name} (${profile.username}@${profile.host}:${profile.port})...\n`);
|
|
295
|
+
const res = await SSHConnection.testLatency(profile);
|
|
296
|
+
if (res.success) {
|
|
297
|
+
process.stdout.write(`${colors.green}✓ Connection successful! Latency: ${res.latencyMs}ms${colors.reset}\n`);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
process.stderr.write(`${colors.red}✗ Connection failed: ${res.error}${colors.reset}\n`);
|
|
301
|
+
process.exit(1);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
export async function runHostImportSshConfig(customPath) {
|
|
305
|
+
process.stdout.write(`Importing OpenSSH configuration...\n`);
|
|
306
|
+
const imported = defaultConfigManager.importOpenSSHConfig(customPath);
|
|
307
|
+
process.stdout.write(`${colors.green}✓ Successfully imported ${imported.length} host profiles.${colors.reset}\n`);
|
|
308
|
+
for (const h of imported) {
|
|
309
|
+
process.stdout.write(` - ${h.name} (${h.username}@${h.host}:${h.port})\n`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/cli/host.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAe,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAQzD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAO,GAAuB,EAAE;IAChE,IAAI,KAAK,GAAG,oBAAoB,CAAC,QAAQ,EAAE,CAAC;IAE5C,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QAC5C,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC;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