List files and directories in the session image without spawning a sandbox.
Examples
# List root directory
contree ls /
# List a specific directory
contree ls /etc/nginx
# JSON output with file metadata
contree -f json ls /usr/bin
Help output
usage: contree ls [-h] [path]
List files in the session image.
Uses the /inspect/ API to list directory contents without spawning an
instance. Defaults to the session working directory (set via `cd`).
In default format, the API returns a pre-formatted text listing. In
structured formats (json, csv, etc.) the response is cached per
(image, path) for instant repeat queries.
positional arguments:
path Path inside image (defaults to session cwd)
options:
-h, —help show this help message and exit
for coding agents:
read-only command (inspect API, no instance spawn)
defaults to session cwd when PATH is omitted
use -f json for cacheable structured listings
agent note:
Before using this command in an automated workflow, read:
contree agent
Output
Each entry shows path, size, permissions (octal), owner, group, modification
time, and type (d for directory, l for symlink, - for file).
This command reads the image filesystem directly – no sandbox is started and
no resources are consumed.
See also