ssh_view
List remote directories or read file contents over SSH, including metadata and paging for large files.
Instructions
Read a remote file or list a remote directory over SSH — the remote counterpart of the local file-viewing tool. For a file, returns its content plus 'size_bytes' and 'total_lines'. Content is truncated at 20KB by default when 'view_range' isn't given and 'force_read_large_files' isn't set; use 'view_range' to page through large files instead. For a directory, returns non-hidden entries up to 2 levels deep.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute (or login-directory-relative) remote path to a file or directory. | |
| port | No | ||
| target | Yes | OpenSSH target such as host, alias, or user@host. | |
| timeout | No | Local timeout in seconds. | |
| max_bytes | No | Truncation cutoff in bytes for the default (no view_range, no force) read. Default: 20480 (20KB). | |
| view_range | No | Optional [start_line, end_line] (1-based, inclusive). Use end_line -1 for 'to end of file'. Bypasses the 20KB truncation cutoff. | |
| identity_file | No | ||
| extra_ssh_args | No | Additional ssh(1) flags passed verbatim, e.g. ["-J", "jumphost"]. Prefer the dedicated port, identity_file, and strict_host_key_checking parameters. | |
| known_hosts_file | No | ||
| force_read_large_files | No | Read the full file even if it exceeds the truncation cutoff. Ignored when 'view_range' is given. Default: false. | |
| strict_host_key_checking | No | Boolean or one of yes, no, ask, accept-new, off. |