File tree Expand file tree Collapse file tree 4 files changed +108
-2
lines changed
Expand file tree Collapse file tree 4 files changed +108
-2
lines changed Original file line number Diff line number Diff line change 1818 python-version : ' 3.x'
1919 - name : Install dependencies
2020 run : |
21- pip install mkdocs mkdocs-material mkdocs-awesome-pages-plugin pymdown-extensions
21+ pip install mkdocs mkdocs-material mkdocs-awesome-pages-plugin pymdown-extensions mkdocs-static-i18n
2222 - name : Deploy to GitHub Pages
2323 run : |
2424 mkdocs gh-deploy --force --clean
Original file line number Diff line number Diff line change @@ -89,4 +89,4 @@ This project uses pre-commit hooks to ensure code quality before each commit. Th
89894 . When you do git commit, the pre-commit hooks will run automatically. If you want to skip the hooks, you can use ` git commit --no-verify ` .
9090#### Customization
9191
92- - ruff is configured to auto
92+ - ruff is configured to auto
Original file line number Diff line number Diff line change 1+ # MacOS 代理
2+ ## 安装指南
3+
4+ ### 1. 安装 Python 依赖
5+
6+ 请遵循 [ uv 文档] ( https://docs.astral.sh/uv/reference/cli/#uv ) 中的说明来安装 uv。
7+
8+ ### 2. 克隆并设置仓库
9+
10+ ``` bash
11+ # 克隆仓库
12+ git clone https://github.com/yourusername/MacOS-Agent.git
13+ cd MacOS-Agent
14+
15+ # 安装项目依赖
16+ uv sync
17+ ```
18+
19+ ### 3. 安装 Playwright
20+
21+ ``` bash
22+ # 安装 Playwright 用于网页自动化
23+ npm init playwright@latest
24+ ```
25+
26+ ### 4. 配置辅助功能权限
27+
28+ 为了启用系统自动化,您需要授予辅助功能权限:
29+
30+ 1 . 打开 系统设置 > 隐私与安全 > 辅助功能
31+ 2 . 点击 “+” 按钮添加您的代码编辑器
32+ 3 . 导航至 应用程序 并选择您的编辑器
33+ 4 . 勾选复选框以启用权限
34+
35+ <div style =" display : flex ; justify-content : space-between ;" >
36+ <img src="assets/acc_tree1.png" alt="辅助功能树权限1" width="32%">
37+ <img src="assets/acc_tree2.png" alt="辅助功能树权限2" width="32%">
38+ <img src="assets/acc_tree3.png" alt="辅助功能树权限3" width="32%">
39+ </div >
40+
41+ ## 使用方法
42+
43+ ### 执行代理
44+
45+ 使用 uv 来运行代理
46+ ``` bash
47+ uv sync
48+ uv run macosagent execute examples/tasks/task1.json
49+ ```
50+ 请查看 ` examples/tasks/task1.json ` 获取示例任务。以下是一个示例任务:
51+ ``` json
52+ {
53+ "task" : " 一个任务指令'" ,
54+ }
55+ ```
56+
57+
58+ ## 开发设置
59+
60+ ### Pre-commit 钩子
61+
62+ 本项目使用 pre-commit 钩子以确保每次提交前的代码质量。设置包括:
63+
64+ 1 . ** ruff** : 一个快速的 Python linter 和格式化工具
65+ 2 . ** pylint** : 一个全面的 Python 代码分析器
66+
67+ #### 配置文件
68+
69+ - ` .pre-commit-config.yaml ` : 定义 pre-commit 钩子及其配置
70+ - ` ruff.toml ` : 配置 ruff linting 规则
71+ - ` pylintrc ` : 配置 pylint 分析规则
72+
73+ #### 设置流程
74+
75+ 1 . 使用 uv 安装 pre-commit:
76+ ``` bash
77+ uv pip install pre-commit
78+ ```
79+
80+ 2 . 安装 git 钩子:
81+ ``` bash
82+ pre-commit install
83+ ```
84+
85+ 3 . 手动对所有文件运行检查:
86+ ``` bash
87+ pre-commit run --all-files
88+ ```
89+ 4 . 当您执行 git commit 时,pre-commit 钩子将自动运行。如果您想跳过钩子,可以使用 ` git commit --no-verify ` 。
90+
91+ #### 自定义
92+
93+ - ruff 被配置为自动
Original file line number Diff line number Diff line change @@ -34,6 +34,19 @@ theme:
3434plugins :
3535 - search
3636 - awesome-pages
37+ - i18n :
38+ docs_structure : suffix
39+ languages :
40+ - locale : en
41+ name : English
42+ build : true
43+ default : true
44+ - locale : zh
45+ name : 中文
46+ build : true
47+ nav_translations :
48+ zh :
49+ Home : 首页
3750
3851markdown_extensions :
3952 - pymdownx.highlight :
You can’t perform that action at this time.
0 commit comments