Nginx Explorer Skill
Explore directories served by nginx to discover tools, utilities, and executable projects. Each main directory contains a README.md file that explains what's available and how to use it.
Configuration
This skill requires one environment variable:
- -
NGINX_URL: The base URL of the nginx server (e.g., http://192.168.1.100:8080 or http://internal-tools.local)
Optional environment variable:
- -
NGINX_SKIP_SSL_VERIFY: Set to true to skip SSL certificate verification (useful for internal networks with self-signed certificates). Default is true.
Configure in ~/.openclaw/openclaw.json:
CODEBLOCK0
When to Use
✅ USE this skill when:
- - User asks "what tools are available?" or "explore the nginx directory"
- OpenClaw needs to find utilities for specific tasks
- User wants to discover executable projects in the nginx-proxied structure
- When conventional approaches fail and exploring available tools might help
❌ DON'T use this skill when:
- - Direct file access is available (use normal file operations instead)
- The nginx URL is not configured
- Simple file downloads are needed (use curl/wget directly)
Configuration
The skill requires one configuration item:
- -
NGINX_URL: The base URL of the nginx server (e.g., http://192.168.1.100:8080 or http://internal-tools.local)
How It Works
- 1. Directory Discovery: Fetches the nginx directory listing (HTML)
- README Reading: For each directory, reads the README.md file to understand contents
- Tool Identification: Identifies executable projects and their usage instructions
- Download & Execution: Can download tools locally and run them as needed
Basic Usage
1. Configure the nginx URL
First, set the nginx URL in your environment or workspace:
CODEBLOCK1
2. Explore the Directory Structure
CODEBLOCK2
3. Read README Files
For each discovered directory:
CODEBLOCK3
4. Download and Execute Tools
When a useful tool is found:
CODEBLOCK4
Workflow Examples
Example 1: Discovering Available Tools
CODEBLOCK5
Example 2: Finding a Specific Type of Tool
CODEBLOCK6
Example 3: Downloading and Running a Tool
CODEBLOCK7
Integration with OpenClaw Decision Making
This skill is designed to be used when OpenClaw encounters difficult problems. The workflow:
- 1. Problem Assessment: Determine if conventional approaches are failing
- Tool Exploration: Use this skill to explore available utilities
- Tool Selection: Identify tools that might help with the specific problem
- Tool Application: Download and use the selected tool
Decision Flow
CODEBLOCK8
Error Handling
- - Connection Issues: Check if nginx URL is correct and accessible
- Missing README: Some directories may not have README.md files
- Broken Links: Verify tool files exist before downloading
- Execution Failures: Check dependencies and permissions
Best Practices
- 1. Cache Discoveries: Store directory listings to avoid repeated requests
- Validate Tools: Test tools in isolated environment before use
- Clean Up: Remove downloaded files after use
- Document Findings: Update workspace notes with useful tools discovered
Example README Structure
Tools in the nginx directory should follow this README format:
CODEBLOCK9 bash
./tool.sh [options]
## Dependencies
- Python 3.8+
- Required packages: requests, pandas
## Examples
bash
Basic usage
./tool.sh --input data.csv --output results.json
Advanced usage
./tool.sh --config config.yaml --verbose
CODEBLOCK11
Security Considerations
- - Only download from trusted nginx servers
- Validate scripts before execution
- Run in sandboxed environment when possible
- Check for malicious code in downloaded files
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. 目录发现:获取 nginx 目录列表(HTML)
- README 读取:对于每个目录,读取 README.md 文件以了解内容
- 工具识别:识别可执行项目及其使用说明
- 下载与执行:可以本地下载工具并根据需要运行
基本用法
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 $NGINX
URL/$TOOLDIR/README.md)
echo 工具说明:
echo $README
下载主脚本
curl -o /tmp/processor.py $NGINX
URL/$TOOLDIR/processor.py
如果提到依赖项,则下载
if echo $README | grep -q requirements.txt; then
curl -o /tmp/requirements.txt $NGINX
URL/$TOOLDIR/requirements.txt
pip install -r /tmp/requirements.txt
fi
运行工具
python /tmp/processor.py --help
与 OpenClaw 决策的集成
此技能设计用于 OpenClaw 遇到困难问题时使用。工作流如下:
- 1. 问题评估:确定常规方法是否失败
- 工具探索:使用此技能探索可用的实用程序
- 工具选择:识别可能有助于解决特定问题的工具
- 工具应用:下载并使用所选工具
决策流程
用户请求 → OpenClaw 能否直接解决? → 是 → 直接解决
↓
否
↓
探索 nginx 目录
↓
读取 README 文件
↓
查找相关工具/实用程序
↓
下载工具并应用于问题
错误处理
- - 连接问题:检查 nginx URL 是否正确且可访问
- 缺少 README:某些目录可能没有 README.md 文件
- 链接失效:下载前验证工具文件是否存在
- 执行失败:检查依赖项和权限
最佳实践
- 1. 缓存发现:存储目录列表以避免重复请求
- 验证工具:在使用前在隔离环境中测试工具
- 清理:使用后删除下载的文件
- 记录发现:将发现的实用工具更新到工作区笔记中
示例 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 服务器下载
- 在执行前验证脚本
- 尽可能在沙盒环境中运行
- 检查下载文件中是否存在恶意代码