copy-files
Copies named files between SSH hosts or from a Windows share while leaving existing files untouched unless overwrite is enabled; supports optional age encryption.
Instructions
dbabrain common.cli copy-files: Named files copied from one host to another, removing nothing - a repository copy.
Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line.
Request fields (pass them as request):
files: The files, each {source, target, file_name, size_bytes, sha256} - all five required (0.37.0): source as the source host (or the share) names it, target an absolute path on the target host (a drive path on a windows ta...
overwrite (required): false: a target name that already holds a file is left exactly as it is (the source is not read, the line fails saying so), and a copy lands only by a rename that refuses an existing name. true: the target name is rep...
source: The SSH host the files are on: {host, port, username, password|key_file}. Or give source_share.
source_share: Instead of source: a Windows share {host, share, username, password, domain?}, read with smbclient (or the UNC path on a Windows node); each file's source is then its path under the share.
target: The SSH host the files go to: {host, port, username, password|key_file, platform}. Nothing there is ever removed but this copy's own partial file. platform windows (0.39.0): a Windows OpenSSH host - each file written ...
timeout_seconds: Seconds the whole command may take; default 21600. A read or write that stalls for 300 s gives up its file, not the command.
stall_seconds: Seconds one read or write may stop moving before its file is given up; default 300.
transfer (required): How the bytes travel over SSH: cat (a plain cat channel with a large window, the source read ahead in a thread) or sftp (paramiko SFTP, read ahead and pipelined). Required - never assumed (0.37.0).
encrypt: Encrypt on the way (0.38.0, 1.330): {recipients: [age1... public keys], key_id, key_expires_at}. Each file lands as .age and its plain bytes never reach the target; they are held to the line's size_bytes and s...
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "copy-files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |