ddg-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ddg-search

ddg-search

Use the local skill script for lightweight DuckDuckGo search.
This skill exists to make fallback web search simple and low-noise instead of rebuilding ad hoc search helpers each time.
使用本地skill脚本实现轻量级DuckDuckGo搜索。
本skill的作用是简化备选网页搜索流程、降低冗余,无需每次都临时构建搜索辅助工具。

Quick rules

快速规则

  • Prefer your normal primary search tool when it is healthy.
  • Use this skill when you need a fallback or a second source.
  • Keep searches narrow and intentional.
  • Prefer JSON output by default.
  • Use
    --text
    only when human-readable terminal output is actually more useful.
  • Use
    references/notes.md
    for quick guidance on when this tool fits.
  • 当常规主搜索工具正常运行时优先使用它。
  • 当你需要备选方案或第二搜索源时使用本skill。
  • 保持搜索范围精准、目的明确。
  • 默认优先使用JSON输出。
  • 仅当人类可读的终端输出确实更实用时才使用
    --text
    参数。
  • 如需快速了解本工具的适用场景,请参考
    references/notes.md

Local setup

本地配置

Prefer the skill-local script and a skill-local virtual environment over any global CLI install. Treat
.venv
as generated local state, not part of the skill itself. If the installer drops skill-local dotfiles, the bootstrap script recreates
.gitignore
automatically.
Bootstrap the local environment:
bash
<skill-path>/scripts/bootstrap_venv.sh
After bootstrap, use:
bash
<skill-path>/scripts/ddg-search
If
.venv
is missing later, just run the bootstrap script again.
优先使用skill本地脚本和skill本地虚拟环境,不要进行全局CLI安装。 将
.venv
视为生成的本地状态,不属于skill本身的一部分。 如果安装程序生成了skill本地的点文件,启动脚本会自动重建
.gitignore
初始化本地环境:
bash
<skill-path>/scripts/bootstrap_venv.sh
初始化完成后,使用如下命令:
bash
<skill-path>/scripts/ddg-search
如果后续
.venv
丢失,只需重新运行初始化脚本即可。

Commands

命令

Show built-in help

查看内置帮助

bash
<skill-path>/scripts/ddg-search help
bash
<skill-path>/scripts/ddg-search help

Text search

文本搜索

bash
<skill-path>/scripts/ddg-search search 'openclaw github'
bash
<skill-path>/scripts/ddg-search search 'openclaw github'

News search

新闻搜索

bash
<skill-path>/scripts/ddg-search search 'bitcoin etf' --type news --timelimit d --max-results 10
bash
<skill-path>/scripts/ddg-search search 'bitcoin etf' --type news --timelimit d --max-results 10

Image search

图片搜索

bash
<skill-path>/scripts/ddg-search search 'bitcoin logo' --type images --max-results 10
bash
<skill-path>/scripts/ddg-search search 'bitcoin logo' --type images --max-results 10

Video search

视频搜索

bash
<skill-path>/scripts/ddg-search search 'openai launch' --type videos --timelimit w --max-results 10
bash
<skill-path>/scripts/ddg-search search 'openai launch' --type videos --timelimit w --max-results 10

Restrict to one site

限制搜索单个站点

bash
<skill-path>/scripts/ddg-search search 'python dataclasses' --site docs.python.org
bash
<skill-path>/scripts/ddg-search search 'python dataclasses' --site docs.python.org

Reverse result order

反转结果顺序

bash
<skill-path>/scripts/ddg-search search 'openai launch' --type videos --max-results 10 --reverse
bash
<skill-path>/scripts/ddg-search search 'openai launch' --type videos --max-results 10 --reverse

Instant-answer lookup

即时答案查询

bash
<skill-path>/scripts/ddg-search instant 'weather berlin'
bash
<skill-path>/scripts/ddg-search instant 'weather berlin'

Resolve a DuckDuckGo bang

解析DuckDuckGo bang指令

bash
<skill-path>/scripts/ddg-search bang w 'OpenAI'
bash
<skill-path>/scripts/ddg-search bang w 'OpenAI'

Workflow

工作流

  1. Read
    references/notes.md
    if you want quick selection guidance.
  2. Ensure the skill-local virtual environment is bootstrapped.
  3. Use
    search
    for normal search,
    instant
    for instant-answer lookups, and
    bang
    when a DuckDuckGo bang is the cleanest path.
  4. Parse JSON output by default.
  5. Cross-check with another source when the question is important.
  1. 如果你需要快速的选择指引,可以先阅读
    references/notes.md
  2. 确保skill本地虚拟环境已完成初始化。
  3. 普通搜索使用
    search
    命令,即时答案查询使用
    instant
    命令,当使用DuckDuckGo bang是最优路径时使用
    bang
    命令。
  4. 默认解析JSON输出。
  5. 如果问题很重要,请和其他来源的结果交叉验证。

Expected outputs

预期输出

The tool returns JSON by default. Parse it instead of scraping text.
Use
--text
when you want a readable terminal view.
  • search
    returns query metadata plus
    results
  • instant
    returns instant-answer style structured fields
  • bang
    returns the DuckDuckGo URL plus the resolved redirect/final URL
本工具默认返回JSON格式,请直接解析JSON而不是抓取文本。
当你需要可读的终端视图时使用
--text
参数。
  • search
    返回查询元数据加上
    results
    结果集
  • instant
    返回即时答案风格的结构化字段
  • bang
    返回DuckDuckGo URL加上解析后的重定向/最终URL

Files

文件

  • Source repo:
    https://github.com/ropl-btc/ddg-search-cli
  • Launcher:
    scripts/ddg-search
  • Python implementation:
    scripts/ddg_search.py
  • Local bootstrap:
    scripts/bootstrap_venv.sh
  • Notes:
    references/notes.md
  • .venv/
    is generated local state and can be recreated with
    scripts/bootstrap_venv.sh
  • 源码仓库:
    https://github.com/ropl-btc/ddg-search-cli
  • 启动器:
    scripts/ddg-search
  • Python实现:
    scripts/ddg_search.py
  • 本地初始化脚本:
    scripts/bootstrap_venv.sh
  • 说明文档:
    references/notes.md
  • .venv/
    是生成的本地状态,可通过
    scripts/bootstrap_venv.sh
    重新创建

When to stop and ask

停止操作并询问的场景

Stop and ask before:
  • turning this into browser automation
  • adding scraping-heavy flows
  • adding provider-specific hacks that make the wrapper fragile
  • changing default behavior from lightweight fallback search to something much broader
出现以下情况前请先停止操作并询问:
  • 将本工具改造成浏览器自动化工具
  • 加入重度抓取流程
  • 添加特定于提供商的hack逻辑,导致包装器变得脆弱
  • 将默认行为从轻量级备选搜索改为更广泛的其他功能