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

# cp - Download a file from the image

Download a file from the session image to a local path.

## Examples

```bash theme={null}
# Copy a config file locally
contree cp /etc/nginx/nginx.conf ./nginx.conf

# Download a build artifact
contree cp /app/dist/output.tar.gz ./output.tar.gz
```

## 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 cp --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 cp</span><span style={{"color":"#c5c8c6"}}> \[</span><span style={{"color":"#98c379"}}>-h</span><span style={{"color":"#c5c8c6"}}>] </span><span style={{"color":"#98c379"}}>path</span><span style={{"color":"#c5c8c6"}}> </span><span style={{"color":"#98c379"}}>dest</span><br /><br /><span style={{"color":"#c5c8c6"}}>Copy a file from the session image to a local path.</span><br /><br /><span style={{"color":"#c5c8c6"}}>Downloads the file at PATH inside the current session image and writes</span><br /><span style={{"color":"#c5c8c6"}}>it to DEST on the local filesystem. Progress is logged for large files.</span><br /><span style={{"color":"#c5c8c6"}}>Unlike \`cat\`, this command handles binary content and does not require</span><br /><span style={{"color":"#c5c8c6"}}>a terminal.</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 /><span style={{"color":"#c5c8c6"}}>  </span><span style={{"color":"#98c379","fontWeight":"bold"}}>dest</span><span style={{"color":"#c5c8c6"}}>        Local destination path</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 against remote image, writes local file DEST</span><br /><span style={{"color":"#c5c8c6"}}>  suitable for binary files</span><br /><span style={{"color":"#c5c8c6"}}>  --format is ignored; command writes bytes directly</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 streamed from the image directly – no sandbox is started.

For large files, progress is logged every 5 seconds with download speed
and ETA. The final log line shows total size and average speed.

## See also

* [ls - List files in the image](./ls) – list files to find the path
* [cat - Show file content from the image](./cat) – view file contents without downloading
* [Your First Sandbox](../tutorial/first-steps) – downloading files
