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

nikou-node

v1.0.1

Published

Nikou OPS CLI 工具

Downloads

118

Readme

Nikou CLI 安装与使用指南

Nikou CLI 提供 oc / nb / am / nb-init / project-info / sonar / fbd 等一系列发布与运维脚本,现已发布到 npm,支持一行指令完成安装。

一键安装

npm install -g nikou-node

安装过程中会自动执行 postinstall 脚本,设置可执行权限并写入全局 Git Hook。安装完成后可以直接运行以下命令:

oc -h
nb -h
am -h
nacos-config -h
nb-init
project-info path
cc list
sonar -h
fbd

提示:首次安装后依旧建议执行一次 nb-init,用于配置 OPS 所需的账号、插件以及 token。后续若需重新配置,也可单独运行 nb-init

升级 / 卸载

  • 升级到最新版本:npm update -g nikou-node
  • 卸载 CLI:npm uninstall -g nikou-node

升级后如需刷新 OPS 配置,可再次执行 nb-init

开发者调试

若需要在本地调试源码,可继续使用传统方式:

  1. 拉取仓库并安装依赖

    git clone https://gitee.com/vangelisx/nikou-node.git
    cd nikou-node
    npm install
  2. 赋予入口脚本执行权限并进行本地调试

    chmod +x router.js
    node router.js nb --help
  3. 如需手动全局链接,可执行:

    sudo ln -sf $(pwd)/router.js /usr/local/bin/oc
    sudo ln -sf $(pwd)/router.js /usr/local/bin/nb
    sudo ln -sf $(pwd)/router.js /usr/local/bin/am
    sudo ln -sf $(pwd)/router.js /usr/local/bin/nb-init
    sudo ln -sf $(pwd)/router.js /usr/local/bin/nacos-config
    sudo ln -sf $(pwd)/router.js /usr/local/bin/sonar
    sudo ln -sf $(pwd)/router.js /usr/local/bin/codex-cc
    sudo ln -sf $(pwd)/router.js /usr/local/bin/app-log
    sudo ln -sf $(pwd)/router.js /usr/local/bin/fbd
    sudo ln -sf $(pwd)/router.js /usr/local/bin/app-config
    sudo ln -sf $(pwd)/router.js /usr/local/bin/vops
    sudo ln -sf $(pwd)/router.js /usr/local/bin/xxl
    sudo ln -sf $(pwd)/router.js /usr/local/bin/ai-hook

常见问题

  • am 命令需要在 PATH 中可执行,若通过全局 Hook 调用可直接使用 /usr/local/bin/am 等绝对路径。
  • 如果在 push 时希望在 am 失败后中断,可在 pre-push 钩子中增加 am || exit 1
  • project-info pull 在 npm 全局安装模式下不会直接修改 npm 包,若需升级请执行 npm update -g nikou-node

代理配置(全局生效)

当公司网络或本机需要通过代理访问内网服务时,可通过环境变量让 CLI 全部请求走代理(支持 HTTP 与 SOCKS):

macOS / Linux:

export NIKOU_PROXY=http://127.0.0.1:7897
# 或 SOCKS5
export NIKOU_PROXY=socks5://127.0.0.1:7897

Windows PowerShell:

$env:NIKOU_PROXY="http://127.0.0.1:7897"
# 或 SOCKS5
$env:NIKOU_PROXY="socks5://127.0.0.1:7897"

如需长期生效,请将 NIKOU_PROXY=... 写入 ~/.zshrc / ~/.bashrc 或 Windows 用户环境变量。 也可使用 HTTPS_PROXY / HTTP_PROXY / ALL_PROXY 作为兼容配置。

VPN DNS 直连(可选,默认关闭)

当系统 DNS 缓存与 VPN 内网解析不一致时(浏览器可访问但 CLI 返回 403),可开启“VPN DNS 直连”模式,让 CLI 对公司域名使用 VPN 的 DNS 服务器解析,避免被公网解析劫持。

macOS / Linux:

# 强制开启 VPN DNS 直连(默认关闭)
export NIKOU_FORCE_VPN=1
# 可选:指定 VPN DNS 服务器(默认尝试自动发现)
export NIKOU_DNS=192.168.90.183
# 可选:补充公司域名后缀(逗号分隔)
export NIKOU_DNS_DOMAINS="vbkrhk.com,vbkr.com,hszq8.com,hstong.com,hszq.com.cn,hashkeydev.com"

Windows PowerShell:

$env:NIKOU_FORCE_VPN="1"
$env:NIKOU_DNS="192.168.90.183"
$env:NIKOU_DNS_DOMAINS="vbkrhk.com,vbkr.com,hszq8.com,hstong.com,hszq.com.cn,hashkeydev.com"

如需长期生效,请将上述环境变量写入 ~/.zshrc / ~/.bashrc 或 Windows 用户环境变量。

cc 命令(Claude 快捷配置)

cc 用于快速切换 Claude 所需的环境变量,并自动启动 Claude 客户端:

  • cc add <名称> <Anthropic Base URL> <API Token>:写入配置,存储在 ~/.cc/settings.json,名称不可重复。
  • cc list:查看所有可用配置,Token 仅显示部分内容方便确认。
  • cc <名称> [Claude 参数]:以指定配置设置 ANTHROPIC_BASE_URLANTHROPIC_AUTH_TOKEN 后立即执行 Claude 命令。

示例:

app-config 命令(查询/修改配置)

app-config 用于查询并交互式修改 OPS 后台的 app-config 配置(当前仅支持修改 cvalue)。

  • 查询(默认 feature,默认取前 10 条):
    • app-config
    • app-config CRM_SETTLEMENT_SWITCH
  • 指定环境:
    • app-config -f <ckey>:feature
    • app-config -u <ckey>:uat
    • app-config -d <ckey>:daily(会映射到 uat)
  • 修改规则:
    • cvalue 为 JSON:进入系统编辑器(默认 vi;可通过 VISUAL/EDITOR 指定如 code --wait),保存后自动压缩成单行再提交
    • cvalue 非 JSON:控制台单行输入并提交
    • 查询输出会展示 状态(正常/禁用),并对状态做颜色区分

旧版安装脚本(可选)

依然可以使用历史脚本完成 git 克隆与链接操作:

node -e "const https=require('https');const fs=require('fs');const {tmpdir}=require('os');const path=require('path');const {pathToFileURL}=require('url');const url='https://gitee.com/vangelisx/nikou-node/raw/main/bin/init.js';const tmp=path.join(tmpdir(),'nikou-init-'+Date.now()+'.mjs');https.get(url,res=>{if(res.statusCode!==200){console.error('下载失败: '+res.statusCode);res.resume();process.exit(1);}const chunks=[];res.on('data',c=>chunks.push(c));res.on('end',()=>{fs.writeFileSync(tmp,Buffer.concat(chunks));import(pathToFileURL(tmp).href).then(mod=>{const fn=mod.init||mod.default;if(typeof fn!=='function'){throw new Error('脚本未导出 init 方法');}return fn();}).then(()=>{},err=>{console.error(err);process.exit(1);});});}).on('error',err=>{console.error(err);process.exit(1);});"