uploadFile
Transfer a local file to a remote SSH host by specifying the host alias, local file path, and remote destination path.
Instructions
Uploads a local file to an SSH host
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hostAlias | Yes | Alias or hostname of the SSH host | |
| localPath | Yes | Path to the local file | |
| remotePath | Yes | Path on the remote host |
Implementation Reference
- src/ssh-client.ts:88-100 (handler)The handler function for the uploadFile tool, which uploads a local file to a remote SSH host using node-ssh's putFile method.async uploadFile(hostAlias: string, localPath: string, remotePath: string): Promise<boolean> { try { await this.connectToHost(hostAlias); await this.ssh.putFile(localPath, remotePath); this.ssh.dispose(); return true; } catch (error) { console.error(`Error uploading file to ${hostAlias}:`, error); return false; } }