微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🔍

AI Agent 实时搜索与内容提取利器

youdotcom-cli · vv3.0.0
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
效率 安全 S 级 作者 EdwardIrby 公开目录收录
566 下载 129 安装 2.5k 收藏 1.6k 浏览

简介

You.com 官方 CLI 工具文档,为 AI Agent 提供实时网络搜索与网页内容提取能力,需用户自行配置 API Key 使用。

原始描述

Web search, research with citations, and content extraction for bash agents using curl and You.com's REST API. - MANDATORY TRIGGERS: You.com, youdotcom, YDC,...

通过你的 Agent 添加

安装目录:youdotcom-cli/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/youdotcom-cli/
Codex CLI~/.codex/skills/youdotcom-cli/
DeepSeek Harness~/.agents/skills/youdotcom-cli/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

youdotcom-cli 是一个面向 Bash 环境 AI Agent 的 Web 搜索技能,基于 You.com 官方 @youdotcom-oss/api CLI 工具实现。该技能提供两大核心功能:一是实时网络搜索(ydc search),支持基础搜索和带 livecrawl 的深度搜索,可即时获取完整网页内容;二是 URL 内容提取(ydc contents),能将指定网页转换为 Markdown 等结构化格式。使用时需先通过 npm 或 bun 全局安装 CLI 工具,配置 YDC_API_KEY 环境变量,并在所有命令中附加 --client YourAgentName 标识以便错误追踪。

显著优点

该技能的最大优势在于与 You.com 搜索生态的深度整合。Livecrawl 功能可绕过传统搜索仅返回摘要的局限,直接获取完整网页原文,大幅提升信息获取效率。CLI 设计遵循 Unix 哲学,输出为结构化 JSON,便于与 jq 等工具链式处理。文档详尽程度超出一般社区项目,涵盖从安装、快速入门到故障排查的完整链路,甚至提供 --schema 参数用于动态发现 API 能力。此外,明确的退出码规范(0/1/2)和常见错误修复指南,降低了生产环境的使用门槛。

潜在缺点与局限性

首先,该技能存在硬性外部依赖:必须拥有 You.com API Key 且需网络连通,在无网络或 API 服务不可达区域完全无法工作。其次,搜索质量受限于 You.com 的索引覆盖范围,对于小众或最新内容可能存在滞后。Livecrawl 虽强大,但会显著增加 API 调用成本和响应延迟。另外,CLI 工具需全局安装,可能与其他 Node.js/Bun 项目产生依赖冲突。最后,当前版本未提供本地缓存机制,重复查询会重复消耗 API 额度。

适合的目标群体

该技能最适合以下场景:需要为 AI Agent 赋予实时网络能力的开发者、构建 RAG(检索增强生成)系统的工程师、需要自动化网页内容监控的运营人员,以及使用 Claude Code、Cursor、Codex 等 AI 编程工具的专业用户。对于企业级应用,需评估 You.com API 的稳定性与成本模型是否匹配业务需求。

使用风险

常规风险包括:API Key 泄露风险(需严格通过环境变量管理)、网络依赖导致的单点故障、npm/bun 供应链攻击(建议锁定版本并校验包完整性)、以及搜索查询可能泄露敏感业务信息至 You.com 服务器。此外,频繁调用可能触发速率限制(429 错误),需在调用层实现指数退避重试机制。

技能正文


name: youdotcom-cli description: | Web search with livecrawl (search+extract) and content extraction for bash agents using You.com's @youdotcom-oss/api CLI.

  • MANDATORY TRIGGERS: You.com, youdotcom, YDC, @youdotcom-oss/api, web search CLI, livecrawl
  • Use when: web search needed, content extraction, URL crawling, real-time web data license: MIT compatibility: Requires Bun 1.3+ or Node.js 18+, and access to the internet allowed-tools: Bash(bunx:@youdotcom-oss/api) Bash(npx:@youdotcom-oss/api) Bash(bunx:ydc) Bash(npx:ydc) Bash(jq:*) metadata: author: youdotcom-oss version: "2.0.5" category: web-search-tools keywords: you.com,bash,cli,ai-agents,web-search,content-extraction,livecrawl,claude-code,codex,cursor

