Skip to content
FunCoding

get_files

在指定路径下搜索文件并返回路径列表,支持按后缀、子目录、层级过滤。当用户提到获取文件列表、查找某类文件、列出所有文件时使用。

Star
1,359
Category
Other
License
Apache-2.0
Last commit
Aug 20, 2026

skills/file/get_files/SKILL.md

View on GitHub

get_files Skill

搜索当前路径下所有指定类型的文件,并以列表形式返回

功能描述

在指定路径下搜索文件,支持按文件名、后缀、子目录等条件过滤,返回文件路径列表。

所属分类

office/skills/file/get_files/

调用方式

from skills.file import get_files

files = get_files(
    path='./data',
    name='report',
    suffix='.txt',
    sub=False,
    level=0
)

参数说明

参数类型必填默认值说明
pathstr是-路径
namestr否''文件名
suffixstr否None文件后缀
subbool否False是否搜索子目录
levelint否0搜索层级

返回值

list:文件路径列表

使用示例

from skills.file import get_files
# 获取所有 .txt 文件
txt_files = get_files(path='./docs', suffix='.txt', sub=True)
# 获取所有名为 report 的文件
reports = get_files(path='./data', name='report', sub=True)

原始函数

office.api.file.get_files

Similar Skills

claude-handoff

MAmattpocock/skills288k10,178 new stars in the last 7 days

agent-payment-x402

AFaffaan-m/ECC278k4,046 new stars in the last 7 days

agent-self-evaluation

AFaffaan-m/ECC278k4,046 new stars in the last 7 days

bengali-nlp

AFaffaan-m/ECC278k4,046 new stars in the last 7 days

ponytail-gain

DIDietrichGebert/ponytail162k5,405 new stars in the last 7 days

Featured

ponytail-debt

Scan shortcut comments, build a debt ledger, flag items without an upgrade path.

DIDietrichGebert/ponytail162k5,405 new stars in the last 7 days