# TOOLS.md - Local Notes

Skills define _how_ tools work. This file is for _your_ specifics — the stuff that's unique to your setup.

## What Goes Here

Things like:

- Camera names and locations
- SSH hosts and aliases
- Preferred voices for TTS
- Speaker/room names
- Device nicknames
- Anything environment-specific

## Examples

```markdown
### Cameras

- living-room → Main area, 180° wide angle
- front-door → Entrance, motion-triggered

### SSH

- home-server → 192.168.1.100, user: admin

### TTS

- Local (offline) TTS: Piper via venv `./.venv_piper` + wrapper `./bin/tts_piper.sh`
- Default CN voice model: `tts/piper/models/zh_CN-huayan-medium.onnx`
- Output: WAV (PCM 16-bit, mono, 22050 Hz)

### Local Speech-to-Text (Whisper)

- Preferred default: **local whisper.cpp** (offline)
- Repo: `/home/kuhnn/whisper.cpp`
- Binary: `/home/kuhnn/whisper.cpp/build/bin/whisper-cli`
- Default model: `/home/kuhnn/whisper.cpp/models/ggml-base.bin`
- Wrapper script: `/home/kuhnn/.openclaw/workspace/bin/transcribe_whispercpp.sh`
- Notes: Telegram voice notes are often `.ogg/opus` → decode to `wav (16k, mono)` with ffmpeg first.
```

## Why Separate?

Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure.

---

## 百度低频检索（非官方抓取，低频兜底用）

- 位置：`~/.openclaw/workspace/tools/baidu_search/`
- 用法（JSONL 输出，适合后续抓源站做引用）：
  - `~/.openclaw/workspace/tools/baidu_search/run.sh "关键词" 10`
- 说明：非官方 HTML 抓取，可能触发验证码/403；仅建议低频使用。日常主力仍优先 Tavily/Brave。
- 对话口令：你对我说 **“百度搜：xxx”** 我就会用这个工具跑。

## ripgrep (rg) 常用速查（会频繁用）

> 默认：递归搜索；尊重 .gitignore；跳过隐藏文件/目录与二进制。

### 高频命令
- 基本搜索（大小写不敏感）：`rg -i 'pattern' [path]`
- 智能大小写：`rg -S 'Foo'`（含大写则区分，否则不区分）
- 显示行号/列号：`rg -n --column 'pattern'`
- 上下文：`rg -C 2 'pattern'`（或 `-A/-B`）
- 只列出命中文件：`rg -l 'pattern'`
- 统计命中：`rg -c 'pattern'`（每文件） / `rg --count-matches`（匹配数）
- 只显示匹配片段：`rg -o 're'`

### 过滤/范围（避免扫大目录卡住）
- 指定文件类型：`rg -t md 'pattern'`；查看类型：`rg --type-list`
- glob 过滤：`rg -g '!**/node_modules/**' -g '!**/.git/**' 'pattern'`
- 搜隐藏文件：`rg --hidden 'pattern'`
- 不遵循 ignore（慎用，可能很慢）：`rg --no-ignore 'pattern'`
- 完全不限制（最像传统 grep，最慢）：`rg -uuu 'pattern'`
- 仅搜索 git 已跟踪文件（稳定且快）：`git ls-files -z | xargs -0 rg 'pattern'`

### 多模式
- 多个正则：`rg -e 'foo' -e 'bar'`
- 从文件读模式：`rg -f patterns.txt`

### 配置文件
- 可用 `RIPGREP_CONFIG_PATH` 指向配置文件（每行一个参数，支持 # 注释）。

Add whatever helps you do your job. This is your cheat sheet.
