Display the contents of a file from the session image.
Examples
# View a text file
contree cat /etc/os-release
# Pipe to another command
contree cat /var/log/app.log | grep ERROR
# Redirect to a local file
contree cat /etc/nginx/nginx.conf > nginx.conf
Help output
usage: contree cat [-h] path
Show file content from the session image.
Downloads and displays a file from the current session image via the
/inspect/ API without spawning an instance. Binary files are refused
when stdout is a terminal — use shell redirection or `contree cp` to
save them locally.
Results are cached per (image, path) so repeated reads are instant.
positional arguments:
path Path inside image
options:
-h, —help show this help message and exit
for coding agents:
read-only command (inspect API, no instance spawn)
binary output is blocked on interactive TTY; pipe or use cp for binaries
—format is ignored; output is raw file content
agent note:
Before using this command in an automated workflow, read:
contree agent
Behavior
The file is read directly from the image – no sandbox is started.
Binary files are detected and refused when output is a terminal (to protect
your shell). Redirect to a file or pipe to another command to handle binary
content:
contree cat /usr/bin/curl > curl
For downloading files to a specific local path, use cp - Download a file from the image instead.
See also