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

@optima-chat/gateway-cli

v0.1.0

Published

Optima Gateway 的本地命令行客户端。登录一次,本地全用:**A 路**对话式(经 gateway)、**B 路**直调工具(scout / commerce 等),共用 `~/.optima/token.json`。命令名 `gateway`。

Readme

@optima-chat/gateway-cli

Optima Gateway 的本地命令行客户端。登录一次,本地全用:A 路对话式(经 gateway)、B 路直调工具(scout / commerce 等),共用 ~/.optima/token.json。命令名 gateway

安装

npm i -g @optima-chat/gateway-cli

⚠️ 与老 @optima-chat/optima-agent 共存时:本包自带 scout / commerce 两个 bin,与 optima-agent 同名(指向同一个底层工具包)。若你同时装着 optima-agent,首次安装用 --force 覆盖这两个符号链接:

npm i -g @optima-chat/gateway-cli --force

是「后写者赢」:之后再更新 optima-agent 会把 scout/commerce 翻回它那份;想让本包的工具当前,随时 npm i -g @optima-chat/gateway-cli --force 重跑即可(依赖是 latest,每次拉最新)。gateway-cli 的主命令 gateway 与 optima-agent 的 optima 不冲突,两者可并存。

登录(设备流,支持 CN)

gateway login -e cn-prod     # 或 cn-stage / prod / stage
gateway whoami               # 看当前身份 / env / gateway / 过期

A 路:对话式(自动连对应环境 gateway,用登录票)

gateway chat
gateway ask "查最近订单"
gateway chat -e cn-stage     # 显式切环境

覆盖:--ws-url / --token / --url

B 路:本地直调工具(自解析 token.json 的 env 选后端)

scout <...>
commerce <...>

环境 → gateway 表

| env | gateway | |---|---| | cn-prod | wss://gw.yzsgo.com | | cn-stage | wss://gw.stage.optima.chat | | stage | wss://gw.stage.optima.onl | | prod | wss://gw.optima.onl |

Caveats

  • 跨环境混用会被拒-e <env> 只是选择要连的 gateway,并不会用它去校验/切换 token.json 里已登录的 env。如果你的 token.json 是登录到 A 环境的票,却用 -e B 指向 B 环境的 gateway,B 会拒绝这张签名对不上的 token(报错通常是 "Signature verification failed")。
    • 想切到某个 env:先 gateway login -e <env> 重新登录换票。
    • --env/-e 只用于「你的 token.json 本来就已经是那个 env 签发的」这种场景(例如显式声明、跳过从文件推断)。