返回顶部
n

nginx-explorerNginx目录探索

Explore nginx-proxied directories to discover tools and utilities. Use when: user asks to explore available tools, find utilities for specific tasks, or when OpenClaw needs to discover executable projects in a directory structure served by nginx. Configuration requires nginx URL. Each directory contains README.md explaining contents and execution instructions.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
145
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

nginx-explorer

Nginx 资源探索技能

探索由 nginx 提供的目录,以发现工具、实用程序和可执行项目。每个主目录都包含一个 README.md 文件,说明可用内容及其使用方法。

配置

此技能需要一个环境变量:

  • - NGINX_URL:nginx 服务器的基础 URL(例如 http://192.168.1.100:8080 或 http://internal-tools.local)

可选环境变量:

  • - NGINXSKIPSSL_VERIFY:设置为 true 以跳过 SSL 证书验证(适用于使用自签名证书的内部网络)。默认值为 true。

在 ~/.openclaw/openclaw.json 中配置:
json5
{
skills: {
entries: {
nginx-explorer: {
enabled: true,
env: {
NGINX_URL: http://your-nginx-server:port,
NGINXSKIPSSL_VERIFY: true // 可选:为内部网络跳过 SSL 验证
}
}
}
}
}

使用时机

在以下情况使用此技能:

  • - 用户询问有哪些工具可用?或探索 nginx 目录
  • OpenClaw 需要为特定任务查找实用程序
  • 用户想要发现在 nginx 代理结构中的可执行项目
  • 当常规方法失败且探索可用工具有助于解决问题时

在以下情况不要使用此技能:

  • - 可以直接访问文件(改用常规文件操作)
  • 未配置 nginx URL
  • 需要简单的文件下载(直接使用 curl/wget)

配置

此技能需要一个配置项:

  • - NGINX_URL:nginx 服务器的基础 URL(例如 http://192.168.1.100:8080 或 http://internal-tools.local)

工作原理

  1. 1. 目录发现:获取 nginx 目录列表(HTML)
  2. README 读取:对于每个目录,读取 README.md 文件以了解内容
  3. 工具识别:识别可执行项目及其使用说明
  4. 下载与执行:可以本地下载工具并根据需要运行

基本用法

1. 配置 nginx URL

首先,在环境或工作区中设置 nginx URL:

bash

设置为环境变量


export NGINX_URL=http://192.168.1.100:8080

或存储在工作区配置中

echo {nginx_url: http://192.168.1.100:8080} > /home/node/.openclaw/workspace/nginx-config.json

2. 探索目录结构

bash

获取目录列表


curl -s $NGINX_URL/ | grep -o href=[^]* | grep -v ^href=\. | cut -d -f2

3. 读取 README 文件

对于每个发现的目录:

bash

检查 README.md 是否存在


curl -s -I $NGINX_URL/tool-directory/README.md | head -1 | grep 200

读取 README

curl -s $NGINX_URL/tool-directory/README.md

4. 下载并执行工具

当找到有用的工具时:

bash

下载工具(假设是脚本或压缩包)


curl -o /tmp/tool.sh $NGINX_URL/tool-directory/tool.sh

如果需要,赋予执行权限

chmod +x /tmp/tool.sh

根据 README 说明运行

/tmp/tool.sh --help

工作流示例

示例 1:发现可用工具

bash
#!/bin/bash
NGINX_URL=http://192.168.1.100:8080

获取所有目录

echo 正在探索 $NGINX_URL... DIRS=$(curl -s $NGINX_URL/ | grep -o href=[^]*/ | grep -v ^href=\. | cut -d -f2 | sed s|/$||)

for dir in $DIRS; do
echo === $dir ===
# 尝试读取 README
README=$(curl -s $NGINX_URL/$dir/README.md 2>/dev/null)
if [ -n $README ]; then
echo $README | head -5
else
echo 未找到 README
fi
echo
done

示例 2:查找特定类型的工具

bash
#!/bin/bash
NGINX_URL=http://192.168.1.100:8080

搜索与数据处理相关的工具

echo 正在搜索数据处理工具... DIRS=$(curl -s $NGINX_URL/ | grep -o href=[^]*/ | grep -v ^href=\. | cut -d -f2 | sed s|/$||)

for dir in $DIRS; do
README=$(curl -s $NGINX_URL/$dir/README.md 2>/dev/null)
if echo $README | grep -qi data.*process\|csv\|json\|transform; then
echo 在 $dir 中找到:
echo $README | grep -i data.*process\|csv\|json\|transform | head -3
echo ---
fi
done

示例 3:下载并运行工具

bash
#!/bin/bash
NGINX_URL=http://192.168.1.100:8080
TOOL_DIR=data-processor

读取说明

README=$(curl -s $NGINXURL/$TOOLDIR/README.md) echo 工具说明: echo $README

下载主脚本

curl -o /tmp/processor.py $NGINXURL/$TOOLDIR/processor.py

如果提到依赖项,则下载

if echo $README | grep -q requirements.txt; then curl -o /tmp/requirements.txt $NGINXURL/$TOOLDIR/requirements.txt pip install -r /tmp/requirements.txt fi

运行工具

python /tmp/processor.py --help

与 OpenClaw 决策的集成

此技能设计用于 OpenClaw 遇到困难问题时使用。工作流如下:

  1. 1. 问题评估:确定常规方法是否失败
  2. 工具探索:使用此技能探索可用的实用程序
  3. 工具选择:识别可能有助于解决特定问题的工具
  4. 工具应用:下载并使用所选工具

决策流程

用户请求 → OpenClaw 能否直接解决? → 是 → 直接解决



探索 nginx 目录

读取 README 文件

查找相关工具/实用程序

下载工具并应用于问题

错误处理

  • - 连接问题:检查 nginx URL 是否正确且可访问
  • 缺少 README:某些目录可能没有 README.md 文件
  • 链接失效:下载前验证工具文件是否存在
  • 执行失败:检查依赖项和权限

最佳实践

  1. 1. 缓存发现:存储目录列表以避免重复请求
  2. 验证工具:在使用前在隔离环境中测试工具
  3. 清理:使用后删除下载的文件
  4. 记录发现:将发现的实用工具更新到工作区笔记中

示例 README 结构

nginx 目录中的工具应遵循此 README 格式:

markdown

工具名称

用途

简要描述此工具的功能。

用法

bash ./tool.sh [选项]

依赖项

  • - Python 3.8+
  • 所需包:requests, pandas

示例

bash

基本用法

./tool.sh --input data.csv --output results.json

高级用法

./tool.sh --config config.yaml --verbose

备注

任何附加信息或警告。

安全注意事项

  • - 仅从受信任的 nginx 服务器下载
  • 在执行前验证脚本
  • 尽可能在沙盒环境中运行
  • 检查下载文件中是否存在恶意代码

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 nginx-explorer-1776201249 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 nginx-explorer-1776201249 技能

通过命令行安装

skillhub install nginx-explorer-1776201249

下载

⬇ 下载 nginx-explorer v1.0.0(免费)

文件大小: 6.68 KB | 发布时间: 2026-4-17 15:32

v1.0.0 最新 2026-4-17 15:32
- Initial release of nginx-explorer skill.
- Enables exploration of nginx-proxied directory structures to discover available tools and utilities.
- Fetches directory listings and reads README.md files in each directory for tool descriptions and usage instructions.
- Requires configuration of the base nginx URL; supports optional SSL verification skipping for internal/self-signed environments.
- Integrates with OpenClaw workflows to aid in tool discovery and selection when conventional solutions fail.
- Provides bash workflow examples for discovering, searching, downloading, and running tools from the nginx-served directories.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部