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

@unity-china/codely-cli

v1.0.0-beta.44

Published

<div align="center">

Readme

Codely CLI

Codely CLI 截图

npm 版本 许可证 Node.js 版本 下载量

面向开发者的 AI 驱动命令行工作流工具

🌐 官方网站 • 📖 使用手册 • 🇺🇸 English

安装快速开始核心功能

核心功能

  • 代码理解与编辑 - 查询和编辑超出传统上下文窗口限制的大型代码库
  • 工作流自动化 - 自动化处理拉取请求和复杂变基等操作任务
  • AI 智能体系统 - 专业的智能代理,用于深度代码库分析和自动化任务
  • MCP 集成 - 通过模型上下文协议服务器扩展外部工具和服务能力
  • Unity 集成 - 与 Unity/团结引擎直接集成,支持游戏开发任务
  • 截图分析 - 分析截图和图像以理解 UI/UX 并提取信息
  • 沙箱环境 - 多种沙箱模式的安全执行环境
  • IDE 插件 - VS Code 扩展实现无缝集成

🤖 AI 智能体系统

Codely CLI 包含强大的智能体系统,提供专业的 AI 助手处理复杂的开发任务:

智能体使用

交互模式(智能体自动调用):

codely
> 分析这个 React 项目的组件架构并识别性能瓶颈

非交互模式支持不同的输出格式:

# 标准文本输出
codely --prompt "分析 API 端点和安全措施"

# JSON 输出用于自动化
codely --output-format json --prompt "调查代码库结构" > analysis.json

# 流式 JSON 用于实时监控
codely --output-format stream-json --prompt "记录数据流" | jq '.type == "agent_think"'

智能体管理

列出可用的智能体:

/agents list

创建自定义智能体:

# 项目级别智能体
/agents create security-auditor

# 全局智能体
/agents create my-helper --global

# 带自定义描述
/agents create api-analyzer "分析 API 端点和文档"

智能体位置:

  • 项目智能体.codely-cli/agents/(与团队共享)
  • 全局智能体~/.codely-cli/agents/(个人使用)

智能体输出示例

智能体提供结构化的完整结果:

交互式进度:

🚀 委派给 codebase_investigator 子智能体...
🔧 [1] 列出目录 - 扫描项目结构
✅ 列出目录完成 - 找到 45 个目录
🤖💭 正在分析 package.json 依赖...
🔧 [2] 读取文件 - package.json
✅ 读取文件完成 - 分析依赖中
📋 结果:
{
  "SummaryOfFindings": "React 应用采用三层架构...",
  "ExplorationTrace": ["分析项目结构", "检查路由"],
  "RelevantLocations": ["src/components/App.tsx", "src/api/routes.ts"]
}

安装

前置要求

确保已安装 Node.js 20 或更高版本。

直接安装

npm i -g @unity-china/codely-cli

快速开始

# 启动
codely

# 示例命令
> 解释这个代码库结构
> 帮我重构这个函数
> 为这个模块生成单元测试

会话管理

通过可配置的会话限制控制您的 token 使用量,以优化成本和性能。

配置会话 Token 限制

在您的主目录中创建或编辑 .codely-cli/settings.json

{
  "sessionTokenLimit": 32000
}

会话命令

  • /compress - 压缩对话历史以继续在 token 限制内使用
  • /clear - 清除所有对话历史并重新开始
  • /stats - 检查当前 token 使用情况和限制

📝 注意:会话 token 限制适用于单次对话,而非累计 API 调用。

使用示例

🔍 探索代码库

cd your-project/
codely

# 架构分析
> 描述这个系统架构的主要部分
> 关键依赖是什么,它们如何交互?
> 查找所有 API 端点及其认证方法

💻 代码开发

# 重构
> 重构这个函数以提高可读性和性能
> 将这个类转换为使用依赖注入
> 将这个大模块拆分成更小、更专注的组件

# 代码生成
> 创建一个用户管理的 REST API 端点
> 为认证模块生成单元测试
> 为所有数据库操作添加错误处理

🔄 自动化工作流

# Git 自动化
> 分析过去 7 天的 git 提交,按功能分组
> 从最近的提交创建变更日志
> 查找所有 TODO 注释并创建 GitHub issues

