yunxiao-code 1.1.0 → 1.1.2
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.
- package/LICENSE +21 -0
- package/README.md +20 -1
- package/bin/yx-code-darwin-amd64 +0 -0
- package/bin/yx-code-darwin-arm64 +0 -0
- package/bin/yx-code-linux-amd64 +0 -0
- package/claude-plugin/commands/mr.md +23 -16
- package/claude-plugin/commands/push.md +16 -4
- package/claude-plugin/commands/review.md +0 -4
- package/package.json +9 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 yx-code contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ npm install -g yunxiao-code
|
|
|
26
26
|
### 从源码编译
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
git clone
|
|
29
|
+
git clone https://github.com/ZLStream/yunxiao-code.git
|
|
30
30
|
cd yunxiao-code
|
|
31
31
|
make build-local
|
|
32
32
|
sudo make install
|
|
@@ -39,6 +39,25 @@ go build -o yx-code ./cmd/yx-code
|
|
|
39
39
|
sudo mv yx-code /usr/local/bin/
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
#### 安装 Claude Code 插件(可选)
|
|
43
|
+
|
|
44
|
+
如需使用 Claude Code 斜杠命令,手动创建软链接:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# 安装 commands
|
|
48
|
+
ln -s $(pwd)/claude-plugin/commands ~/.claude/commands/yx-commands
|
|
49
|
+
|
|
50
|
+
# 安装 skills
|
|
51
|
+
ln -s $(pwd)/claude-plugin/skills ~/.claude/skills/yx-commands
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
安装后可在 Claude Code 中使用:
|
|
55
|
+
- `/yx-commands:commit` - 分析代码变更并提交
|
|
56
|
+
- `/yx-commands:push` - 推送代码
|
|
57
|
+
- `/yx-commands:mr` - 创建合并请求
|
|
58
|
+
- `/yx-commands:review` - 查看代码差异
|
|
59
|
+
- `/yx-commands:commit-push-mr` - 一键完成完整工作流
|
|
60
|
+
|
|
42
61
|
## 系统要求
|
|
43
62
|
|
|
44
63
|
- Go 1.26.1+(从源码编译时)
|
package/bin/yx-code-darwin-amd64
CHANGED
|
Binary file
|
package/bin/yx-code-darwin-arm64
CHANGED
|
Binary file
|
package/bin/yx-code-linux-amd64
CHANGED
|
Binary file
|
|
@@ -5,7 +5,7 @@ description: 创建云效合并请求(Merge Request)
|
|
|
5
5
|
|
|
6
6
|
创建合并请求到目标分支。
|
|
7
7
|
|
|
8
|
-
**重要:默认目标分支为 develop
|
|
8
|
+
**重要:默认目标分支为 develop,执行前需用户确认。**
|
|
9
9
|
|
|
10
10
|
## 前置条件
|
|
11
11
|
|
|
@@ -16,22 +16,29 @@ description: 创建云效合并请求(Merge Request)
|
|
|
16
16
|
|
|
17
17
|
## 步骤
|
|
18
18
|
|
|
19
|
-
1.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
19
|
+
1. **获取分支状态和提交信息**:
|
|
20
|
+
```bash
|
|
21
|
+
git branch --show-current && git log --oneline -3
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
如果分支未推送到远程,先推送:
|
|
25
|
+
```bash
|
|
26
|
+
git push -u origin HEAD
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. **确定 MR 信息**:
|
|
30
|
+
- 标题:优先使用用户提供的标题;如果用户未提供,从最近的 commit message 自动推导
|
|
31
31
|
- 目标分支:**默认为 develop**,除非用户明确指定其他分支
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
|
|
33
|
+
3. **询问用户确认**:
|
|
34
|
+
使用 AskUserQuestion 询问用户:
|
|
35
|
+
- 问题:"即将创建合并请求到分支 `<target_branch>`,是否继续?"
|
|
36
|
+
- 选项:Yes / No
|
|
37
|
+
|
|
38
|
+
4. **用户选择 Yes 后创建 MR**:
|
|
39
|
+
```bash
|
|
40
|
+
yx-code mr -m "<title>" [-d "<description>"] [-t "<target>"]
|
|
41
|
+
```
|
|
35
42
|
|
|
36
43
|
## 命令参数
|
|
37
44
|
|
|
@@ -5,14 +5,26 @@ description: 推送代码到云效远程仓库
|
|
|
5
5
|
|
|
6
6
|
推送代码到远程仓库。
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
**重要:执行前需用户确认。**
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## 步骤
|
|
11
|
+
|
|
12
|
+
1. **获取当前分支信息**:
|
|
13
|
+
```bash
|
|
14
|
+
git branch --show-current
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **询问用户确认**:
|
|
18
|
+
使用 AskUserQuestion 询问用户:
|
|
19
|
+
- 问题:"即将推送代码到远程仓库,是否继续?"
|
|
20
|
+
- 选项:Yes / No
|
|
21
|
+
|
|
22
|
+
3. **用户选择 Yes 后执行推送**:
|
|
11
23
|
```bash
|
|
12
|
-
|
|
24
|
+
yx-code push
|
|
13
25
|
```
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
4. **如果推送失败且提示无上游分支**,自动设置上游并重试:
|
|
16
28
|
```bash
|
|
17
29
|
yx-code push -u origin HEAD
|
|
18
30
|
```
|
|
@@ -119,8 +119,6 @@ yx-code diff --target <target> --source <source>
|
|
|
119
119
|
|
|
120
120
|
<文件链接>
|
|
121
121
|
|
|
122
|
-
🤖 Generated with [Claude Code](https://claude.ai/code)
|
|
123
|
-
|
|
124
122
|
---
|
|
125
123
|
|
|
126
124
|
如果没有发现问题:
|
|
@@ -130,8 +128,6 @@ yx-code diff --target <target> --source <source>
|
|
|
130
128
|
|
|
131
129
|
未发现问题。已检查 Bug 和 CLAUDE.md 合规性。
|
|
132
130
|
|
|
133
|
-
🤖 Generated with [Claude Code](https://claude.ai/code)
|
|
134
|
-
|
|
135
131
|
---
|
|
136
132
|
|
|
137
133
|
### 链接格式要求
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yunxiao-code",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "阿里云云效 CLI 工具",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aliyun",
|
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
"git",
|
|
12
12
|
"代码"
|
|
13
13
|
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/ZLStream/yunxiao-code.git"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/ZLStream/yunxiao-code#readme",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/ZLStream/yunxiao-code/issues"
|
|
21
|
+
},
|
|
14
22
|
"bin": {
|
|
15
23
|
"yx-code": "bin/yx-code.js"
|
|
16
24
|
},
|