linux 小工具
目录结构
所有命令的安装入口统一位于 src/plum_tools/cli/,文件名与终端命令名一致。例如,gitrepo 的入口是 cli/gitrepo.py,pcompare 的入口是 cli/pcompare.py。入口映射在 pyproject.toml 的 [project.scripts] 中。
安装
支持 Python 3.11 至 3.14。在项目目录安装依赖后,通过 uv run 运行命令。
# 推荐
curl -LsSf https://astral.sh/uv/install.sh | sh
# 或
pip install uv
uv sync
命令
使用 uv run <命令> --help 查看各工具的参数和示例。
| 命令 | 用途 |
|---|---|
gitrepo |
扫描 Git 仓库状态,查找重复仓库 |
gitstash |
按分支保存和恢复已储藏的修改 |
pcompare |
比较本地或 SSH 远端的目录、文件 |
pforkcheck |
检查 fork 与父仓库的本地目录 |
pfind_imports |
分析 Python 项目的导入依赖 |
pclean |
扫描缓存、构建产物和依赖,生成清理计划 |
agent_usage_report |
汇总本机 Agent 使用记录 |
pssh |
通过 IP 或 SSH 别名登录服务器 |
prn |
通过 rsync 同步项目文件 |
pping |
并发探测网段中的可达 IP |
pipmi |
通过跳板机执行 IPMI 命令 |
常用示例
以下示例用于仓库检查、文件比较、清理预览和使用记录查询。
# 查找存在异常的 Git 仓库
gitrepo scan -p ~/PythonProjects --status issues
# 按目录名集中展示重复仓库及提交对比
gitrepo scan -p ~/PythonProjects --group-by name --status duplicate --detail
# 比较两个目录
pcompare ./backup_a ./backup_b
# 预览项目中的清理候选
pclean scan --root ~/PythonProjects
# 查看本机 Agent 使用记录
agent_usage_report --client claude codex
配置
SSH、同步等工具使用 ~/.plum_tools.yaml,格式可参考
示例配置。SSH 别名读取 ~/.ssh/config。
开发
命令入口位于 src/plum_tools/cli/,业务实现位于 src/plum_tools/,
测试位于 tests/,开发任务脚本位于 bin/。
# 运行测试
uv run poe test
# 检查代码规范
uv run poe lint
更新版本
版本号、发布日期和构建提交集中维护在 src/plum_tools/_version.py,
Hatch 直接从该文件读取包版本。使用 bump-my-version 同步更新版本号与发布日期,
日期采用执行环境的本地日期(YYYY-MM-DD),并按现有配置创建提交和标签。
# 小版本
uv run bump-my-version bump patch
# 中版本
uv run bump-my-version bump minor
Metadata
Release files for plum-tools 0.8.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plum_tools-0.8.9.tar.gz | 330.6 kB | With provenance | Details for plum_tools-0.8.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plum_tools-0.8.9-py3-none-any.whl | Python 3 | none | any | Details for plum_tools-0.8.9-py3-none-any.whl |
Total release size: 497.3 kB
Release files / plum_tools-0.8.9.tar.gz
| Download URL | plum_tools-0.8.9.tar.gz |
|---|---|
| Size | 330.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a32bbc20325b728c44eeac5d05a257ae8b536877de174a4aa0637088c3b4019
|
|
BLAKE2b-256 checksum How to use checksums |
803377089ca301036a200f34d1e41431795d08cc71d708db4ba64502ae406402
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / plum_tools-0.8.9-py3-none-any.whl
| Download URL | plum_tools-0.8.9-py3-none-any.whl |
|---|---|
| Size | 166.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d5b48b981d5a7131c22329e78436bab0aa74b4b74df119882db8f821b46f1b5
|
|
BLAKE2b-256 checksum How to use checksums |
3c20fbbbc559bcaca63c082b331a31a40d73cd95b63a4e02e25b3b697c5534ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for plum-tools 0.8.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for plum_tools-0.8.9.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.