# windchill-cli **Repository Path**: happy0232/windchill-cli ## Basic Information - **Project Name**: windchill-cli - **Description**: windchill skill - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-27 - **Last Updated**: 2026-09-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # windchill-cli 面向本地 AI agent 的 Windchill 远程操作工具链:一个 Python CLI(`wc`)+ 配套 agent skill,覆盖三类操作: - **服务器管理**:启停、xconfmanager 配置读写、日志查看、代码部署、windchill 命令透传(SSH 通道) - **数据库操作**:只读 SQL 查询(Oracle / SQL Server 直连) - **功能操作**:调用 Windchill Java API、执行测试类 main 方法(服务端 wc-helper + RMI 通道) ## 快速开始 ```bash pipx install "windchill-cli[oracle] @ git+https://gitee.com/happy0232/windchill-cli.git" wc init --user [--key | --password] wc server status ``` `wc init` 自动探测 OS / WT_HOME / Windchill 版本 / 数据库连接并部署服务端 helper——用户只需提供服务器地址和账号,其余全部自动完成。 ## 安装 > 包未发布到 PyPI,只能从 gitee 仓库或本地目录安装。所有安装命令都要在**仓库根目录**(`pyproject.toml` 所在目录)执行。 ### 方式一:pipx(推荐,隔离环境) ```bash pipx install "windchill-cli[oracle] @ git+https://gitee.com/happy0232/windchill-cli.git" ``` 没有 pipx 先装:`python -m pip install --user pipx`,然后重新开终端。 ### 方式二:pip ```bash # 从 gitee 直接装 python -m pip install "windchill-cli[oracle] @ git+https://gitee.com/happy0232/windchill-cli.git" # 或本地开发模式(改源码立即生效) python -m pip install -e ".[dev,oracle]" ``` ### extras 说明 - `oracle` = `oracledb`(默认 thin 模式,**仅支持 Oracle 12.1+**) - `mssql` = `pymssql` 按你的数据库类型选一个;不用 DB 功能可以不装。 **Oracle 11g**:thin 模式会报 `DPY-3010`,需在本机解压 [Oracle Instant Client **19**](https://www.oracle.com/database/technologies/instant-client/downloads.html) (21+ 不能连 11g),并在 profile 的 `db` 段启用 thick 模式(或设环境变量 `WC_ORACLE_LIB_DIR`): ```yaml db: type: oracle url: jdbc:oracle:thin:@dbhost:1521:WIND user: ... password: ... oracle_lib_dir: C:\oracle\instantclient_19_23 ``` > `pip install "windchill-cli[oracle]"`(不带路径/URL)会去 PyPI 找,报 "No matching distribution found"——本包不在 PyPI 上。 `wc init` 生成的运行配置保存在仓库根目录 `config.yaml`(已加入 `.gitignore`);可用环境变量 `WC_CONFIG` 覆盖路径。 ## 常用命令 ```bash wc profile list # 查看 profile(current 指针) wc server status # 组件状态 → JSON wc server restart --yes # 重启并等 MethodServer ready;protected 环境加 --force wc config get wt.http.verbose # xconfmanager 查询 → {key, value, target_file} wc logs tail methodserver --lines 100 --grep "ERROR" wc deploy ./custom.jar --yes # 上传到 codebase/(其他类型需 --target) wc db query "select idA2A2, name from WTDocument" # 只读查询 → {columns, rows, ...} wc db tables "WTDoc*" # 探索表名 wc api describe wt.part.WTPartHelper # 探测可调 API 签名 wc test run com.xxx.TestMain --yes -- arg1 # 执行测试类 main wc publish src/ext/foo --yes # 全流程发布:deploy → build → restart ``` 完整命令清单(用法 / 后台操作 / 验证点)见 [docs/commands.md](docs/commands.md)。 ## 配套 agent skill [skill/SKILL.md](skill/SKILL.md) 教 AI agent 如何使用本 CLI(命令用法、护栏规则、典型流程)。 把整个 `skill/` 目录拷贝(或软链)到 agent 的 skills 目录即可被自动加载: ```bash cp -r skill ~/.agents/skills/windchill-cli # 用户级 # 或项目级:cp -r skill /.agents/skills/windchill-cli ``` ## 文档 - [docs/commands.md](docs/commands.md) — 命令清单与后台操作说明 - [docs/design.md](docs/design.md) — 设计方案 - [docs/deployment.md](docs/deployment.md) — 部署架构(本地 vs 服务器分工、离线环境核对) - [docs/developer-guide.md](docs/developer-guide.md) — 开发者指南(读源码 / 加命令) - [docs/wc-model.md](docs/wc-model.md) — `wc model` 远程建模说明 - [docs/knowledge/](docs/knowledge/) — Windchill 平台知识速查(数据表、IBA 查询、开发约束等)