easytouch-macos 1.0.11 → 2.0.0

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.txt CHANGED
@@ -1,201 +1,201 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,21 +1,27 @@
1
1
  # EasyTouch
2
2
 
3
+ ## 中文 | [English](README.en.md)
4
+
3
5
  跨平台系统自动化操作工具,支持 Windows、Linux、macOS。提供 CLI 命令行和 MCP 服务器两种使用方式,支持鼠标键盘控制、屏幕截图、窗口管理、系统信息查询等功能。
4
6
 
5
- 目前:
7
+ 目前支持以下操作系统的 x64 和 ARM64 两种 CPU 架构:
6
8
 
7
9
  - [x] Windows
8
10
 
9
11
  - [x] Linux
10
- - [ ] MAC(目前缺少设备验证功能)
12
+ - [x] MACOS(目前缺少设备验证功能)
13
+
14
+
15
+
16
+ **你能用它做什么?**
11
17
 
12
18
  大家平时使用各类 AI 编程工具,写页面是不是经常碰到 AI 写的页面怎么也不满意,写出来跟设计稿差异很大,这是因为 AI 只能通过读写代码来改进代码,它看不到界面,不像人类有感官。
13
19
 
14
- 所以 EasyTouch 是给 AI 装上手和眼睛。
20
+ 如果你想通过 OpenClaw 接入微信、飞书,让它截图桌面发给你,但是 OpenClaw 像弱智一样搞不好,或者你希望 AI 能够操作你电脑的设备为你工作,那么 EasyTouch 非常适合你。
15
21
 
16
22
 
17
23
 
18
- **你能用它做什么?**
24
+ 因为 EasyTouch 是给 AI 装上手和眼睛,它支持以下功能:
19
25
 
20
26
  - 系统信息:系统、CPU、内存、磁盘、进程
21
27
  - 屏幕能力:显示器枚举、像素取色、截图
@@ -29,28 +35,51 @@
29
35
 
30
36
  ### 安装
31
37
 
32
- 按照操作系统安装,安装命令:
38
+ 推荐安装带自动平台选择能力的启动包;如果你只想安装当前系统,也可以直接安装对应平台包:
39
+
40
+ ```bash
41
+ # 推荐:自动匹配当前平台
42
+ npm i -g @whuanle/easytouch
33
43
 
34
- ```
35
44
  # Windows
36
- npm i -g easytouch-windows
45
+ npm i -g easytouch-windows
37
46
 
38
47
  # Linux
39
- npm i -g easytouch-linux
48
+ npm i -g easytouch-linux
40
49
 
41
50
  # macOS
42
- npm i -g easytouch-mac
51
+ npm i -g easytouch-macos
43
52
  ```
44
53
 
45
54
 
46
55
 
56
+ `@whuanle/easytouch` 会在当前主机上调用对应的平台包;平台包内部同时包含 x64 和 arm64 二进制,安装后会根据当前 CPU 架构自动选择对应程序文件。
57
+
58
+ 如果是 Windows,安装后在 `AppData/Roaming/npm` 目录会发现名为 `et` 的文件。
59
+
60
+ ![image-20260405194137861](images/image-20260405194137861.png)
61
+
62
+
63
+
47
64
  ### 使用示例
48
65
 
66
+ 截取屏幕。
67
+
68
+ ```
69
+ et screen capture --path a.png
70
+ ```
71
+
72
+
49
73
 
74
+ ![image-20260405194600430](images/image-20260405194600430.png)
50
75
 
51
76
 
52
77
 
53
- ### 作为 Skills AI 使用
78
+ <img src="images/d4ba9a4e7b88e26b30118b3c76f2dce5.jpg" alt="d4ba9a4e7b88e26b30118b3c76f2dce5" style="zoom: 25%;" />
79
+
80
+
81
+
82
+ ### 作为 Skills 给 AI 使用(推荐)
54
83
 
55
84
  只需要执行命令安装 skills 即可。
56
85
 
@@ -58,9 +87,9 @@ npm i -g easytouch-mac
58
87
  npx skills add https://github.com/whuanle/EasyTouch
59
88
  ```
60
89
 
90
+ > 注:skills 里面不带脚本,需提前安装当前平台包,第一次使用 AI 会自动安装,或者手动安装,例如 `npm i -g easytouch-windows`、`npm i -g easytouch-linux` 或 `npm i -g easytouch-macos`。
61
91
 
62
92
 
63
- 注:skills 里面不带脚本,需提前使用 `npm i easytouch-windows` 安装工具。
64
93
 
65
94
  ![image-20260224090411080](images/image-20260224090411080.png)
66
95
 
