A Rust-based CLI toolset designed for DevOps tasks, adhering to SOLID principles and Clean Code practices.
This project provides a suite of tools to assist with development and operations workflows:
- Terraform/Terragrunt Cache Cleaner: Intelligently cleans
.terragrunt-cache,.terraformdirectories, and lock files. - AI Tool Upgrader: Batch upgrades for AI coding assistants like Claude Code, OpenAI Codex, and Google Gemini CLI.
- Package Security Scanner: Scans dependencies for high-risk packages with performant parallel processing.
- MCP Manager: Manages Model Context Protocol (MCP) servers for Claude and Codex.
- Rust (latest stable)
- A
.envfile is required for MCP management features (see.env.example).
-
Build Release:
cargo build --release
-
Run (Development):
cargo run
-
Run (Release):
./target/release/tools
-
Run Tests:
cargo test- Specific feature test:
cargo test terraform_cleaner
- Specific feature test:
-
Linting (Clippy):
cargo clippy --workspace --all-targets --all-features -- -D warnings
-
Formatting:
cargo fmt --all -- --check
The project follows a strict layered architecture:
src/main.rs: Entry point and interactive menu loop.src/core/: Core abstractions, error handling, result types, and traits (FileScanner,FileCleaner).src/features/: Independent modules for each tool.terraform_cleaner/: Logic for cleaning Terraform caches.tool_upgrader/: Logic for upgrading CLI tools.package_scanner/: Logic for scanning package dependencies.mcp_manager/: Logic for managing MCP servers.
src/ui/: UI components like console output, progress bars, and prompts.
- SOLID Principles:
- SRP: Each module/struct has a single responsibility.
- OCP: Features are extended via traits without modifying core logic.
- DIP: Services depend on abstractions (traits), not concrete implementations.
- Clean Code:
- Clear, specific naming.
- Small functions.
- Comments explain "why", not "what".
- Error Handling:
- Unified
OperationErrorenum for all error types. - Errors must be traceable and categorized.
- Unified
該文件包含完整的技術細節,包括:
- Extension 定義格式與所有欄位說明
- Marketplace-based 插件安裝架構
${CLAUDE_PLUGIN_ROOT}變數轉換機制- Hooks 轉換流程
- 依賴安裝流程
- CLI 相容性與限制
Gemini 安裝時會自動將 ${CLAUDE_PLUGIN_ROOT} 轉換為絕對路徑:
// Claude 原始格式
const pluginRoot = '${CLAUDE_PLUGIN_ROOT}';
// Gemini 轉換後
const pluginRoot = '/Users/username/.gemini/extensions/plugin-name';Gemini 支援 hooks,安裝器會自動:
- 複製 hooks 目錄結構
- 轉換所有
${CLAUDE_PLUGIN_ROOT}引用 - 安裝 Node.js 依賴
- 註冊至
extension-enablement.json
Gemini 使用與 Claude/Codex 不同的格式:
~/.gemini/extensions/<name>/
├── gemini-extension.json # 必要的 manifest
├── GEMINI.md # Context 檔案
├── hooks/ # 轉換後的 hooks(如有)
└── commands/
└── <name>/
└── invoke.toml # TOML 格式的命令
# Gemini CLI 中使用
> /frontend-design:invoke
> /code-review:invoke| 功能 | Gemini 支援 |
|---|---|
| Hooks | ✅ 完整支援(轉換後) |
| Marketplace plugins | ✅ 支援(變數轉換) |
${CLAUDE_PLUGIN_ROOT} |
|
allowed-tools |
❌ 移除(Gemini 無此功能) |
| Sub-agent orchestration | ❌ Claude 專有 |
詳細說明請參閱 docs/SKILL_INSTALLER.md。