Integrate You.com with Bash-Based AI Agents

Web search with livecrawl (search+extract) and content extraction for bash agents using You.com's @youdotcom-oss/api CLI.

Installation

# Check prerequisites
node -v  # Requires Node.js 18+ or Bun 1.3+
# or
bun -v

# Recommended: Global installation (available system-wide)
npm install -g @youdotcom-oss/api
# or
bun add -g @youdotcom-oss/api

# Verify installation
ydc --version

Quick Start

  1. Get API key from https://you.com/platform/api-keys
  2. Set environment variable:
    export YDC_API_KEY="your-api-key-here"
    
  3. Run commands using ydc:
    # Basic search
    ydc search --json '{"query":"AI news"}' --client YourAgentName
    
    # Search with livecrawl (get full page content instantly)
    ydc search --json '{
      "query":"documentation",
      "livecrawl":"web",
      "livecrawl_formats":"markdown"
    }' --client YourAgentName
    
    # Extract content from URL
    ydc contents --json '{
      "urls":["https://example.com"],
      "formats":["markdown"]
    }' --client YourAgentName
    

Update

# Update to latest version
npm update -g @youdotcom-oss/api
# or
bun update -g @youdotcom-oss/api

Workflow

1. Use --client Flag

  • Always include --client YourAgentName in all commands
  • Use your agent identifier (e.g., "ClaudeCode", "Cursor", "Codex")
  • This helps support respond to error reports (included in mailto links)
  • Example: ydc search --json '{"query":"..."}' --client ClaudeCode

2. Verify API Key

  • Check if YDC_API_KEY environment variable is set
  • If not set, guide user to get key from https://you.com/platform/api-keys
  • Provide command: export YDC_API_KEY="your-key"

3. Use --schema for Discovery

  • Use ydc search --schema to discover available parameters dynamically
  • Use ydc contents --schema to see content extraction options
  • Parse JSON schema to build queries programmatically
  • Example: ydc search --schema | jq '.properties | keys'

4. Tool Selection & Execution

IF user provides URLs → ydc contents with "urls" parameter
ELSE IF user needs search + full content → ydc search with "livecrawl":"web"
ELSE → ydc search without livecrawl

Requirements: Always include --json flag and --client YourAgentName
Exit codes: 0=success, 1=API error, 2=invalid args
Common filters: freshness, site, country parameters

Examples

Schema Discovery

# Discover search parameters
ydc search --schema | jq '.properties | keys'

# See full schema for search
ydc search --schema | jq

# Discover contents parameters
ydc contents --schema | jq '.properties | keys'

Search

# Basic search
ydc search --json '{"query":"AI news"}' --client YourAgent

# Search + extract full content (livecrawl)
ydc search --json '{"query":"docs","livecrawl":"web","livecrawl_formats":"markdown"}' --client YourAgent

# With filters
ydc search --json '{"query":"news","freshness":"week","site":"github.com"}' --client YourAgent

# Parse results
ydc search --json '{"query":"AI"}' --client YourAgent | jq -r '.results.web[] | "\(.title): \(.url)"'

Contents

# Extract from URL
ydc contents --json '{"urls":["https://example.com"],"formats":["markdown"]}' --client YourAgent

# Multiple URLs
ydc contents --json '{"urls":["https://a.com","https://b.com"],"formats":["markdown"]}' --client YourAgent | jq -r '.[0].markdown'

Troubleshooting

Exit codes: 0=success, 1=API error, 2=invalid args

Common fixes:

  • command not found: ydc → npm install -g @youdotcom-oss/api
  • --json flag is required → Always use --json '{"query":"..."}'
  • YDC_API_KEY required → export YDC_API_KEY="your-key"
  • 401 error → Regenerate key at https://you.com/platform/api-keys
  • 429 rate limit → Add retry logic with exponential backoff

Resources

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

apicontent-mediaautomationdata-analyticsdevelopment-engineering

同类 Skill