@hippox/codegenie 4.25.26-demo-alpha → 4.30.26-demo-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +184 -7
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,15 +1,192 @@
1
1
  # @hippox/codegenie
2
2
 
3
- HarmonyOS AI 开发 CLI 工具。
3
+ 面向 HarmonyOS(鸿蒙)开发场景的 AI CLI 助手。
4
4
 
5
- ## 安装
5
+ [npm 包页面](https://www.npmjs.com/package/@hippox/codegenie) |
6
+ [GitCode 仓库](https://gitcode.com/codegenie/codegenie) |
7
+ [OpenCode](https://opencode.ai)
6
8
 
7
- ```bash
8
- npm install -g @hippox/codegenie@alpha
9
- ```
9
+ ## 简介
10
+
11
+ CodeGenie CLI 是一款面向 HarmonyOS 开发场景的 AI CLI 工具,支持代码编写、编译构建、设备运行、文档查阅、运行时调试和 ArkTS 问题修复等能力。
12
+
13
+ CodeGenie 基于开源项目 OpenCode 扩展开发,保留了 OpenCode 的终端交互、配置体系、 Provider / MCP / Skill / Plugin 等能力,并针对鸿蒙工程增加了 DevEco Studio、`hvigorw`、`hdc`、ArkTS 检查和设备调试相关集成。
10
14
 
11
15
  ## 支持平台
12
16
 
13
- - macOS ARM64 (Apple Silicon)
14
- - macOS x64 (Intel)
15
17
  - Windows x64
18
+ - macOS Apple Silicon
19
+ - macOS Intel x64
20
+
21
+ ## 安装前置
22
+
23
+ CodeGenie 通过 npm 分发,安装前请先准备以下环境:
24
+
25
+ 1. 安装 [Node.js LTS](https://nodejs.org)
26
+ 2. 如需使用鸿蒙工程的编译、运行和调试能力,请安装 [DevEco Studio](https://developer.huawei.com/consumer/cn/deveco-studio/)
27
+ 3. 配置 `DEVECO_HOME` 环境变量指向 DevEco Studio 安装目录
28
+
29
+ 可先在终端验证 Node.js 环境:
30
+
31
+ ```bash
32
+ node -v
33
+ npm -v
34
+ ```
35
+
36
+ ## 安装与卸载
37
+
38
+ ```bash
39
+ # 安装
40
+ npm install -g @hippox/codegenie --registry=https://registry.npmjs.org
41
+
42
+ # 查看版本
43
+ codegenie --version
44
+
45
+ # 启动
46
+ codegenie
47
+
48
+ # 更新
49
+ codegenie upgrade
50
+
51
+ # 卸载运行时数据
52
+ codegenie uninstall
53
+
54
+ # 卸载 npm 全局包
55
+ npm uninstall -g @hippox/codegenie
56
+ ```
57
+
58
+ > macOS 如果遇到全局安装权限问题,可尝试 `sudo -i npm install -g @hippox/codegenie --registry=https://registry.npmjs.org`。
59
+
60
+ ## 登录与模型
61
+
62
+ 启动 `codegenie` 后可使用华为账号登录。登录后可使用 CodeGenie 提供的免费模型通道;不登录时也可以沿用 OpenCode 的 Provider 配置体系,自行配置模型。
63
+
64
+ ```bash
65
+ # 退出登录
66
+ codegenie auth logout
67
+ ```
68
+
69
+ 在 CodeGenie 中输入 `/models` 可进入模型配置界面。当前免费提供 `glm-5`、`deepseek-v3.2` 两款模型,单账号默认每分钟 50 次请求。也可以通过 `Ctrl+A` 进入 Provider 选择界面,配置智谱、阿里等 OpenAI-compatible 模型。
70
+
71
+ 也可以通过 `codegenie.jsonc` 配置模型:
72
+
73
+ ```jsonc
74
+ {
75
+ "$schema": "https://opencode.ai/config.json",
76
+ "provider": {
77
+ "codegenie": {
78
+ "name": "CodeGenie",
79
+ "models": {
80
+ "glm-5": {
81
+ "tool_call": true,
82
+ "limit": {
83
+ "context": 200000,
84
+ "output": 8192
85
+ }
86
+ }
87
+ },
88
+ "options": {
89
+ "baseURL": "https://api.openbitfun.com/v1",
90
+ "apiKey": "{env:CODEGENIE_API_KEY}"
91
+ }
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ 配置文件读取优先级:
98
+
99
+ 1. 项目目录下 `.codegenie/codegenie.jsonc`
100
+ 2. 项目目录下 `codegenie.jsonc`
101
+ 3. 用户目录下 `.config/codegenie/codegenie.jsonc`
102
+
103
+ ## Agent 模式
104
+
105
+ CodeGenie 面向鸿蒙开发提供以下 Agent 模式:
106
+
107
+ - `build`:默认模式,适合工程生成、代码生成、配置修正、测试执行、推包运行和发布执行
108
+ - `plan`:适合需求拆解、技术方案、发布规划、测试规划和文档生成
109
+ - `general`:用于复杂搜索和多步任务,内部使用,也可在消息中输入 `@general` 调用
110
+
111
+ ## 鸿蒙场景能力
112
+
113
+ CodeGenie 集成了常用鸿蒙开发工具能力:
114
+
115
+ | 工具 | 说明 |
116
+ | --- | --- |
117
+ | `build_project` | 执行编译构建并导出构建产物 |
118
+ | `start_app` | 在模拟器或真机上运行应用 |
119
+ | `runtime-calibration` | UI 自动化测试,可通过设置启用 |
120
+ | `runtime-calibration_getLog` | 获取设备运行日志,可通过设置启用 |
121
+ | `execute_uitest` | UI 测试操作,包括点击、滑动、输入、按键、截图等 |
122
+ | `hdc_log` | 收集或清理设备日志 |
123
+ | `check_ets_files` | ArkTS 静态语法检查 |
124
+
125
+ 常见场景包括:从 0 到 1 创建鸿蒙工程、增量开发页面、修复编译报错、真机调试,以及基于多模态模型的图生文界面生成。
126
+
127
+ ## 扩展能力
128
+
129
+ CodeGenie 兼容 OpenCode 的 Skill、MCP 和 Plugin 扩展方式。
130
+
131
+ ### Skills
132
+
133
+ ```bash
134
+ npx skills add vercel-labs/agent-skills
135
+ ```
136
+
137
+ 也可以把 Skill 放到 `~/.config/codegenie/skills`,重启 CodeGenie 后加载。
138
+
139
+ ### MCP
140
+
141
+ 可在 `~/.config/codegenie/codegenie.jsonc` 中配置 MCP:
142
+
143
+ ```jsonc
144
+ {
145
+ "$schema": "https://opencode.ai/config.json",
146
+ "mcp": {
147
+ "playwright": {
148
+ "type": "local",
149
+ "command": ["npx", "@playwright/mcp@latest"],
150
+ "enabled": true
151
+ }
152
+ }
153
+ }
154
+ ```
155
+
156
+ ### Plugins
157
+
158
+ ```bash
159
+ npm install -g oh-my-opencode
160
+ ```
161
+
162
+ 然后在 `codegenie.jsonc` 中配置插件入口:
163
+
164
+ ```jsonc
165
+ {
166
+ "plugin": [
167
+ "file:///C:/Users/tylor/AppData/Roaming/npm/node_modules/oh-my-opencode/dist/index.js"
168
+ ]
169
+ }
170
+ ```
171
+
172
+ ## 从 OpenCode 迁移
173
+
174
+ 如果需要从 OpenCode 迁移到 CodeGenie,请将配置文件迁移到 CodeGenie 目录。主配置文件可参考:
175
+
176
+ ```powershell
177
+ # Windows PowerShell
178
+ Copy-Item -Force "{源路径}\opencode.jsonc" "~\.config\codegenie\codegenie.jsonc"
179
+ ```
180
+
181
+ ```bash
182
+ # macOS
183
+ cp {源路径}/opencode.jsonc ~/.config/codegenie/codegenie.jsonc
184
+ ```
185
+
186
+ Skills、Agents、Plugins 也可以迁移到 `~/.config/codegenie` 下的对应目录;MCP 配置项可迁移到 `codegenie.jsonc` 中。
187
+
188
+ ## FAQ
189
+
190
+ ### 这和 OpenCode 有什么关系?
191
+
192
+ CodeGenie 基于 OpenCode 扩展开发,保留其终端 UI、Provider、MCP、Skill、Plugin 和配置体系,并额外针对 HarmonyOS 开发链路加入编译构建、设备运行、日志采集、ArkTS 检查和运行时调试等能力。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hippox/codegenie",
3
- "version": "4.25.26-demo-alpha",
3
+ "version": "4.30.26-demo-alpha",
4
4
  "private": false,
5
5
  "description": "HarmonyOS AI 开发 CLI,通过 npm 分发平台二进制",
6
6
  "license": "MIT",
@@ -12,9 +12,9 @@
12
12
  "files": ["bin", "lib", "README.md", "platform-map.json"],
13
13
  "keywords": ["cli", "harmonyos", "codegenie", "ai"],
14
14
  "optionalDependencies": {
15
- "@hippox/codegenie-darwin-arm64": "4.25.26-demo-alpha",
16
- "@hippox/codegenie-darwin-x64": "4.25.26-demo-alpha",
17
- "@hippox/codegenie-win32-x64": "4.25.26-demo-alpha"
15
+ "@hippox/codegenie-darwin-arm64": "4.30.26-demo-alpha",
16
+ "@hippox/codegenie-darwin-x64": "4.30.26-demo-alpha",
17
+ "@hippox/codegenie-win32-x64": "4.30.26-demo-alpha"
18
18
  },
19
19
  "publishConfig": { "access": "public" },
20
20
  "repository": { "type": "git", "url": "https://gitcode.com/codegenie/codegenie.git" }