@@ -70,51 +99,54 @@ npx skills add https://github.com/whuanle/EasyTouch
70
99
 
71
100
  如果只是给 AI 工具使用,建议使用 skills 即可,配置 MCP 可能会麻烦一些。
72
101
 
73
- 在 Claude、Cursor 等工具中,配置 MCP 的方式都是大同小异,通过 npm/bun 等方式安装的 EasyTouch,程序文件在 `$basedir/node_modules/easytouch-windows` 下面,。
102
+ 在 Claude、Cursor、VS Code、Sidecar 等工具中,配置 MCP 的方式基本一致。通过 npm 安装后,推荐直接调用全局 `et`,这样 Windows、Linux、macOS 都能使用同一套配置。只有在宿主程序无法从 PATH 找到命令时,才退回到完整路径或 `npx`。
74
103
 
75
104
 
76
105
 
77
106
  在配置文件中添加:
78
107
 
79
- **Windows**
80
108
 
81
- ```json
82
- {
83
- "mcpServers": {
84
- "easytouch": {
85
- "command": "C:\\path\\to\\et.exe",
86
- "args": ["--mcp"]
87
- }
88
- }
89
- }
90
- ```
91
109
 
92
- **NPM 安装方式**
110
+ **全局安装后(推荐,三平台统一写法)**
111
+
112
+ 先执行 `npm i -g @whuanle/easytouch`,或者安装对应平台包,然后使用:
93
113
 
94
114
  ```json
95
115
  {
96
116
  "mcpServers": {
97
117
  "easytouch": {
98
- "command": "npx",
99
- "args": ["-y", "easytouch-windows", "--mcp"]
118
+ "command": "et",
119
+ "args": ["mcp-stdio"]
100
120
  }
101
121
  }
102
122
  }
103
123
  ```
104
124
 
105
- **Linux / macOS**
125
+ **宿主程序不走 PATH 时**
126
+
127
+ - Windows:把 `command` 改成 `C:\\Users\\<你自己的用户名>\\AppData\\Roaming\\npm\\et.cmd`
128
+ - Linux / macOS:先执行 `npm prefix -g`,然后把 `command` 改成 `<prefix>/bin/et`
129
+
130
+ **不想全局安装时(备用)**
131
+
132
+ 如果你不想全局安装,也可以临时通过 `npx` 启动。这里同样建议统一使用 `@whuanle/easytouch`,不要再按平台分别写包名。
133
+
134
+ - Windows:`command` 推荐写 `npx.cmd`
135
+ - Linux / macOS:`command` 写 `npx`
106
136
 
107
137
  ```json
108
138
  {
109
139
  "mcpServers": {
110
140
  "easytouch": {
111
- "command": "/path/to/et",
112
- "args": ["--mcp"]
141
+ "command": "npx",
142
+ "args": ["-y", "@whuanle/easytouch", "mcp-stdio"]
113
143
  }
114
144
  }
115
145
  }
116
146
  ```
117
147
 
148
+ > 如果是在 Windows 的 GUI 程序中配置 MCP,`command` 往往应显式写成 `npx.cmd` 或 `et.cmd`,不要只写 `npx`,否则有些宿主不会按 PowerShell 规则解析 `.ps1` / `.cmd`。
149
+
118
150
 
119
151
 
120
152
 
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: easytouch
3
- description: EasyTouch Skill 接入文档(CLI + MCP)。
3
+ description: 跨平台系统自动化操作工具,支持 Windows、Linux、macOS。提供 CLI 命令行和 MCP 服务器两种使用方式,支持鼠标键盘控制、屏幕截图、窗口管理、系统信息查询等功能。
4
4
  ---
5
5
 
6
6
  # EasyTouch Skill
@@ -18,9 +18,21 @@ description: EasyTouch Skill 接入文档(CLI + MCP)。
18
18
  ### npm 安装
19
19
 
20
20
  ```bash
21
- npm install easytouch
21
+ # 推荐:自动匹配当前平台
22
+ npm install -g @whuanle/easytouch
23
+
24
+ # Windows
25
+ npm install -g easytouch-windows
26
+
27
+ # Linux
28
+ npm install -g easytouch-linux
29
+
30
+ # macOS
31
+ npm install -g easytouch-macos
22
32
  ```
23
33
 
34
+
35
+
24
36
  安装后命令入口:
25
37
 
26
38
  ```bash
@@ -352,6 +364,8 @@ et mcp-stdio --output json
352
364
 
353
365
  ### 配置示例
354
366
 
367
+ 优先使用全局 `et` 命令,这样三个平台都是同一套 MCP 配置:
368
+
355
369
  ```json
