Recipe searching for files

From Files-com/files-cli · View interactive version

Recipe searching for files is an AI agent skill from the GitHub repository Files-com/files-cli. Find files and folders on Files.com effectively, and pick the right tool for the job; use this when the user wants to locate files by name, path, modified time, or custom metadata. The key distinction: the `--search` / `--search-all` flags on `folders list-for` are the web search bar — best-effort,

How to use this skill

Skill file

recipe-searching-for-files

There are two ways to find files on Files.com, and choosing the wrong one is the usual mistake. Name search (--search / --search-all) is the web UI's search bar exposed through the API: convenient for a person, but a best-effort index that lags reality. Direct folder listing (folders list-for) is exact and current. Match the tool to whether a human or an automated process is consuming the result.

When to use this skill

Ad-hoc human search — `--search` and `--search-all`

These are the same engine as the web UI's "Search This Folder" and "Search All Files" boxes.

Search within a folder (and its subfolders — name search is recursive):

files-cli folders list-for "/projects" --search="invoice" --format=json

Search the entire site (do not pass a path; use an empty path with --search-all):

files-cli folders list-for "" --search="invoice" --search-all=true --format=json

What to know about this search:

Search by custom metadata

Pair --search-custom-metadata-key with --search to match a metadata value (this is non-recursive — current folder only). Set the key to * to match the value against any metadata key:

files-cli folders list-for "/projects" --search="active" --search-custom-metadata-key="status" --format=json

Precise or automated lookup — `folders list-for`

For anything an automated process depends on, or when you need an exact, current answer, list the folder directly and filter. This reflects the true current state of the folder.

Return only files, or only folders, with --type:

files-cli folders list-for "/projects" --type=file --format=json

Sort by name, size, or modified time (--sort-by takes field=asc or field=desc; valid fields are path, size, modified_at_datetime, provided_modified_at):

files-cli folders list-for "/projects" --type=file --sort-by=modified_at_datetime=desc --format=json

Return only items modified after a given time (--modified-at-datetime must be combined with --type):

files-cli folders list-for "/projects" --type=file --modified-at-datetime=2026-01-01T00:00:00Z --format=json

Listings are paginated, and --format=json alone fetches every page. To read a large folder a page at a time, add --json-envelope --per-page=N and pass the returned next_cursor back with --cursor while has_more is true (see files-cli workflows show context). To search a subtree deterministically, list each folder you care about; descend only into the folders you actually need rather than walking the entire tree.

Anti-patterns

Related skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.