# 文件操作
> 将此目录中的所有图像转换为 PNG 格式
> 将所有测试文件重命名为 *.test.ts 模式
> 查找并删除所有 console.log 语句

🐛 调试与分析

# 性能分析
> 识别这个 React 组件中的性能瓶颈
> 在代码库中查找所有 N+1 查询问题

# 安全审计
> 检查潜在的 SQL 注入漏洞
> 查找所有硬编码的凭据或 API 密钥

常用任务

📚 理解新代码库

> 核心业务逻辑组件是什么?
> 有哪些安全机制?
> 数据如何在系统中流动?
> 使用了哪些主要设计模式?
> 为这个模块生成依赖关系图

🔨 代码重构与优化

> 这个模块的哪些部分可以优化?
> 帮我重构这个类以遵循 SOLID 原则
> 添加适当的错误处理和日志记录
> 将回调转换为 async/await 模式
> 为昂贵的操作实现缓存

📝 文档与测试

> 为所有公共 API 生成全面的 JSDoc 注释
> 编写包含边界情况的单元测试
> 以 OpenAPI 格式创建 API 文档
> 添加解释复杂算法的内联注释
> 为这个模块生成 README

🚀 开发加速

> 设置一个带认证的新 Express 服务器
> 创建一个带 TypeScript 和测试的 React 组件
> 实现一个速率限制中间件
> 为新架构添加数据库迁移
> 为这个项目配置 CI/CD 流水线

命令与快捷键

会话命令

  • /help - 显示可用命令
  • /clear - 清除对话历史
  • /compress - 压缩历史以节省 tokens
  • /stats - 显示当前会话信息
  • /exit/quit - 退出 Codely CLI

MCP 命令

管理模型上下文协议(MCP)服务器以扩展 Codely 的外部工具和服务能力:

  • /mcp - 列出已配置的 MCP 服务器及其可用工具
  • /mcp desc - 显示服务器和工具的详细描述
  • /mcp schema - 显示工具参数架构
  • /mcp auth <server-name> - 对启用 OAuth 的 MCP 服务器进行身份验证
  • /mcp refresh - 刷新 MCP 服务器和工具列表

管理 MCP 服务器配置的 CLI 命令:

codely mcp add <name> <commandOrUrl> [args...]

添加具有指定名称和连接详情的新 MCP 服务器。

选项:

  • --scope (-s) - 配置范围(user 或 project)
  • --transport (-t) - 传输类型(stdio、sse、http)
  • --env (-e) - 为 stdio 传输设置环境变量(例如 -e KEY=value
  • --header (-H) - 为 SSE 和 HTTP 传输设置 HTTP 头(例如 -H "X-Api-Key: abc123"
  • --timeout - 连接超时时间(毫秒)
  • --trust - 信任服务器(绕过所有工具调用确认提示)
  • --description - 服务器描述
  • --include-tools - 要包含的工具的逗号分隔列表
  • --exclude-tools - 要排除的工具的逗号分隔列表

传输类型:

  • stdio(默认)- 使用指定的命令和参数启动进程
  • sse - 使用服务器发送事件协议连接到服务器
  • http - 使用 HTTP 协议连接到服务器

示例:

# 添加 stdio 服务器
codely mcp add my-server python /path/to/server.py --env API_KEY=abc123

# 添加 HTTP 服务器
codely mcp add my-http-server http://localhost:8000 --transport http --header "Authorization: Bearer token"

# 添加具有范围配置的服务器
codely mcp add my-server python /path/to/server.py --scope user

codely mcp list

列出所有已配置的 MCP 服务器及其连接状态。

codely mcp remove <name>

删除具有指定名称的 MCP 服务器。

选项:

  • --scope (-s) - 配置范围(user 或 project)

键盘快捷键

  • Ctrl+C - 取消当前操作
  • Ctrl+D - 退出(在空行上)
  • 上/下箭头 - 浏览命令历史

故障排除

如果您遇到问题,请检查错误消息并确保:

  • Node.js 版本为 20 或更高
  • 所有依赖项已正确安装
  • API 密钥在设置中正确配置

如需更多帮助,请访问:

许可证

LICENSE