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

foco-cli

v0.8.1

Published

FOCO CLI - 题库管理与工单管理命令行工具

Downloads

3,316

Readme

FOCO CLI

FOCO 备考平台的命令行工具,供团队成员通过终端或 AI 编码工具(Cursor、Claude Code 等)调用。

安装

npm install -g foco-cli

登录

# 本地开发服务器登录
foco login --dev

# 指定服务器地址
foco login https://your-foco-server.com

# 查看登录状态
foco auth status

# 登出
foco auth logout

登录成功后凭证存储在 ~/.foco/config.json

命令参考

认证管理

| 命令 | 说明 | |------|------| | foco login [--dev] | 登录(--dev 使用 localhost:3001) | | foco auth status | 查看登录状态 | | foco auth logout | 登出 |

题库管理 (banks)

| 命令 | 说明 | |------|------| | foco banks list [--status <status>] [--exam-id <id>] [--keyword <kw>] | 查看题库列表 | | foco banks show <id> | 查看题库详情 |

status 可选值:draft | published | archived

题目管理 (questions)

| 命令 | 说明 | |------|------| | foco questions list [--bank-id <id>] [--type <type>] [--difficulty <1-5>] | 查看题目列表 | | foco questions show <id> | 查看题目详情 |

type 可选值:single_choice | multiple_choice | true_false | fill_blank | short_answer

考试管理 (exams)

| 命令 | 说明 | |------|------| | foco exams list | 查看考试列表 | | foco exams show <id> | 查看考试详情 | | foco exams create --code <code> --name <name> | 创建考试 | | foco exams update <id> [--name <name>] [--is-visible <bool>] | 更新考试 | | foco exams delete <id> | 删除考试 |

大纲管理 (syllabi)

| 命令 | 说明 | |------|------| | foco syllabi list [--exam-id <id>] | 查看大纲列表 | | foco syllabi show <id> | 查看大纲详情 | | foco syllabi create --exam-id <id> --name <name> | 创建大纲 | | foco syllabi update <id> [--name <name>] | 更新大纲 | | foco syllabi delete <id> | 删除大纲 |

知识点管理 (knowledge-points)

| 命令 | 说明 | |------|------| | foco knowledge-points list [--bank-id <id>] [--type <type>] | 查看知识点列表 | | foco knowledge-points create --bank-id <id> --type <type> --title <t> --content <c> | 创建知识点 | | foco knowledge-points update <id> [--title <t>] [--content <c>] | 更新知识点 | | foco knowledge-points delete <id> | 删除知识点 |

type 可选值:qa | knowledge | summary_note

工单管理 (issues)

| 命令 | 说明 | |------|------| | foco issues list [--status <s>] [--priority <p>] [--assignee-id <id>] [--search <kw>] | 查看工单列表 | | foco issues show <id> | 查看工单详情 | | foco issues create --title <title> [options] | 创建工单 | | foco issues update <id> [options] | 更新工单 | | foco issues comment <id> -m <text> | 添加评论 |

status 可选值backlog | todo | in_progress | done | cancelled

priority 可选值urgent | high | medium | low | none

创建工单示例

# 基本创建
foco issues create --title "修复登录页 bug"

# 完整参数
foco issues create \
  --title "知识点模块开关" \
  --description "按题库配置显示哪些模块" \
  --priority high \
  --labels "frontend,backend" \
  --assignee-id 2 \
  --due-date 2026-06-01

查找指派人 IDfoco admins list

项目管理 (projects)

| 命令 | 说明 | |------|------| | foco projects list | 查看项目列表 | | foco projects show <id> | 查看项目详情 | | foco projects create --name <name> --slug <slug> | 创建项目 | | foco projects update <id> [--name <name>] | 更新项目 | | foco projects delete <id> | 删除项目 |

每日站会 (huddles)

| 命令 | 说明 | |------|------| | foco huddles list [--date <YYYY-MM-DD>] [--author-id <id>] | 查看日报列表 | | foco huddles show <id> | 查看日报详情 | | foco huddles create --date <YYYY-MM-DD> --content '<json>' | 创建日报 | | foco huddles update <id> --content '<json>' | 更新日报 | | foco huddles delete <id> | 删除日报 |

