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

# List Files

> List files and directories in an agent runtime

```python theme={null}
from gravixlayer import GravixLayer

client = GravixLayer()
runtime = client.runtime.create(template="python-3.14-base-small")

listing = runtime.file.list("/workspace")

for item in listing.files:
    kind = "dir" if item.is_dir else "file"
    print(f"{item.name}  {kind}  {item.size} bytes")
    if item.permissions:
        print(f"  {item.permissions}")

runtime.kill()
```

## Parameters

| Parameter | Type   | Required | Description    |
| --------- | ------ | -------- | -------------- |
| `path`    | string | Yes      | Directory path |

## Response

Each entry in `listing.files`:

| Field         | Type    | Description                                   |
| ------------- | ------- | --------------------------------------------- |
| `name`        | string  | File or directory name                        |
| `path`        | string  | Full path when provided by the backend        |
| `size`        | integer | Size in bytes                                 |
| `is_dir`      | boolean | `True` if directory                           |
| `modified_at` | string  | Last modified timestamp                       |
| `mode`        | string  | Octal permission bits                         |
| `permissions` | string  | Human-readable permissions (e.g. `rw-r--r--`) |
