跳到正文
DEV Community· Laish Glenberg·· 3 小時前AI 評分49

DeepSeek Web Search API 的 TypeScript CLI 搜尋工具

Simple DeepSeek web search cli written in TypeScript. Cheap + fast search tool for agents (built on DS web search API)

AI 導讀

作者以 DeepSeek Web Search API 建立供 Agent 使用的 TypeScript CLI 工具 deepseek-search-cli,並分享給其他用戶。API 搜尋費用為每 1,000 次請求 $0.75;工具支援搜尋結果輸出為 .md 或 .json,並提供測試、CI 檢查及 API 金鑰驗證功能。

正文

Cover image for Simple DeepSeek web search cli written in TypeScript. Cheap + fast search tool for agents (built on DS web search API)

Laish Glenberg

Hey guys, if you've been following along with DeepSeek news you will know they recently added web search capability to the DeepSeek API, where you can use web search under the same API key. It is pretty handy, also super cheap at only $0.75 per 1,000 requests (pretty much as cheap as it gets, one search credit can encompass many responses).

I created a simple TypeScript CLI wrapper around the API for my own agents to use (for open source models and harnesses)

npm install -g deepseek-search-cli

dsearch auth    # Prompt for & save DS API key (can pipe) 
                # saved key not required (can use secret manager, env var, or .env)

dsearch "World Cup winners 2026 lang:en" -n 5    # equivalent to 'dsearch search ...'
dsearch https://example.com                      # equivalent to 'dsearch fetch ...'
dsearch "World Cup winners" -o output.md         # supports .md and .json (-j flag)

And wanted to share it with others, contributors are welcome, or fork it and build a better version :)

I'm sure most of you could whip this up on your own but it also comes with unit/integration/live/e2e testing, CI checks, changelog, auth handling, linting, sdk wrapper, and a fleshed out readme, potentially saving you a few hours of work + validation. Just need to install, auth, and drop a comment in your 'AGENTS.md' to use dsearch --help when agent needs web search.

GitHub: https://github.com/LaishGlenberg/deepseek-search-cli
NPM: https://www.npmjs.com/package/deepseek-search-cli

Drop a star if this helped you or your agents!

EDIT: Looks like the top of the GIF is getting cut off or cropped on certain views, I will look into resizing it.

來源:DEV Community · dev.to