Skip to main content

IDCU CLI - an integrated development workflow command line toolkit

Project description

IDCU CLI - 不羁盟命令行工具

PyPI version Python Version License Code style: black

面向多仓库开发、构建、质量检查的一站式 CLI 工具


简介

IDCU CLI(不羁盟)是由 IDCU (I Don't Care Union - 不羁盟) 维护的开发工作流命令行工具集,基于 Python 3.8+ 开发,目标是把日常开发中高频、重复、容易出错的操作收敛为统一命令。

主航道功能

核心能力

  • Git 管理 [核心]:支持仓库扫描、状态查看、提交、推送、拉取、分支切换、stash、子模块批量操作
  • Maven 构建 [核心]:支持项目发现、构建、依赖分析、Profile 管理、并行构建、梯队构建
  • 质量检查 [核心]:内置编码检查/修复、依赖审计、TCK 测试入口
  • 配置管理 [核心]:支持项目级 .idcu/config.yaml、命令别名和配置热重载
  • 插件系统 [核心]:支持插件发现、命令注册和示例插件扩展

增强能力

  • 跨语言构建 [增强]:统一检测和构建 npm/yarn/pnpm、Python、Go、Rust 项目
  • 团队协作 [增强]:支持团队配置初始化、导出、权限角色管理
  • 发布管理 [增强]:支持发布分支、版本更新、构建部署流程

实验能力

  • AI 能力 [实验]:支持 OpenAI/Ollama,用于生成提交信息和代码摘要
  • CI/CD 集成 [实验]:生成 GitHub Actions、PyPI 发布、Docker 相关工作流
  • Web UI [实验]:基于 FastAPI 提供可视化 Web 界面
  • 项目模板 [实验]:支持生成 EST-SPI 标准模块模板

安装

pip install idcu-cli 前置依赖

执行 pip install idcu-cli 前,至少需要先安装:

  • Python 3.8+
  • pip

检查命令:

python --version
pip --version

如果系统里还没有 pip,通常可以这样安装或启用:

python -m ensurepip --upgrade
python -m pip install --upgrade pip

确认基础环境就绪后,再安装:

pip install idcu-cli

PyYAML 会作为运行时依赖自动安装,一般不需要手动单独安装。

功能相关外部依赖

下面这些不是 pip install idcu-cli 的前置要求,而是使用对应功能时需要额外安装的外部工具:

  • Git 功能:安装 Git 并确保其在 PATH
  • Maven 功能:安装 JavaMaven
  • 跨语言构建:按需安装 Node.js / npm / yarn / pnpmGoRust

如果希望提前检查这些功能依赖,可参考:

git --version
java -version
mvn -version
node --version
npm --version
go version
rustc --version

安装可选功能

pip install "idcu-cli[interactive,web,ai,dev]"

从源码安装

git clone https://gitee.com/idcu/cli.git
cd cli
pip install -e ".[interactive,web,ai,dev]"

快速开始

基础命令

idcu --help
idcu --version
idcu

Git 工作流 [核心]

idcu git list
idcu git status
idcu git commit -m "feat: update module" -a
idcu git push
idcu git pull
idcu git switch develop
idcu git sub-status
idcu git sub-sync

Maven 与构建 [核心]

idcu maven list
idcu maven build
idcu maven dep-tree
idcu maven dep-analyze
idcu build detect -p .
idcu build build -p .

配置、插件与质量检查 [核心]

idcu config show
idcu alias set gs "git status"
idcu alias list
idcu plugin list
idcu cmd <plugin-command> [args...]
idcu quality list
idcu quality gates
idcu quality encoding check -p .
idcu quality encoding fix -p . -t utf-8
idcu quality dependency-audit audit -p .
idcu quality tck run -p . -f html

命令总览

核心命令

  • git [核心] - Git 管理
  • maven [核心] - Maven 构建
  • quality [核心] - 质量检查
  • config [核心] - 配置管理
  • alias [核心] - 命令别名
  • plugin [核心] - 插件管理
  • cmd [核心] - 执行插件命令

增强命令

  • build [增强] - 跨语言项目构建
  • team [增强] - 团队协作
  • release [增强] - 发布管理
  • env [增强] - 环境配置
  • completions [增强] - 命令补全

实验命令

  • ai [实验] - AI 增强功能
  • cicd [实验] - CI/CD 集成功能
  • web [实验] - Web UI 功能
  • template [实验] - 项目模板

配置文件

默认配置文件位于当前项目目录下:

.idcu/config.yaml

首次运行相关命令时会自动创建默认配置。

示例:

global:
  color_output: true
  verbose: false
  quiet: false
  dry_run: false

git:
  default_branch: develop
  remote_name: origin
  auto_fetch: false

maven:
  local_repo_path: .mvn/local-repo
  default_goals:
    - clean
    - install
  offline_mode: false

目录结构

idcu/
├── cli/                  # CLI 入口、交互模式、补全与项目命令
├── core/                 # 通用能力:UI、缓存、并行、编码处理等
├── system/               # 配置、日志、错误处理、国际化
│   └── config/           # 配置 schema 与校验
└── tools/                # 面向具体场景的工具模块
    ├── git/              # Git 与子模块操作
    ├── maven/            # Maven 相关构建能力
    ├── quality/          # 编码检查、依赖审计、TCK
    ├── plugins/          # 插件系统与示例插件
    ├── crosslang/        # 多语言构建检测与执行
    ├── team/             # 团队配置、权限、审查
    ├── ai/               # OpenAI / Ollama 能力接入
    ├── cicd/             # CI/CD 工作流生成
    └── web/              # FastAPI Web UI

编码说明

  • 仓库文档统一建议使用 UTF-8 编码
  • README.md 已按 UTF-8 with BOM 保存,以避免 Windows PowerShell 下直接读取时出现中文乱码
  • 如果终端仍显示乱码,请确认 Shell 与编辑器都已启用 UTF-8

开发

运行测试

pytest tests/ -v

静态检查

mypy idcu/
ruff format
ruff check
black .

文档

许可证

Apache License 2.0


IDCU CLI - 不羁盟命令行工具
统一命令入口,减少重复劳动,提升开发交付效率

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idcu_cli-1.0.0.tar.gz (196.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idcu_cli-1.0.0-py3-none-any.whl (169.4 kB view details)

Uploaded Python 3

File details

Details for the file idcu_cli-1.0.0.tar.gz.

File metadata

  • Download URL: idcu_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 196.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for idcu_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 74ee7f0c429cd45e75984d40982a3a07ae310bf9bea8c597e776f12a95795faa
MD5 c9a8bb4da632cd23e45154cf41a4ad57
BLAKE2b-256 a8c7fe55c00046fee6c30fa88b5110756c3b0e634033fd094a5a74ec30d0ee17

See more details on using hashes here.

File details

Details for the file idcu_cli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: idcu_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 169.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for idcu_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf1e79eff4c1a58694681f1c2095b3bc2859cd0542fbb22e543116d0abec8101
MD5 bfc56dfc8d89c4d858d0f46fa4fa6128
BLAKE2b-256 edf21a715d573e3c4ce9daf360c3ed94c307e242e6bec548846b8182432fa7a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page