一个用于管理生产项目的 CLI 工具
Project description
ESN Tool
一个强大的命令行工具,提供多种实用功能,包括 AI 自动生成提交信息、批量 Git 操作、GitLab 管理等。
功能特性
- 🤖 AI 自动提交 - 使用 AI 生成符合规范的 Git 提交信息
- 📦 批量 Git 操作 - 对多个 Git 仓库批量执行命令
- 🦊 GitLab 管理 - GitLab 相关批量操作
- 🛠️ 工具集合 - 交互式 TUI 工具箱(配置管理、Git 工具、系统信息等)
- ⚙️ 项目初始化 - 选择和管理要操作的 Git 项目
- 🚀 快捷运行 - 快速运行项目命令(如 Android 构建)
快速开始
安装
使用 uv tool 安装(推荐):
# 安装 uv(如果还没有安装)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 安装 esn-tool
uv tool install esn-tool
# 验证安装
esn --help
💡 升级和卸载:
# 升级到最新版本 uv tool upgrade esn-tool # 卸载 uv tool uninstall esn-tool
其他安装方式
# 使用 pip(国内用户推荐使用镜像)
pip install esn-tool -i https://pypi.tuna.tsinghua.edu.cn/simple
# 使用 pipx(隔离环境)
pipx install esn-tool
使用方法
命令一览
| 命令 | 说明 |
|---|---|
esn acm |
AI 生成 Git 提交信息并自动提交 |
esn git <cmd> |
批量执行 Git 命令 |
esn gitlab |
GitLab 相关操作 |
esn config |
配置 AI 接口等设置 |
esn init |
选择要管理的 Git 项目 |
esn run |
快捷运行项目命令 |
esn tools |
启动工具集合 TUI 界面 |
AI 自动提交 (acm)
# 在当前目录扫描 Git 项目并生成提交信息
esn acm
# 指定目录
esn acm -d /path/to/projects
# 启用 AI 代码审查
esn acm -r
# 跳过确认直接提交
esn acm -y
批量 Git 操作 (git)
# 拉取所有项目的最新代码
esn git pull
# 查看所有项目状态
esn git status
# 切换所有项目到 main 分支
esn git checkout main
# 获取所有远程更新
esn git fetch --all
配置管理 (config)
首次使用前需要配置 AI 接口:
esn config
工具集合 TUI (tools)
启动交互式工具界面:
esn tools
包含以下工具:
- 📋 配置工具 - AI 配置和项目管理
- 🔀 Git 工具 - Git 批量操作界面
- 💻 系统信息 - 查看系统和环境信息
快捷键:
←/→- 切换工具列表和内容区域↑/↓- 导航工具列表Q- 退出
开发
# 克隆仓库
git clone https://git.yyrd.com/esn_tool/esn-command-line.git
cd esn-command-line
# 安装开发依赖
uv sync
# 本地安装(开发模式)
uv tool install -e .
# 运行测试
uv run pytest
# 代码格式化
uv run ruff format src/
uv run ruff check src/ --fix
打包和分发
构建 PKG 安装包
# 构建当前系统架构
uv run python build_pkg.py
# 或指定架构
uv run python build_pkg.py --arch arm64
💡 架构说明:
- M1/M2/M3 Mac 只能构建 ARM64 架构
- Intel Mac 可以构建 x86_64 架构
详细说明请参考 打包文档。
CI/CD 自动构建
项目已配置 GitLab CI/CD,可自动构建安装包:
- 推送到
main或dev分支时自动构建 - 创建 tag 时自动构建并发布 Release
- 详细配置请参考 GitLab CI 文档
文档
- 使用指南 - 详细的命令使用说明
- 打包文档 - PKG 安装包构建指南
- GitLab CI 文档 - CI/CD 配置说明
许可证
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
esn_tool-0.1.1.tar.gz
(73.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
esn_tool-0.1.1-py3-none-any.whl
(53.6 kB
view details)
File details
Details for the file esn_tool-0.1.1.tar.gz.
File metadata
- Download URL: esn_tool-0.1.1.tar.gz
- Upload date:
- Size: 73.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c5f2cbd1d5edf15dfaa0e3c55d242457fb0a97ee5095467ecd0230dde4ed7f1
|
|
| MD5 |
1d04c488e351d45e77eccb94dce58125
|
|
| BLAKE2b-256 |
4d6697843e33f9233ac73f1e5f495b0f4be714fd2a90c9aabf8d21d71ae4e1d7
|
File details
Details for the file esn_tool-0.1.1-py3-none-any.whl.
File metadata
- Download URL: esn_tool-0.1.1-py3-none-any.whl
- Upload date:
- Size: 53.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
379cad2848a5910540808957e8522b102f7ffd665040b171408e419c21be4e7b
|
|
| MD5 |
401ea153e20c5da1f53a4b0a9ebbaf26
|
|
| BLAKE2b-256 |
6179c01a64c669e5fe11486a2ebb0c199dea198778122c1561069885620ccb08
|