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

@icoolaw/cli

v0.1.1

Published

CLI tool for icoolaw projects

Readme

iCoolaw CLI 使用指南

iCoolaw CLI 是一个强大的命令行工具,用于简化开发流程和项目管理。

安装

npm install -g @icoolaw/cli

基本用法

icoolaw <command> [options]

Config 配置管理

Config 命令用于管理 CLI 工具的配置项,支持查看、设置、删除和重置配置。

基本语法

icoolaw config <sub-command> [options]

子命令

1. 查看配置 (list)

显示当前所有配置项及其值:

icoolaw config list

输出示例:

===================== 配置项详情 ======================
当前配置:

registry         https://registry.npmjs.org/ (默认) # NPM 包注册表地址
gitlabUrl        http://172.16.8.35:9980 (默认) # GitLab 服务器地址
gitlabToken      null (默认) # GitLab 访问令牌
packageManager   yarn (自定义) # 包管理工具 (npm, yarn, pnpm)

配置文件位置: /Users/username/.icoolawrc

2. 设置配置 (set)

设置指定配置项的值:

icoolaw config set <key> [value]

参数说明:

  • key: 配置项名称
  • value: 配置项值(可选,如果不提供将进入交互式输入)

示例:

# 设置 NPM 注册表地址
icoolaw config set registry https://registry.npm.taobao.org/

# 设置 GitLab 服务器地址
icoolaw config set gitlabUrl https://gitlab.example.com

# 设置包管理工具
icoolaw config set packageManager pnpm

# 交互式设置(不提供 value 参数)
icoolaw config set gitlabToken

3. 删除配置 (unset)

删除指定的配置项,恢复为默认值:

icoolaw config unset <key>

示例:

# 删除自定义的注册表配置,恢复默认值
icoolaw config unset registry

# 删除 GitLab Token
icoolaw config unset gitlabToken

4. 重置配置 (reset)

重置所有配置项为默认值:

icoolaw config reset

注意: 此操作会删除所有自定义配置,请谨慎使用。

可用的配置项

| 配置项 | 描述 | 默认值 | 示例值 | |--------|------|--------|--------| | registry | NPM 包注册表地址 | https://registry.npmjs.org/ | https://registry.npm.taobao.org/ | | gitlabUrl | GitLab 服务器地址 | http://172.16.8.35:9980 | https://gitlab.example.com | | gitlabToken | GitLab 访问令牌 | null | glpat-xxxxxxxxxxxxxxxxxxxx | | packageManager | 包管理工具 | npm | npm, yarn, pnpm |

配置文件

配置信息存储在用户主目录下的 .icoolawrc 文件中:

  • macOS/Linux: ~/.icoolawrc
  • Windows: %USERPROFILE%\.icoolawrc

配置文件采用 JSON 格式:

{
  "registry": "https://registry.npm.taobao.org/",
  "packageManager": "yarn",
  "gitlabUrl": "https://gitlab.example.com",
  "gitlabToken": "glpat-xxxxxxxxxxxxxxxxxxxx"
}

敏感信息处理

为了安全考虑,敏感配置项(如 gitlabToken)在显示时会进行脱敏处理:

gitlabToken      ***xxxx (自定义) # GitLab 访问令牌

交互式配置

当使用 icoolaw config set <key> 而不提供 value 参数时,CLI 会进入交互式模式:

$ icoolaw config set gitlabToken
? 请输入 GitLab 访问令牌: [hidden]
✓ 配置项 gitlabToken 已设置

配置验证

CLI 会对配置值进行验证:

  • registry: 必须是有效的 URL
  • gitlabUrl: 必须是有效的 URL
  • packageManager: 必须是 npmyarnpnpm 之一
  • gitlabToken: 必须是非空字符串

常见用法示例

# 查看当前配置
icoolaw config list

# 设置淘宝镜像
icoolaw config set registry https://registry.npm.taobao.org/

# 设置使用 pnpm 作为包管理工具
icoolaw config set packageManager pnpm

# 交互式设置 GitLab Token
icoolaw config set gitlabToken

# 重置所有配置
icoolaw config reset

获取帮助

使用以下命令获取帮助信息:

# 查看所有可用命令
icoolaw --help

# 查看 config 命令帮助
icoolaw config

更多功能和命令正在开发中,敬请期待!