Anthropic Computer Use is a beta Anthropic feature which runs a Docker image with Ubuntu and controls it. This fork allows you to run it natively on macOS, providing direct system control through native macOS commands and utilities.
Caution
This comes with obvious risks. The Anthropic agent can control everything on your Mac. Please be careful. Anthropic's new Claude 3.5 Sonnet model refuses to do unsafe things like purchase items or download illegal content.
brew install cliclick
) - Required for mouse and keyboard controlgit clone https://github.com/deedy/mac_computer_use.git
cd mac_computer_use
python3.12 -m venv venv
source venv/bin/activate
chmod +x setup.sh
./setup.sh
pip install -r requirements.txt
.env
file add:API_PROVIDER=anthropic
ANTHROPIC_API_KEY=<key>
WIDTH=800
HEIGHT=600
DISPLAY_NUM=1
Set the screen dimensions (recommended: stay within XGA/WXGA resolution), and put in your key from Anthropic Console.
streamlit run streamlit.py
The interface will be available at http://localhost:8501
We recommend using one of these resolutions for optimal performance:
Higher resolutions will be automatically scaled down to these targets to optimize model performance. You can set the resolution using environment variables:
export WIDTH=1024
export HEIGHT=768
streamlit run streamlit.py
Important
The Beta API used in this reference implementation is subject to change. Please refer to the API release notes for the most up-to-date information.