Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ pylintrc
.ruff_cache


test.py
test.py
site
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions docs/_config.yml

This file was deleted.

Binary file added docs/assets/acc_tree1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/acc_tree2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/acc_tree3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/elon.mp4
Binary file not shown.
Binary file added docs/assets/main_page1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/trump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/index.md → docs/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ To enable system automation, you need to grant accessibility permissions:
4. Enable the permission by checking the box

<div style="display: flex; justify-content: space-between;">
<img src="../assets/acc_tree1.png" alt="Accessibility Tree Permission 1" width="32%">
<img src="../assets/acc_tree2.png" alt="Accessibility Tree Permission 2" width="32%">
<img src="../assets/acc_tree3.png" alt="Accessibility Tree Permission 3" width="32%">
<img src="assets/acc_tree1.png" alt="Accessibility Tree Permission 1" width="32%">
<img src="assets/acc_tree2.png" alt="Accessibility Tree Permission 2" width="32%">
<img src="assets/acc_tree3.png" alt="Accessibility Tree Permission 3" width="32%">
</div>

## Usage
Expand Down Expand Up @@ -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
- ruff is configured to auto
93 changes: 93 additions & 0 deletions docs/index.zh.md
Original file line number Diff line number Diff line change
@@ -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. 勾选复选框以启用权限

<div style="display: flex; justify-content: space-between;">
<img src="assets/acc_tree1.png" alt="辅助功能树权限1" width="32%">
<img src="assets/acc_tree2.png" alt="辅助功能树权限2" width="32%">
<img src="assets/acc_tree3.png" alt="辅助功能树权限3" width="32%">
</div>

## 使用方法

### 执行代理

使用 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 被配置为自动
64 changes: 64 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -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