Skip to main content
List files and directories in a container image without spawning a VM.

Overview

list_files provides instant filesystem inspection without the overhead of starting a container. Use it to explore image contents, verify file existence, and check permissions before running commands.

Parameters

Returns

File Entry Fields

Cost

Free - No VM spawned. Reads directly from image filesystem.

Examples

List Root Directory

Response:

List Specific Directory

Verify File Existence Before Running

Best Practices

  • Prefer over run("ls") - list_files is instant and free
  • Verify paths before commands - Check files exist to avoid errors
  • Explore unfamiliar images - Understand structure before running code
  • Check permissions - Verify executable bits and ownership

See Also

  • read_file - Read file contents without VM
  • run - Execute commands (spawns VM)
  • Resources - contree://image/{image}/ls/{path} resource alternative