# List Files

> List files in Directus with optional folder or type filter Arguments: [--folder <name>] [--type <mime-prefix>].

- Skill: `agents-store/list-files` (Agent Skill)
- Install (CLI): `npx get-skill add agents-store/list-files`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agents-store/list-files/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: agents-store (https://skillmd.com/u/agents-store)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/agents-store/list-files

---


# List Files

Follow the `file-management` skill (`${CLAUDE_PLUGIN_ROOT}/skills/file-management/SKILL.md`) for the files, folders and asset tools; read it before the first call.

## Arguments

- `--folder <name>` — Filter by folder name
- `--type <mime-prefix>` — Filter by MIME type prefix (e.g., `image`, `application/pdf`)

## Process

1. If `--folder` provided:
   - Call `folders` tool with `action: "read"` to find folder UUID by name
   - Use folder UUID in file filter

2. Build file query:
   ```json
   {
     "action": "read",
     "query": {
       "fields": ["id", "title", "filename_download", "type", "filesize", "width", "height", "folder.name"],
       "filter": {},
       "sort": ["-uploaded_on"],
       "limit": 25
     }
   }
   ```
   - Add folder filter: `{ "folder": { "_eq": "<uuid>" } }`
   - Add type filter: `{ "type": { "_starts_with": "<prefix>/" } }`

3. Call `files` tool with the query
4. Display as table: title, filename, type, size, dimensions, folder
5. Format filesize as human-readable (KB, MB)

## Example

Input: `--type image --folder Products`

Lists all image files in the "Products" folder.
