360 Secure SkillHub
360 安全技能中心

Simple File Tree

该 Skill 通过 find、sort、sed 命令展示文件夹的目录树结构,支持指定目录路径和可能的深度参数,输出缩进文本形式的文件与子目录列表。需要 Bash 环境,依赖 find、sort、sed 二进制。不修改文件系统,不读取文件内容。

jinwangmok
jinwangmok
热度 51.69
最近更新 2026-05-11 17:37:41
分类:效率依赖:代码执行 / 读写文件应用场景:自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add simple-file-tree
Metadata
name
file-tree
version
1.0.0
description
Show the directory tree structure of a folder. Displays files and subdirectories in a visual tree format. Use when the user wants to see what files are in a folder.
allowed-tools
Bash(find:*)
metadata
{"openclaw":{"emoji":"🌳","requires":{"bins":["find","sort","sed"],"env":[]},"install":[]}}

File Tree

Show the directory tree structure of any folder with a single command.

Usage

find <DIR_PATH> -maxdepth 3 | sort | sed 's|[^/]*/|  |g'

Arguments:

# Name Description
1 DIR_PATH Path to the directory to display

Example

find /home/user/project -maxdepth 3 | sort | sed 's|[^/]*/|  |g'

Output:

  project
    src
      main.py
      utils.py
    README.md

Success / Failure

  • Success: Indented file listing printed to stdout (exit code 0)
  • Failure: Error message (exit code non-zero, e.g. directory not found)