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

@nandemo-agent/treebuy-cli

v0.1.1

Published

小樹購 CLI — treebuy.com 命令列工具

Readme

treebuy-cli — 小樹購 CLI

命令列工具,用於存取 treebuy.com 的 API。

安裝

推薦:使用 npm 全域安裝(固定版本)

npm install -g @nandemo-agent/[email protected]

或使用 npx(無需全域安裝)

npx @nandemo-agent/[email protected] <command>

開發用途(本地 clone)

git clone https://github.com/nandemo-agent/treebuy-cli.git
cd treebuy-cli
npm install
npm link  # 建立 global symlink

💡 為什麼固定版本?

  • 確保行為穩定,避免 breaking changes
  • 方便 audit 與 security review
  • 明確知道使用哪個版本的功能與 schema

如需最新版本,請查看 npm package 頁面

使用方式

# 列出所有 Featured Campaign
treebuy-cli featured list

# 只看 featured 類型
treebuy-cli featured list --kind featured

# 只看 topic 類型
treebuy-cli featured list --kind topic

# 輸出 JSON array
treebuy-cli featured list --json

# 輸出 NDJSON(每行一筆,agent / pipe 友好)
treebuy-cli featured list --ndjson

# 只取特定欄位(僅 products.*,減少 context 負擔)
treebuy-cli featured list --fields sku,title

# 自訂 API timeout(毫秒)
treebuy-cli featured list --timeout 8000

# 組合使用
treebuy-cli featured list --kind topic --ndjson --fields sku,title

Agent 使用提示

  • 預設 stdout 非 TTY 時自動輸出 NDJSON(可用 --json 強制 JSON array)
  • 使用 --fields 減少回應大小,避免 context window 浪費(僅作用於 products
  • 錯誤訊息輸出至 stderr,不影響 stdout 解析
  • 支援 --timeout 控制 API 超時
  • API 端點:https://v2api.treebuy.com

指令結構

treebuy-cli
└── featured
    └── list [--kind featured|topic] [--json] [--fields <欄位>]

搜尋指令

# 搜尋商品
treebuy-cli search products "Dyson"

# 分頁
treebuy-cli search products "Dyson" --page 2 --limit 10

# 排序(rank / price_asc / price_desc / new)
treebuy-cli search products "Dyson" --sort-by price_asc

# JSON 輸出(含 pagination)
treebuy-cli search products "Dyson" --json

# NDJSON(每筆一行,agent/pipe 友好)
treebuy-cli search products "Dyson" --ndjson

# 指定欄位
treebuy-cli search products "Dyson" --fields id,name,selling_price,in_stock

# 組合
treebuy-cli search products "Dyson" --limit 5 --sort-by price_asc --fields id,name,selling_price --ndjson

Agent Skills

透過 npx skills 分項安裝:

# Featured Campaign 技能
npx skills add https://github.com/nandemo-agent/treebuy-cli --skill treebuy-featured

# 搜尋商品技能
npx skills add https://github.com/nandemo-agent/treebuy-cli --skill treebuy-search

Skills 位於 skills/ 目錄(canonical),不要建立平行的 skill/ 結構。