npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lyhue1991/tvsearch

v0.1.1

Published

Tavily Search API 命令行工具

Downloads

27

Readme

tvsearch

这是一个提供 Tavily 网页搜索能力的 SKILL,基于 NodeJS。

安装此 SKILL

npx skills add lyhue1991/tvsearch

获取 Tavily API Key

访问 https://tavily.com 注册账号并创建 API Key。

注:免费套餐每月 1000 次搜索额度。


作为 CLI 工具使用

安装

npm install -g @lyhue1991/tvsearch

快速开始

1. 配置 API Key

首先需要获取 Tavily API Key,访问 https://tavily.com 注册账号并创建 API Key。

然后通过以下方式之一配置:

方式一:环境变量

export TAVILY_API_KEY="tvly-your-api-key"

方式二:命令行配置

tvsearch config --set-api-key "tvly-your-api-key"

2. 执行搜索

# 基础搜索
tvsearch "人工智能"

# 指定结果数量
tvsearch "TypeScript 教程" --count 5

# 时间过滤
tvsearch "最新新闻" --freshness pd

# Markdown 格式输出
tvsearch "Node.js" --format markdown

使用说明

搜索命令

tvsearch <关键词> [选项]

| 选项 | 简写 | 说明 | |------|------|------| | --count <number> | -c | 返回结果数量 (1-50),默认 10 | | --format <format> | -f | 输出格式 (json/markdown/table),默认 json | | --freshness <value> | | 时间过滤 | | --depth <depth> | | 搜索深度 (basic/advanced),默认 basic | | --topic <topic> | | 搜索主题 (general/news),默认 general | | --api-key <key> | | 临时使用指定 API Key |

时间过滤参数

| 值 | 说明 | |----|------| | pd | 过去一天 | | pw | 过去一周 | | pm | 过去一月 | | py | 过去一年 | | YYYY-MM-DDtoYYYY-MM-DD | 自定义日期范围 |

配置命令

tvsearch config [选项]

| 选项 | 简写 | 说明 | |------|------|------| | --set-api-key <key> | | 保存 API Key | | --default-format <format> | | 设置默认输出格式 | | --default-count <number> | | 设置默认结果数量 | | --default-freshness <value> | | 设置默认时间范围 | | --show | -s | 显示当前配置 | | --reset | -r | 重置所有配置 |

配额查询命令

tvsearch usage [选项]

| 选项 | 说明 | |------|------| | --format <format> | 输出格式 (json/markdown/table),默认 json | | --api-key <key> | 临时使用指定 API Key |

查询 Tavily API 配额使用情况:

# 查看配额(JSON 格式)
tvsearch usage

# Markdown 格式
tvsearch usage --format markdown

# 表格格式
tvsearch usage --format table

示例

# 搜索最近一周的 AI 新闻
tvsearch "AI 新闻" --freshness pw --topic news --format markdown

# 高级搜索(更多结果)
tvsearch "深度学习" --depth advanced --count 20

# 表格格式输出
tvsearch "Python" --format table

# 查看当前配置
tvsearch config --show

# 设置默认值
tvsearch config --default-format markdown --default-count 15

输出格式

JSON 格式(默认)

[
  {
    "title": "结果标题",
    "url": "https://example.com",
    "content": "内容摘要...",
    "score": 0.95
  }
]

Markdown 格式

## 1. 结果标题
[https://example.com](https://example.com)

内容摘要...

**相关度**: 0.95

---

Table 格式

┌────┬──────────────────┬──────────────────────────────────┬──────────┐
│ #  │ 标题             │ 来源                              │ 相关度   │
├────┼──────────────────┼──────────────────────────────────┼──────────┤
│ 1  │ 结果标题         │ https://example.com              │ 0.95     │
└────┴──────────────────┴──────────────────────────────────┴──────────┘

配置优先级

  1. 命令行参数 --api-key
  2. 环境变量 TAVILY_API_KEY
  3. 配置文件中的 apiKey
  4. 配置文件中的默认值
  5. 内建默认值

注意事项

  • API 额度: Tavily 免费套餐每月 1000 次搜索
  • API Key 格式: 以 tvly- 开头
  • 搜索深度: advanced 消耗 2 credits,basic 消耗 1 credit

开发

# 安装依赖
npm install

# 编译
npm run build

# 测试
npm test

# 本地运行
node dist/index.js "test"

License

MIT