> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenfactory.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# cat - Show file content from the image

Display the contents of a file from the session image.

## Examples

```bash theme={null}
# 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

<div className="contree-terminal" style={{"border":"1px solid rgba(255,255,255,0.15)","borderRadius":8,"overflow":"hidden","margin":"1rem 0"}}><div style={{"background":"#292929","height":24,"display":"flex","alignItems":"center","padding":"0 12px","position":"relative"}}><div style={{"display":"flex","alignItems":"center","flexShrink":0}}><span style={{"display":"inline-block","width":10,"height":10,"borderRadius":"50%","background":"#ff5f57","marginRight":6}} /><span style={{"display":"inline-block","width":10,"height":10,"borderRadius":"50%","background":"#febc2e","marginRight":6}} /><span style={{"display":"inline-block","width":10,"height":10,"borderRadius":"50%","background":"#28c840"}} /></div><div style={{"position":"absolute","left":0,"right":0,"textAlign":"center","fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif","fontWeight":"bold","color":"#999"}}>\$ contree cat --help</div></div><pre style={{"margin":0,"borderRadius":0,"padding":"8px 10px","background":"#1e1e1e","overflowX":"auto"}}><code style={{"fontFamily":"JetBrains Mono, SF Mono, SFMono-Regular, Menlo, Monaco, Cascadia Mono, Segoe UI Mono, Roboto Mono, Oxygen Mono, Ubuntu Monospace, Source Code Pro, Fira Mono, Droid Sans Mono, Consolas, Courier New, monospace","color":"#c5c8c6","whiteSpace":"pre-wrap"}}><span style={{"color":"#61afef","fontWeight":"bold"}}>usage: </span><span style={{"color":"#c678dd","fontWeight":"bold"}}>contree cat</span><span style={{"color":"#c5c8c6"}}> \[</span><span style={{"color":"#98c379"}}>-h</span><span style={{"color":"#c5c8c6"}}>] </span><span style={{"color":"#98c379"}}>path</span><br /><br /><span style={{"color":"#c5c8c6"}}>Show file content from the session image.</span><br /><br /><span style={{"color":"#c5c8c6"}}>Downloads and displays a file from the current session image via the</span><br /><span style={{"color":"#c5c8c6"}}>/inspect/ API without spawning an instance. Binary files are refused</span><br /><span style={{"color":"#c5c8c6"}}>when stdout is a terminal — use shell redirection or \`contree cp\` to</span><br /><span style={{"color":"#c5c8c6"}}>save them locally.</span><br /><br /><span style={{"color":"#c5c8c6"}}>Results are cached per (image, path) so repeated reads are instant.</span><br /><br /><span style={{"color":"#61afef","fontWeight":"bold"}}>positional arguments:</span><br /><span style={{"color":"#c5c8c6"}}>  </span><span style={{"color":"#98c379","fontWeight":"bold"}}>path</span><span style={{"color":"#c5c8c6"}}>        Path inside image</span><br /><br /><span style={{"color":"#61afef","fontWeight":"bold"}}>options:</span><br /><span style={{"color":"#c5c8c6"}}>  </span><span style={{"color":"#98c379","fontWeight":"bold"}}>-h</span><span style={{"color":"#c5c8c6"}}>, </span><span style={{"color":"#56b6c2","fontWeight":"bold"}}>--help</span><span style={{"color":"#c5c8c6"}}>  show this help message and exit</span><br /><br /><span style={{"color":"#c5c8c6"}}>for coding agents:</span><br /><span style={{"color":"#c5c8c6"}}>  read-only command (inspect API, no instance spawn)</span><br /><span style={{"color":"#c5c8c6"}}>  binary output is blocked on interactive TTY; pipe or use cp for binaries</span><br /><span style={{"color":"#c5c8c6"}}>  --format is ignored; output is raw file content</span><br /><br /><span style={{"color":"#c5c8c6"}}>agent note:</span><br /><span style={{"color":"#c5c8c6"}}>  Before using this command in an automated workflow, read:</span><br /><span style={{"color":"#c5c8c6"}}>    contree agent</span></code></pre></div>

## 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:

```bash theme={null}
contree cat /usr/bin/curl > curl
```

For downloading files to a specific local path, use [cp - Download a file from the image](./cp) instead.

## See also

* [ls - List files in the image](./ls) – list files before viewing
* [cp - Download a file from the image](./cp) – download to a local path with progress