content 格式:[{"sectionName":"今日工作","content":"..."}]

知识库 (knowledge-base)

| 命令 | 说明 | |------|------| | foco knowledge-base list [--category <cat>] | 查看文档列表 | | foco knowledge-base show <id> | 查看文档详情 | | foco knowledge-base create --title <t> --slug <s> [--content <c>] | 创建文档 | | foco knowledge-base update <id> [--content <c>] | 更新文档 | | foco knowledge-base delete <id> | 删除文档 |

category 可选值:culture | product | tech | ops | management | general

帮助文章 (help-articles)

| 命令 | 说明 | |------|------| | foco help-articles list | 查看文章列表 | | foco help-articles show <id> | 查看文章详情 | | foco help-articles create --title <t> --slug <s> | 创建文章 | | foco help-articles update <id> | 更新文章 | | foco help-articles delete <id> | 删除文章 |

讨论管理 (threads)

| 命令 | 说明 | |------|------| | foco threads list [--status <s>] | 查看讨论列表 | | foco threads show <id> | 查看讨论详情 | | foco threads update <id> --status <s> | 更新讨论状态 | | foco threads reply <id> -m <text> | 回复讨论 |

status 可选值:open | resolved | closed

反馈管理 (feedback)

| 命令 | 说明 | |------|------| | foco feedback list [--state <s>] [--labels <l>] | 查看反馈列表 | | foco feedback show <number> | 查看反馈详情 | | foco feedback create --title <t> | 创建反馈 | | foco feedback update <number> [--state <s>] | 更新反馈 |

商品管理 (products)

| 命令 | 说明 | |------|------| | foco products list [--product-type <type>] | 查看商品列表 | | foco products show <id> | 查看商品详情 | | foco products create --product-type <type> --ref-id <id> --title <t> | 创建商品 | | foco products update <id> | 更新商品 | | foco products delete <id> | 删除商品 |

product-type 可选值:bank | material

资源包管理 (resource-packs)

| 命令 | 说明 | |------|------| | foco resource-packs list [--bank-id <id>] | 查看资源包列表 | | foco resource-packs show <id> | 查看资源包详情 | | foco resource-packs create --title <t> | 创建资源包 | | foco resource-packs update <id> | 更新资源包 | | foco resource-packs delete <id> | 删除资源包 |

激活码管理 (activation-codes)

| 命令 | 说明 | |------|------| | foco activation-codes list [--batch-no <no>] | 查看激活码列表 | | foco activation-codes create-batch --sku-id <id> --count <n> | 批量生成激活码 |

管理员管理 (admins)

| 命令 | 说明 | |------|------| | foco admins list | 查看管理员列表(用于查找指派人 ID) | | foco admins show <id> | 查看管理员详情 | | foco admins create --username <u> --password <p> | 创建管理员 | | foco admins update <id> [--display-name <n>] | 更新管理员 |

开发日志 (changelogs)

| 命令 | 说明 | |------|------| | foco changelogs list | 查看日志列表 | | foco changelogs create --date <YYYY-MM-DD> --content <md> | 创建日志 | | foco changelogs update <id> --content <md> | 更新日志 |

用户管理 (users)

| 命令 | 说明 | |------|------| | foco users list [--keyword <kw>] | 查看用户列表 |

订单管理 (orders)

| 命令 | 说明 | |------|------| | foco orders list [--status <s>] | 查看订单列表 |

仪表盘 (dashboard)

| 命令 | 说明 | |------|------| | foco dashboard overview [--range <7d|30d>] | 总览数据 | | foco dashboard learning [--range <7d|30d>] | 学习数据 | | foco dashboard products [--range <7d|30d>] | 商品数据 |

统计 (stats)

| 命令 | 说明 | |------|------| | foco stats | 查看统计数据 |

输出格式

所有命令输出结构化 JSON:

{ "status": "ok", "data": { ... } }

错误时输出到 stderr,返回非零退出码。

开发

cd cli
npm run dev       # tsx 热重载开发
npm run build     # TypeScript 编译

发布

cd cli
# 修改 package.json 中的 version
npm run dist      # build + pack
npm publish --access public --registry https://registry.npmjs.org/
npm install -g /path/to/cli