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

@autolabz/ftc-cli

v1.0.2

Published

FTC CLI 是一个用于管理和调用 FTC (Function Tool Call) 资源的命令行工具。它允许你通过设备流 (Device Flow) 进行身份验证,管理全局 FTC 资源,并列出或调用可用的工具。

Downloads

384

Readme

FTC CLI (@autolabz/ftc-cli)

FTC CLI 是一个用于管理和调用 FTC (Function Tool Call) 资源的命令行工具。它允许你通过设备流 (Device Flow) 进行身份验证,管理全局 FTC 资源,并列出或调用可用的工具。

安装

你可以通过 npmpnpm 全局或在项目中安装此 CLI 工具:

# 全局安装
pnpm add -g @autolabz/ftc-cli

# 本地安装
pnpm add @autolabz/ftc-cli

也可以不安装,直接通过 npx 运行(假设已发布或在本地环境配好了路径):

npx @autolabz/ftc-cli <command>

命令指南

1. 登录 (login)

通过 Logto 的设备流 (Device Flow) 进行身份验证,并将配置保存在本地。

ftc login [options]

选项:

  • --endpoint <url>: 指定 Logto OIDC 的 Endpoint。
  • --client-id <id>: 指定 Logto 应用的 Client ID。
  • --api-base <url>: 默认的 FTC API Base URL,将保存在本地配置中。

2. 资源管理 (resource)

管理全局的 FTC 资源配置。

ftc resource <action> [arg1] [arg2]

操作 (action):

  • add <url>: 添加一个新的资源 URL。
  • rm <url>: 移除一个已配置的资源 URL。
  • list: 列出当前所有已配置的资源和别名。
  • alias <name> <url>: 为资源 URL 设置一个别名,同时也将其添加到资源列表中。
  • unalias <name>: 删除指定的别名。

3. 远程技能市场 (market)

管理远程技能市场,浏览、安装和卸载远程技能。技能名称遵循 ftc-xxx 格式,安装后自动创建别名 xxx(即去掉 ftc- 前缀),并对应一个 FTC 资源 URL。

ftc market <action> [arg]

操作(action):

  • set <url>: 设置远程技能市场的根 URL。
  • list: 列出远程市场中所有可用的技能。
  • install <name>: 安装指定技能(如 ftc-work-records)。会将技能文件下载到本地 ~/.ftc/skills/<name>/ 目录,并自动执行 ftc resource alias <alias> <url>。别名为技能名称去掉 ftc- 前缀。
  • uninstall <name>: 卸载指定技能。会删除本地技能目录,并自动执行 ftc resource unalias <alias>

远程市场结构:

{marketUrl}/
├── index.json              # [{name: "ftc-xxx", version: "1.0.0", description: "...", url: "https://..."}, ...]
└── ftc-xxx/
    ├── skill.json          # {name, description, url, version, files: [..., ...]}
    ├── SKILL.md
    └── ...                 # 其他 skill 文件,由 skill.json 的 files 字段列出

示例:

# 设置远程市场
ftc market set https://example.com/skills

# 查看可用技能
ftc market list

# 安装技能 (自动创建别名 work-records)
ftc market install ftc-work-records

# 卸载技能 (自动删除别名)
ftc market uninstall ftc-work-records

4. 列出工具 (list)

列出给定 FTC 服务端上所有可用的工具。你可以使用 --url 选项或者直接传入配置好的别名。

ftc list [aliasOrUrl] [options]

示例:

# 使用配置的别名
ftc list db_service

# 使用完整 URL
ftc list https://wiselake-db.apiservice.autolab-server.site

选项:

  • --url <url>: 指定 FTC API 的 Base URL(如果未传入别名或在本地配置中设置,可使用此选项覆盖)。
  • --token <token>: 指定访问令牌(将绕过本地的身份验证配置)。

5. 调用工具 (call)

通过标准输入 (stdin) 调用特定的 FTC 工具。

ftc call [aliasOrUrl] [options]

示例:

# 使用配置好的别名调用
echo '{"tool": "list_resources", "args": {"source_type": ["email"], "limit": 20}}' | ftc call wiselake-db

# 使用选项 --url 调用
echo '{"tool": "list_resources", "args": {"source_type": ["email"], "limit": 20}}' | ftc call --url "https://wiselake-db.apiservice.autolab-server.site"

选项:

  • --url <url>: 指定 FTC API 的 Base URL(如果未传入别名)。
  • --token <token>: 指定访问令牌(将绕过本地的身份验证配置)。

注意: 具体的工具名称和参数需要通过标准输入 (stdin) 传递,通常为 JSON 格式。

全局选项

  • -h, --help: 显示帮助信息
  • -v, --version: 显示版本号 (当前为 1.0.0)

开发与构建

本项目使用 TypeScript 编写,并使用 tsup 进行打包,使用 tsx 进行开发环境运行。

# 安装依赖
pnpm install

# 本地开发运行
pnpm run dev <command>

# 构建生产版本
pnpm run build

#发布
pnpm publish --access public --no-git-checks