← 返回 Skills 市场
qingliu1617-art

Brave Search Setup

作者 qingliu1617-art · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
1299
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install brave-search-setup
功能描述
Configure Brave Search API and troubleshoot network/proxy issues for web_search functionality. Use when user needs to (1) Set up Brave Search API key, (2) Fix web_search fetch failures, (3) Configure proxy for OpenClaw tools on macOS with Clash/V2Ray/Surge, or (4) Diagnose "fetch failed" errors with web_search/web_fetch tools.
使用说明 (SKILL.md)

Brave Search Setup & Proxy Configuration

Setup Brave Search API and resolve network connectivity issues for OpenClaw web tools.

Prerequisites

Quick Setup

Step 1: Configure API Key

# Option A: Via config.patch (key will be stored securely)
openclaw gateway config.patch --raw '{"tools":{"web":{"search":{"apiKey":"YOUR_BRAVE_API_KEY","enabled":true,"provider":"brave"}}}}'

Or edit ~/.openclaw/openclaw.json directly:

{
  "tools": {
    "web": {
      "search": {
        "enabled": true,
        "provider": "brave",
        "apiKey": "YOUR_BRAVE_API_KEY"
      }
    }
  }
}

Step 2: Test Without Proxy

openclaw web.search --query "test" --count 1

If works → Done. If "fetch failed" → Continue to proxy setup.

Proxy Setup (macOS)

Step 3: Detect Proxy Port

Common proxy ports by client:

  • Clash: 7890 (HTTP), 7891 (SOCKS5), 7897 (mixed-port)
  • Surge: 6152, 6153
  • V2Ray: 1080, 10808

Detect actual port:

# Check if Clash is running
ps aux | grep -i clash

# Find mixed-port from Clash config
cat "~/Library/Application Support/io.github.clash-verge-rev.clash-verge-rev/clash-verge.yaml" | grep mixed-port

# Or test common ports
for port in 7890 7891 7897 6152 6153 1080 10808; do
  if nc -z 127.0.0.1 $port 2>/dev/null; then
    echo "Port $port is open"
  fi
done

Step 4: Set System Proxy

Method A: launchctl (Recommended - survives restart)

# Set for current session and future sessions
launchctl setenv HTTPS_PROXY http://127.0.0.1:7897
launchctl setenv HTTP_PROXY http://127.0.0.1:7897

Method B: Shell export (Session only)

export HTTPS_PROXY=http://127.0.0.1:7897
export HTTP_PROXY=http://127.0.0.1:7897

Method C: Add to shell profile (Permanent)

echo 'export HTTPS_PROXY=http://127.0.0.1:7897' >> ~/.zshrc
echo 'export HTTP_PROXY=http://127.0.0.1:7897' >> ~/.zshrc
source ~/.zshrc

Step 5: Enable Gateway Restart

openclaw gateway config.patch --raw '{"commands":{"restart":true}}'

Step 6: Restart Gateway with Proxy

# Restart to pick up proxy env vars
openclaw gateway restart

# Or use SIGUSR1
kill -USR1 $(pgrep -f "openclaw gateway")

Step 7: Verify

# Test web search
openclaw web.search --query "Brave Search test" --count 1

# Test web fetch
openclaw web.fetch --url "https://api.search.brave.com" --max-chars 100

Troubleshooting

"fetch failed" but proxy works in browser

Symptom: Browser can access Google, but OpenClaw tools fail. Cause: Gateway process started before proxy env vars were set. Solution: Restart Gateway after setting HTTPS_PROXY.

Permission denied on Gateway restart

Enable restart command:

openclaw gateway config.patch --raw '{"commands":{"restart":true}}'

API key errors

Verify key is set:

openclaw gateway config.get | grep -A5 'web.*search'

Test directly with curl:

curl -s "https://api.search.brave.com/res/v1/web/search?q=test&count=1" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: YOUR_API_KEY"

Mixed-port vs dedicated ports

Clash "mixed-port" (default 7897) handles both HTTP and SOCKS5. If using dedicated ports:

  • HTTP proxy: 7890
  • SOCKS5 proxy: 7891 (requires different handling)

Advanced: Per-Tool Proxy

Not all tools respect HTTPS_PROXY. For tools that don't:

# Use proxychains-ng
brew install proxychains-ng

# Configure
sudo tee /usr/local/etc/proxychains.conf \x3C\x3CEOF
strict_chain
proxy_dns
[ProxyList]
http 127.0.0.1 7897
EOF

# Run with proxy
proxychains4 openclaw web.search --query "test"