356
370
  {
357
371
  "mcpServers": {
@@ -363,4 +377,24 @@ et mcp-stdio --output json
363
377
  }
364
378
  ```
365
379
 
380
+ 如果宿主程序不能从 PATH 找到命令:
381
+
382
+ - Windows:把 `command` 改成 `C:\Users\<你自己的用户名>\AppData\Roaming\npm\et.cmd`
383
+ - Linux / macOS:先执行 `npm prefix -g`,再把 `command` 改成 `<prefix>/bin/et`
384
+
385
+ 如果不想全局安装,也可以临时通过 `npx` 启动:
386
+
387
+ - Windows:`command` 推荐写 `npx.cmd`
388
+ - Linux / macOS:`command` 写 `npx`
389
+
390
+ ```json
391
+ {
392
+ "mcpServers": {
393
+ "easytouch": {
394
+ "command": "npx",
395
+ "args": ["-y", "@whuanle/easytouch", "mcp-stdio"]
396
+ }
397
+ }
398
+ }
399
+ ```
366
400
 
Binary file
package/bin/et.js ADDED
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+
3
+ const cp = require("node:child_process");
4
+ const fs = require("node:fs");
5
+ const path = require("node:path");
6
+
7
+ const archDirectoryByNodeArch = {
8
+ x64: "x64",
9
+ arm64: "arm64",
10
+ };
11
+
12
+ const packageName = require(path.join(__dirname, "..", "package.json")).name;
13
+
14
+ function fail(message) {
15
+ process.stderr.write(`et: ${message}\n`);
16
+ process.exit(1);
17
+ }
18
+
19
+ function getAvailableArchitectures() {
20
+ try {
21
+ return fs
22
+ .readdirSync(__dirname, { withFileTypes: true })
23
+ .filter((entry) => entry.isDirectory())
24
+ .map((entry) => entry.name)
25
+ .sort();
26
+ } catch {
27
+ return [];
28
+ }
29
+ }
30
+
31
+ function resolveBinaryPath() {
32
+ const archDirectory = archDirectoryByNodeArch[process.arch];
33
+ if (!archDirectory) {
34
+ fail(`Unsupported architecture '${process.arch}' on platform '${process.platform}'.`);
35
+ }
36
+
37
+ const binaryName = process.platform === "win32" ? "et.exe" : "et";
38
+ const binaryPath = path.join(__dirname, archDirectory, binaryName);
39
+ if (!fs.existsSync(binaryPath)) {
40
+ const availableArchitectures = getAvailableArchitectures();
41
+ const availableMessage = availableArchitectures.length
42
+ ? ` Available architectures: ${availableArchitectures.join(", ")}.`
43
+ : "";
44
+ fail(
45
+ `The platform package '${packageName}' is missing '${binaryName}' for architecture '${archDirectory}'.${availableMessage}`
46
+ );
47
+ }
48
+
49
+ return binaryPath;
50
+ }
51
+
52
+ const result = cp.spawnSync(resolveBinaryPath(), process.argv.slice(2), {
53
+ stdio: "inherit",
54
+ });
55
+
56
+ if (result.error) {
57
+ fail(result.error.message);
58
+ }
59
+
60
+ process.exit(result.status ?? 1);
package/bin/x64/et ADDED
Binary file
package/package.json CHANGED
@@ -1,18 +1,30 @@
1
- {
2
- "name": "easytouch-macos",
3
- "version": "1.0.11",
4
- "description": "macOS binary distribution for EasyTouch.",
5
- "license": "SEE LICENSE IN LICENSE.txt",
6
- "os": [
7
- "darwin"
8
- ],
9
- "cpu": [
10
- "x64"
11
- ],
12
- "files": [
13
- "bin/**",
14
- "LICENSE.txt",
15
- "README.md",
16
- "SKILL.md"
17
- ]
18
- }
1
+ {
2
+ "name": "easytouch-macos",
3
+ "version": "2.0.0",
4
+ "description": "macOS binary distribution for EasyTouch with x64 and arm64 binaries.",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "type": "commonjs",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/whuanle/EasyTouch.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/whuanle/EasyTouch/issues"
13
+ },
14
+ "homepage": "https://github.com/whuanle/EasyTouch#readme",
15
+ "bin": {
16
+ "et": "bin/et.js"
17
+ },
18
+ "os": [
19
+ "darwin"
20
+ ],
21
+ "files": [
22
+ "bin/**",
23
+ "LICENSE.txt",
24
+ "README.md",
25
+ "SKILL.md"
26
+ ],
27
+ "engines": {
28
+ "node": ">=18"
29
+ }
30
+ }