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

cannlab-ssh

v0.2.0

Published

无需 VS Code,直接通过终端连接 CANNLab CPU/NPU 开发环境

Readme

npussh

npm version

无需安装 VS Code,直接在系统终端中连接 CANNLab CPU/NPU 开发环境。

主命令为 npussh,同时保留 cannlab-ssh 作为兼容命令。

功能

  • 使用系统浏览器完成 GitCode OAuth 登录
  • 查看当前账号下的 CANNLab 环境
  • 通过 SSH 连接运行中的 CPU/NPU 环境
  • 使用接近原生 ssh 的参数、远程命令、管道和端口转发
  • 使用 npuscp、npusftp、npursync 上传和下载文件
  • 自动下载并运行 AtomGit Dev Space 官方连接 helper
  • 安全保存登录凭据,不在项目目录写入 Token 或 SSH 私钥
  • SSH 退出后自动删除临时私钥并关闭端口转发

支持的平台

| 平台 | 状态 | 登录凭据存储 | |---|---|---| | macOS | 已实机验证 | macOS Keychain | | Linux 桌面 | 已适配,未实机验证 | Secret Service(secret-tool) | | WSL2 | 已适配,未实机验证 | Windows DPAPI 加密文件 | | 原生 Windows | 暂不支持 | - |

Linux 桌面和 WSL2 已通过自动化测试及 Linux 容器验证,但尚未在真实设备上完成端到端连接验证。

安装

需要 Node.js 20+、OpenSSH 客户端和 unzip。使用 npursync 时,本地和远端环境都需要安装 rsync。

npm install -g cannlab-ssh
npussh --help

无需克隆代码仓,也无需执行 npm link。

Ubuntu/Debian 桌面还需要:

sudo apt install openssh-client unzip libsecret-tools xdg-utils rsync

WSL2 内需要:

sudo apt install openssh-client unzip rsync

WSL2 还应启用 Windows 程序互操作,确保可以执行 powershell.exe。登录时会打开 Windows 默认浏览器。

使用方法

首次使用先登录:

npussh login

查看环境:

npussh list

像普通 SSH 一样连接环境:

npussh <环境名称或 ID>

原来的 connect 命令仍然兼容:

npussh connect <环境名称或 ID>

执行远程命令:

npussh <环境名称或 ID> uname -a

通过管道执行本地脚本:

cat script.sh | npussh -T <环境名称或 ID> bash -s

使用 SSH 端口转发:

npussh -L 8080:127.0.0.1:80 -N <环境名称或 ID>

进入远端后查看 NPU 信息:

npu-smi info

断开 SSH:

exit

删除本地登录凭据:

npussh logout

文件传输

上传文件或目录:

npuscp local.txt <环境名称或 ID>:/workspace/
npuscp -r local-dir <环境名称或 ID>:/workspace/

下载文件或目录:

npuscp <环境名称或 ID>:/workspace/result.txt ./
npursync -av <环境名称或 ID>:/workspace/output/ ./output/

增量同步到远端:

npursync -av --delete ./project/ <环境名称或 ID>:/workspace/project/

打开 SFTP:

npusftp <环境名称或 ID>

常见问题

  • 3000 端口被占用:停止占用该端口的程序,再执行 npussh login。
  • Linux 提示缺少 secret-tool:安装 libsecret-tools,并确认桌面密钥环已解锁。
  • WSL2 没有打开浏览器:确认 powershell.exe 可执行;终端也会输出可手动打开的授权地址。
  • 环境不在“运行中”状态:先在 CANNLab 页面启动环境,再执行 npussh connect。

卸载

npussh logout
npm uninstall -g cannlab-ssh

连接流程、凭据生命周期、平台适配和安全边界见 实现原理。