Workflow Summary

  1. Configure API keyconfig.patch or edit JSON
  2. Test → If fails, proxy needed
  3. Detect port → Check Clash/Surge config
  4. Set env varslaunchctl setenv or shell export
  5. Restart Gatewayopenclaw gateway restart
  6. Verify → Run test search

References

安全使用建议
This skill appears coherent and focused on setting a Brave Search API key and configuring a local proxy for OpenClaw tools. Before running commands: 1) Back up your OpenClaw config (~/.openclaw/openclaw.json) so you can restore it if needed. 2) Prefer using openclaw gateway config.patch (the doc's 'Option A') rather than editing files directly if you want the platform to manage formatting; confirm where/how your API key will be stored (it may be plaintext in config). 3) Review scripts/detect-proxy.sh yourself — it only scans local ports and a known Clash config path. 4) Be cautious when adding exports to shell profiles or running sudo to install proxychains-ng (these change your environment or require elevated privileges). 5) If unsure about exposing your API key or making system changes, run the discovery/test commands manually and ask for help rather than applying the suggested permanent changes.
功能分析
Type: OpenClaw Skill Name: brave-search-setup Version: 1.0.0 The skill bundle is designed to configure Brave Search API and troubleshoot network/proxy issues on macOS. While its stated purpose is benign, it includes several high-risk capabilities. Specifically, SKILL.md instructs the agent to make persistent system modifications via `launchctl setenv` and by appending to `~/.zshrc`. It also includes instructions to install `proxychains-ng` via `brew` and modify a system-wide configuration file (`/usr/local/etc/proxychains.conf`) using `sudo tee`. The `scripts/detect-proxy.sh` file reads a user's Clash configuration file (`clash-verge.yaml`). These actions, while potentially necessary for proxy configuration, grant significant system access and persistence, elevating the classification to suspicious due to the inherent risks of such broad permissions and system modifications without clear malicious intent.
能力评估
Purpose & Capability
The skill's name/description match the actual instructions: it shows how to add a Brave Search API key to OpenClaw config, test web_search/web_fetch, detect local proxy ports (Clash/V2Ray/Surge), set HTTPS_PROXY/HTTP_PROXY, and restart the OpenClaw gateway. There are no unrelated credentials, binaries, or external endpoints required beyond the Brave Search API and common tools.
Instruction Scope
The SKILL.md includes commands that read/write local OpenClaw config (~/.openclaw/openclaw.json), inspect a Clash YAML under the user's Library, set environment variables via launchctl or shell profile, and suggests installing/running proxychains-ng with sudo. These actions are consistent with troubleshooting network/proxy issues, but they will change local shell config, environment, and may store the API key in OpenClaw config (potentially plaintext). Users should be aware the skill directs edits to user files and requires restarting the gateway process.
Install Mechanism
This is an instruction-only skill with a small helper script (scripts/detect-proxy.sh) that scans local ports and reads a Clash config path. There is no install spec, no downloads, and no extracted archives; the script content is simple shell logic and appears benign.
Credentials
The skill does not declare or require external environment variables or credentials beyond the Brave Search API key (which the instructions ask you to place into OpenClaw config). It asks the user to set standard HTTPS_PROXY/HTTP_PROXY env vars to route traffic through a local proxy — appropriate for the stated goal. Note: storing API keys in config files can expose them if files are not protected.
Persistence & Privilege
The skill does not request permanent platform privileges (always:false) and does not modify other skills. It instructs restarting the OpenClaw gateway and setting user-level environment variables (launchctl or shell profile), which is expected for proxy propagation but is a system-level change the user must consciously approve.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install brave-search-setup
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /brave-search-setup 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Brave Search API config and macOS proxy setup for OpenClaw
元数据
Slug brave-search-setup
版本 1.0.0
许可证
累计安装 4
当前安装数 2
历史版本数 1
常见问题

Brave Search Setup 是什么?

Configure Brave Search API and troubleshoot network/proxy issues for web_search functionality. Use when user needs to (1) Set up Brave Search API key, (2) Fix web_search fetch failures, (3) Configure proxy for OpenClaw tools on macOS with Clash/V2Ray/Surge, or (4) Diagnose "fetch failed" errors with web_search/web_fetch tools. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1299 次。

如何安装 Brave Search Setup?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install brave-search-setup」即可一键安装,无需额外配置。

Brave Search Setup 是免费的吗?

是的,Brave Search Setup 完全免费(开源免费),可自由下载、安装和使用。

Brave Search Setup 支持哪些平台?

Brave Search Setup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Brave Search Setup?

由 qingliu1617-art(@qingliu1617-art)开发并维护,当前版本 v1.0.0。

💬 留言讨论