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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image | string | Yes | - | Image UUID or tag:name |
path | string | No | / | Directory path to list |
Returns
| Field | Type | Description |
|---|---|---|
path | string | Normalized path that was listed |
count | integer | Number of entries in listing |
files | array | List of file entries |
File Entry Fields
| Field | Type | Description |
|---|---|---|
name | string | File or directory name |
path | string | Full path within image |
type | string | file, directory, or symlink |
size | integer | Size in bytes |
mode | string | Octal permission mode (e.g., 0o755) |
target | string | Symlink target (only for symlinks) |
Cost
Free - No VM spawned. Reads directly from image filesystem.Examples
List Root Directory
List Specific Directory
Verify File Existence Before Running
Best Practices
- Prefer over
run("ls")-list_filesis 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