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

@360safe/safe-cli

v1.0.0

Published

360 Safe CLI Tool - Terminal interface for 360 Safe client

Readme

@360safe/safe-cli

360 安全卫士终端 CLI 工具,为 AI Agent 提供系统清理、修复、优化和软件管理能力。

安装

npm install -g @360safe/safe-cli

安装完成后,工具会自动检测已安装的 Agent 平台(Claude Code、Cursor、Windsurf 等),并将内置 Skills 分发到对应目录。

使用

# 查看版本
safe --version
safe -v

# 查看帮助
safe --help
safe -h

# 初始化/安装客户端
safe --setup

# 查看客户端状态
safe --status

# 电脑清理
safe clean              # 一键清理全部
safe clean_junk         # 只清理垃圾
safe clean_traces       # 只清理痕迹

# 优化加速
safe bootspeed          # 开机慢、开机加速
safe netspeed           # 网速慢、网络优化、网速加速
safe performancespeed   # 电脑卡、性能优化、运行加速
safe win11speed         # Win11 优化、Win11 加速
safe optimize           # 一键优化全部

# 软件管家
software search "微信"
software search "微信" 10
software list
software list --system
software install 103595847
software uninstall A1B2C3

# 手动分发 Skills
safe skills

输出格式

所有命令输出 JSON 到 stdout,错误输出 stderr。

成功

{"status": "success", "data": { ... }}

需手动完成(非静默安装)

{"status": "manual_required", "data": {"name": "...", "message": "..."}}

错误(stderr)

{"code": "client_not_installed", "message": "client is not installed", "fix": "run 'safe setup' to install"}

退出码

  • 0 - 成功(含 manual_required)
  • 1 - 一般失败
  • 2 - 用法错误

WSL 支持

本项目支持在 WSL (Windows Subsystem for Linux) 环境下运行,执行链路分为两层:

  1. 安装期桥接(postinstall)

    • 执行 scripts/wsl-bridge.sh
    • bat/*.bat 复制到 Windows 用户目录下(%USERPROFILE%\AppData\Local\safe-cli
    • 在 WSL 的可执行目录生成 wrapper(safe / software
  2. 运行期兜底(executor)

    • 当 CLI 在 WSL 内执行时,executor 会优先尝试把 bat 复制到 /mnt/c 可写目录并通过 cmd.exe 执行
    • 若失败,再尝试 \\wsl$\<distro>\tmp\... + pushd 方式执行
    • 以上策略用于规避 WSL 下 UNC 工作目录限制与 bat 直接调用失败问题

输出净化与调试开关

默认情况下,CLI 会对输出做净化,过滤 Windows 本地化系统提示/乱码噪声,优先保留业务 JSON 或业务文本。

如需排查底层问题,可开启原始输出:

SAFE_RAW_OUTPUT=1 node dist/index.js --status
SAFE_RAW_OUTPUT=1 node dist/index.js --setup

SAFE_RAW_OUTPUT=1 时将直接返回原始 stdout/stderr,不做任何过滤。

如需查看执行器内部策略日志(例如当前命中了 WSL 哪条执行分支),可额外开启:

SAFE_EXECUTOR_DEBUG=1 node dist/index.js --status

SAFE_EXECUTOR_DEBUG=1 会将 executor 调试日志输出到 stderr

开发

# 安装依赖
npm install

# 构建
npm run build

# 开发模式(watch)
npm run dev

支持的 Agent 平台

安装时自动检测以下平台并分发 Skills:

| 平台 | 目录 | |------|------| | 通用兼容目录 | %USERPROFILE%\.agents\skills\ | | Claude Code | %USERPROFILE%\.claude\skills\ | | GitHub Copilot | %USERPROFILE%\.copilot\skills\ | | Windsurf | %USERPROFILE%\.codeium\windsurf\skills\ | | Gemini CLI | %USERPROFILE%\.gemini\skills\ | | Codex | %USERPROFILE%\.codex\skills\ | | Kimi Code CLI | %USERPROFILE%\.config\agents\skills\ | | Qwen Code | %USERPROFILE%\.qwen\skills\ | | Trae | %USERPROFILE%\.trae\skills\ | | Trae CN | %USERPROFILE%\.trae-cn\skills\ | | Kiro | %USERPROFILE%\.kiro\skills\ | | Cline | %USERPROFILE%\.cline\skills\ | | Warp | %USERPROFILE%\.agents\skills\ | | OpenClaw | %USERPROFILE%\.openclaw\skills\ | | QClaw | %USERPROFILE%\.qclaw\skills\ | | Cursor | %USERPROFILE%\.cursor\skills\ | | OpenCode | %USERPROFILE%\.config\opencode\skills\ | | Hermes | %USERPROFILE%\.hermes\skills\ | | Hermes (Windows) | %LOCALAPPDATA%\hermes\skills\ |

License

MIT