基于 Gemini 的命令行 Web 搜索工具,为 Deep Code 提供联网搜索能力。
git clone https://github.com/qorzj/web_search_cli.git
cd web_search_cli
pip install -r requirements.txt
chmod +x web_search_cli.py编辑 web_search_cli.py,在 OPENAI_MODELS 中填入你自己的 Gemini API Key:
OPENAI_MODELS = [
{
"name": "gemini",
"model": "gemini-3-flash-preview",
"api_key": "<Your-API-Key>",
"base_url": "https://generativelanguage.googleapis.com/v1beta/openai/",
}
]Gemini API Key 可以从 Google AI Studio 免费获取。
在 ~/.deepcode/settings.json 中添加 webSearchTool 字段,指向 web_search_cli.py 的完整路径:
{
"env": {
"MODEL": "deepseek-v4-pro",
"BASE_URL": "https://api.deepseek.com",
"API_KEY": "sk-..."
},
"thinkingEnabled": true,
"webSearchTool": "/Users/.../web_search_cli/web_search_cli.py"
}配置后 Deep Code 会自动调用该工具进行联网搜索。
./web_search_cli.py "Python 3.13 new features"