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

jarvis-ops-cli

v1.0.0

Published

One-stop dev & deploy CLI — cherry-pick, push, Jenkins deploy with interactive prompts

Downloads

27

Readme

jarvis-ops-cli

面向 Git 工作流与 Jenkins 部署的一站式命令行工具:合并或 cherry-pick 到目标分支、推送、触发构建并可选等待结果。支持交互式菜单与纯命令行子命令。

要求: Node.js ≥ 20

安装

npm install -g jarvis-ops-cli

安装后全局命令名为 jarvis-ops

验证:

jarvis-ops --help

配置

配置文件位置

配置保存在用户主目录下:

  • 路径: ~/.jarvis/devops.json(Windows 为 %USERPROFILE%\.jarvis\devops.json

首次使用前通过交互向导生成即可,也可手动编辑 JSON。

首次配置(推荐)

在项目仓库内或任意目录执行:

jarvis-ops config

或直接运行无参数命令进入交互菜单,在 Config → Add project 中添加项目:

| 项 | 说明 | |----|------| | Project name | 项目别名;默认建议为当前目录名 | | Repo path | 本地 Git 仓库根目录绝对路径;默认可用当前工作目录 | | Default target branch | Ship 时的目标分支,默认 develop | | Jenkins | 可选;填写 Jenkins 根 URL、job/.../job/... 形式的路径,以及凭证标签(对应下面 jenkins.users) |

配置结构说明

  • projects:项目名 → { repoPath, defaultTarget?, jenkins? }
    • jenkinsbaseUrl(无尾斜杠亦可)、jobPath(如 job/folder/job/jobName不要/view/...)、jenkinsUser(凭证键名)
  • jenkins.users:凭证键 → { user, token }(Jenkins 用户名与 API Token)
  • defaults.project:未在命令行指定且无法从当前目录匹配时的默认项目名

项目匹配: 在已配置的 repoPath 下执行命令时,会自动选中对应项目;也可用 -p / --project <name> 显式指定。

使用方式

交互式菜单(默认)

不带任何参数启动:

jarvis-ops

可切换项目、执行 Ship(merge / cherry-pick)、Deploy、Status、进入 Config 等。

子命令一览

| 命令 | 说明 | |------|------| | jarvis-ops ship | 将当前分支 merge 到目标分支 → push →(可选)Jenkins 部署 | | jarvis-ops ship --cherry-pick | 改为 cherry-pick 选定提交到目标分支,再 push → 部署 | | jarvis-ops deploy | 仅触发 Jenkins 构建 | | jarvis-ops status <编号> | 查询指定构建号的状态 | | jarvis-ops config | 交互式管理项目与 Jenkins 凭证 |

ship 常用选项

-t, --target <branch>   目标分支(覆盖项目默认)
-p, --project <name>    配置中的项目名
-y, --yes               跳过部分确认(如 cherry-pick 选择)
--cherry-pick           cherry-pick 模式(可配合 -n 预选最近 N 条)
-n, --count <n>         与 --cherry-pick 合用:非交互时直接选最近 N 个提交
--no-deploy             不触发 Jenkins
--no-push               不 push(也不部署)
--no-wait               触发后不等待 Jenkins 构建结束
--stay                  完成后留在目标分支
--dry-run               仅预览,不执行 git / 请求

deploy / status

jarvis-ops deploy -p my-project -y
jarvis-ops status 42 -p my-project

Jenkins 说明

  • baseUrl:Jenkins 站点根地址,例如 https://jenkins.example.com(须与你在浏览器访问的根一致)。
  • jobPath:REST API 使用的路径,与 UI 地址栏中 /job/... 部分一致,多级文件夹则为 job/a/job/b/job/c 形式。
  • 凭证使用 API Token(非登录密码),在 Jenkins 用户设置中生成。

若未配置 Jenkins 或凭证错误,deploy / ship 中部署步骤会失败并提示检查 jarvis-ops config~/.jarvis/devops.json

故障排查

  • no project specified or detected
    当前目录不是已配置的仓库路径,或未设置 defaults.project。执行 jarvis-ops config 添加项目,或使用 -p

  • Jenkins not configured
    该项目未配置 jenkins 块,或 jenkins.users 中缺少对应用户的 user/token

  • 合并 / cherry-pick 冲突
    交互菜单中会提示 Continue(git add 后继续)或 Abort;请按终端说明处理。

开源协议

MIT