diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..ed13162 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,24 @@ +name: Deploy Documentation + +on: + push: + branches: + - feat/docs # Or your default branch + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + pip install mkdocs mkdocs-material mkdocs-awesome-pages-plugin pymdown-extensions mkdocs-static-i18n + - name: Deploy to GitHub Pages + run: | + mkdocs gh-deploy --force --clean \ No newline at end of file diff --git a/.gitignore b/.gitignore index aced8cd..08e1245 100644 --- a/.gitignore +++ b/.gitignore @@ -72,4 +72,5 @@ pylintrc .ruff_cache -test.py \ No newline at end of file +test.py +site \ No newline at end of file diff --git a/README.md b/README.md index 34ca3ed..fc41547 100644 --- a/README.md +++ b/README.md @@ -25,17 +25,11 @@ A powerful automation agent for macOS that enables natural language control of v ## Installation & Usage -Please refer to the [Installation Guide](docs/index.md) for detailed instructions on how to install and configure the MacOS Agent. +Please refer to the [Installation Guide](https://computer-use-agents.github.io/MacOS-Agent/#installation) for detailed instructions on how to install and configure the MacOS Agent. ## Contributing -We welcome contributions! Please follow these steps: - -1. Fork the repository -2. Create a feature branch -3. Commit your changes -4. Push to the branch -5. Create a Pull Request +Follow the instructions for [development guidelines](https://computer-use-agents.github.io/MacOS-Agent/#development-setup). ## Troubleshooting diff --git a/docs/_config.yml b/docs/_config.yml deleted file mode 100644 index 5e480f6..0000000 --- a/docs/_config.yml +++ /dev/null @@ -1,4 +0,0 @@ -theme: jekyll-theme-minimal -title: MacOS Agent Documentation -description: Documentation for the MacOS Agent project -show_downloads: true \ No newline at end of file diff --git a/docs/assets/acc_tree1.png b/docs/assets/acc_tree1.png new file mode 100644 index 0000000..fa53b99 Binary files /dev/null and b/docs/assets/acc_tree1.png differ diff --git a/docs/assets/acc_tree2.png b/docs/assets/acc_tree2.png new file mode 100644 index 0000000..a502817 Binary files /dev/null and b/docs/assets/acc_tree2.png differ diff --git a/docs/assets/acc_tree3.png b/docs/assets/acc_tree3.png new file mode 100644 index 0000000..a6d35b9 Binary files /dev/null and b/docs/assets/acc_tree3.png differ diff --git a/docs/assets/elon.mp4 b/docs/assets/elon.mp4 new file mode 100644 index 0000000..c9e88c9 Binary files /dev/null and b/docs/assets/elon.mp4 differ diff --git a/docs/assets/main_page1.png b/docs/assets/main_page1.png new file mode 100644 index 0000000..c73f02b Binary files /dev/null and b/docs/assets/main_page1.png differ diff --git a/docs/assets/trump.png b/docs/assets/trump.png new file mode 100644 index 0000000..1815a02 Binary files /dev/null and b/docs/assets/trump.png differ diff --git a/docs/index.md b/docs/index.en.md similarity index 86% rename from docs/index.md rename to docs/index.en.md index 3f97b88..640a483 100644 --- a/docs/index.md +++ b/docs/index.en.md @@ -33,9 +33,9 @@ To enable system automation, you need to grant accessibility permissions: 4. Enable the permission by checking the box
- Accessibility Tree Permission 1 - Accessibility Tree Permission 2 - Accessibility Tree Permission 3 + Accessibility Tree Permission 1 + Accessibility Tree Permission 2 + Accessibility Tree Permission 3
## Usage @@ -89,4 +89,4 @@ This project uses pre-commit hooks to ensure code quality before each commit. Th 4. 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`. #### Customization -- ruff is configured to auto \ No newline at end of file +- ruff is configured to auto \ No newline at end of file diff --git a/docs/index.zh.md b/docs/index.zh.md new file mode 100644 index 0000000..9dd9f1d --- /dev/null +++ b/docs/index.zh.md @@ -0,0 +1,93 @@ +# MacOS 代理 +## 安装指南 + +### 1. 安装 Python 依赖 + +请遵循 [uv 文档](https://docs.astral.sh/uv/reference/cli/#uv)中的说明来安装 uv。 + +### 2. 克隆并设置仓库 + +```bash +# 克隆仓库 +git clone https://github.com/yourusername/MacOS-Agent.git +cd MacOS-Agent + +# 安装项目依赖 +uv sync +``` + +### 3. 安装 Playwright + +```bash +# 安装 Playwright 用于网页自动化 +npm init playwright@latest +``` + +### 4. 配置辅助功能权限 + +为了启用系统自动化,您需要授予辅助功能权限: + +1. 打开 系统设置 > 隐私与安全 > 辅助功能 +2. 点击 “+” 按钮添加您的代码编辑器 +3. 导航至 应用程序 并选择您的编辑器 +4. 勾选复选框以启用权限 + +
+ 辅助功能树权限1 + 辅助功能树权限2 + 辅助功能树权限3 +
+ +## 使用方法 + +### 执行代理 + +使用 uv 来运行代理 +```bash +uv sync +uv run macosagent execute examples/tasks/task1.json +``` +请查看 `examples/tasks/task1.json` 获取示例任务。以下是一个示例任务: +```json +{ + "task": "一个任务指令'", +} +``` + + +## 开发设置 + +### Pre-commit 钩子 + +本项目使用 pre-commit 钩子以确保每次提交前的代码质量。设置包括: + +1. **ruff**: 一个快速的 Python linter 和格式化工具 +2. **pylint**: 一个全面的 Python 代码分析器 + +#### 配置文件 + +- `.pre-commit-config.yaml`: 定义 pre-commit 钩子及其配置 +- `ruff.toml`: 配置 ruff linting 规则 +- `pylintrc`: 配置 pylint 分析规则 + +#### 设置流程 + +1. 使用 uv 安装 pre-commit: + ```bash + uv pip install pre-commit + ``` + +2. 安装 git 钩子: + ```bash + pre-commit install + ``` + +3. 手动对所有文件运行检查: + ```bash + pre-commit run --all-files + ``` +4. 当您执行 git commit 时,pre-commit 钩子将自动运行。如果您想跳过钩子,可以使用 `git commit --no-verify`。 + +#### 自定义 + +- ruff 被配置为自动 \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..a5af012 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,64 @@ +site_name: MacOS Agent +site_url: https://computer-use-agents.github.io/MacOS-Agent/ +repo_url: https://github.com/computer-use-agents/MacOS-Agent +repo_name: computer-use-agents/MacOS-Agent +edit_uri: edit/main/docs/ + +theme: + name: material + features: + - navigation.tabs + - navigation.sections + - toc.integrate + - navigation.top + - search.suggest + - search.highlight + - content.tabs.link + - content.code.annotation + - content.code.copy + language: en + palette: + - scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + primary: indigo + accent: indigo + - scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to light mode + primary: indigo + accent: indigo + +plugins: + - awesome-pages + - i18n: + docs_structure: suffix + languages: + - locale: en + name: English + build: true + default: true + - locale: zh + name: 中文 + build: true + nav_translations: + zh: + Home: 首页 + +markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.snippets + - admonition + - pymdownx.details + - pymdownx.superfences + - pymdownx.mark + - attr_list + - md_in_html + - tables + +nav: + - Home: index.md \ No newline at end of file