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

@guanghechen/kit-profile

v0.5.14

Published

Render shell environment variables from profile config

Readme

@guanghechen/kit-profile

从 profile 配置渲染 shell 环境变量脚本。

命令会先将脚本写入系统剪切板,再输出脚本文本;不会直接修改父 shell 环境。

使用方式

通过 kit 聚合命令:

kit profile --shell fish --profile agent:prod | source
kit profile --fish --profile agent:prod | source
eval "$(kit profile --shell bash --profile agent:prod)"
eval "$(kit profile --bash --profile agent:prod)"
kit profile --shell pwsh --profile agent:prod | Invoke-Expression
kit profile --pwsh --profile agent:prod | Invoke-Expression

通过独立命令:

kit-profile --shell fish --profile agent:prod | source
kit-profile --fish --profile agent:prod | source

参数

  • --profile <name[:variant]>: 必填,profile 选择器。
  • --shell <fish|bash|pwsh>: 可选,目标 shell。
  • --fish: 可选,--shell fish 的简写。
  • --bash: 可选,--shell bash 的简写。
  • --pwsh: 可选,--shell pwsh 的简写。
  • --set <key:value...>: 可选,模板变量(variadic,可重复,后者覆盖前者)。
  • --allow-env <key...>: 可选,显式放行默认拦截的危险 env key。

约束:

  • name 不允许包含 :/\,且不能为 ...
  • variant 不允许为空,且不允许包含 :

说明:

  • 不支持 --config 参数。
  • --shell--fish/--bash/--pwsh 至少需要提供一个。
  • --fish/--bash/--pwsh 同时只能出现一个。
  • 若剪切板写入失败,命令直接报错并退出。

配置路径

根据 <name> 自动查找以下配置文件:

  1. $XDG_CONFIG_HOME/kit/profile/<name>.profile.json(若设置)
  2. ~/.config/kit/profile/<name>.profile.json(默认)

配置结构

{
  "name": "agent",
  "envs": {
    "ANTHROPIC_BASE_URL": "http://localhost:${port}/api/claude"
  },
  "vars": {
    "port": 4747
  },
  "variants": {
    "prod": {
      "envs": {
        "NODE_ENV": "production"
      },
      "vars": {
        "port": 4747
      }
    }
  }
}

模板优先级:--set > variant.vars > profile.vars

显式指定 variant 时,最终 env:{ ...profile.envs, ...variant.envs }

输出脚本中的 env 按 key 名字典序排序。

JSON Schema

  • 本仓库路径:packages/profile/schema/profile.schema.json
  • 发布后路径:lib/schema/profile.schema.json
  • 线上 $idhttps://guanghechen.github.io/kit/schemas/profile/profile.schema.json

生成命令:pnpm -C packages/profile run schema:config

安全策略

  • 禁止危险对象键:__proto__constructorprototype
  • 默认拦截危险 env key:BASH_ENVENVPROMPT_COMMAND
  • 如确有需要,可通过 --allow-env 显式放行。