bdsearch
Original:🇨🇳 Chinese
Translated
Baidu Search Tool. Use bdsearch CLI to search web content via Baidu AI Search API. Trigger scenarios: Users request Baidu search, news lookup, information retrieval, tutorial search, topic research, obtaining public web information, or needing structured search results.
3installs
Sourcelyhue1991/bdsearch
Added on
NPX Install
npx skill4agent add lyhue1991/bdsearch bdsearchTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →bdsearch
Encapsulates the command-line tool for Baidu web search.
bdsearchCore Capabilities
- Web Search - Query public web pages and news content
- Time Filtering - Supports the latest day, week, month, year, or custom date range
- Multi-format Output - Supports JSON, Markdown, and table formats
- Configuration Management - Supports API Key configuration and default parameter management
Workflow
🔍 Execute Web Search
When users express intentions of searching, looking up information, checking news, or conducting research, try executing the following search command:
bash
bdsearch "关键词" --format json --count 10Common usages can also be applied as needed:
bash
bdsearch "人工智能" --count 10 --format json # Search keywords, return top 10 results in JSON format
bdsearch "最新新闻" --freshness pd --format json # Search news from the latest day in JSON format
bdsearch "科技新闻" --freshness "2025-09-01to2025-09-08" --format markdown # Search news within the specified date range in Markdown format🛠️ Troubleshooting
If execution fails, first check if is installed and if the Baidu API Key is configured correctly. Follow these steps for troubleshooting:
bdsearch1. Check Installation → 2. Check Authentication ConfigurationStep 1: Check if bdsearch is installed
bash
command -v bdsearchIf not installed, execute:
bash
npm install -g @lyhue1991/bdsearchStep 2: Check Authentication Configuration
Check local configuration:
bash
bdsearch config --showIf not configured, check environment variables:
bash
printenv BAIDU_API_KEYIf still not configured, ask the user for the Baidu API Key and execute:
bash
bdsearch config --api-key "你的APIKey"⚙️ Configure bdsearch
When users only need to configure the API Key or default parameters:
bash
bdsearch config --api-key "你的APIKey"
bdsearch config --default-format json --default-count 10 --default-freshness pdView current configuration:
bash
bdsearch config --showReset configuration:
bash
bdsearch config --reset📰 Query Latest Content
When users explicitly request "latest", "recent days", or "this week" content, prioritize using time filtering:
bash
bdsearch "AI 新闻" --freshness pd --format json
bdsearch "大模型进展" --freshness pw --format json📄 Output Reader-friendly Results
When users need results for direct reading or copying:
bash
bdsearch "Node.js" --format markdown
bdsearch "Python" --count 10 --format tableParameter Description
| Parameter | Description |
|---|---|
| Search keyword, required |
| Number of returned results, range 1-50, default 10 |
| Time filtering, supports |
| Output format, supports |
Notes
- Prioritize JSON - When further analysis, field extraction, or content summarization is needed, prioritize using
--format json - Authentication Requirement - Must configure before use, or save local configuration via
BAIDU_API_KEYbdsearch config --api-key - Possible Duplicate Results - The upstream interface may return duplicate links; deduplication by is necessary if needed
url - Time Filtering Suggestion - Prioritize adding when querying news or dynamic information
--freshness
Quick Reference
bash
# View help
bdsearch --help
bdsearch config --help
# View configuration
bdsearch config --show
# Set API Key
bdsearch config --api-key "你的APIKey"
# Basic search
bdsearch "人工智能" --format json
# Specify number of results
bdsearch "TypeScript 教程" --count 5 --format json
# Query latest content
bdsearch "最新新闻" --freshness pd --format json
# Custom date range
bdsearch "科技新闻" --freshness "2025-09-01to2025-09-08" --format json
# Reader-friendly output
bdsearch "Node.js" --format markdown
bdsearch "Python" --format table