Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MacOS Demo for Claude Computer Use

License

NotificationsYou must be signed in to change notification settings

PallavAg/claude-computer-use-macos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains a Python script that demonstrates Anthropic's Computer Use capabilities, modified to run on MacOS without requiring a Docker container. The script allows Claude 3.5 Sonnet to perform tasks on your Mac by simulating mouse and keyboard actions as well as running bash command.

Forked from Anthropic'scomputer use demo - optimized for MacOS.View Anthropic's docshere.

Warning

Use this script with caution. Allowing Claude to control your computer can be risky. By running this script, you assume all responsibility and liability.

Installation and Setup

  1. Clone the repository:

    git clone https://github.com/PallavAg/claude-computer-use-macos.gitcd claude-computer-use-macos
  2. Create a virtual environment + install dependencies:

    python3.12 -m venv venvsource venv/bin/activatepip3.12 install -r requirements.txt
  3. Set your Anthropic API key as an environment variable:

    export ANTHROPIC_API_KEY="CLAUDE_API_KEY"

    ReplaceCLAUDE_API_KEY with your actual Anthropic API key. You find yourshere.

  4. Grant Accessibility Permissions:

    The script usespyautogui to control mouse and keyboard events. On MacOS, you need to grant accessibility permissions. These popups should show automatically the first time you run the script so you can skip this step. But to manually provide permissions:

    • Go toSystem Preferences >Security & Privacy >Privacy tab.
    • SelectAccessibility from the list on the left.
    • Add your terminal application or Python interpreter to the list of allowed apps.

Usage

You can run the script by passing the instruction directly via the command line or by editing themain.py file.

Example using command line instruction:

python3.12 main.py'Open Safari and look up Anthropic'

Replace'Open Safari and look up Anthropic' with your desired instruction.

Note: If you do not provide an instruction via the command line, the script will use the default instruction specified inmain.py. You can editmain.py to change this default instruction.

Exiting the Script

You can quit the script at any time by pressingCtrl+C in the terminal.

⚠ Disclaimer

Caution

  • Security Risks: This script allows claude to control your computer's mouse and keyboard and run bash commands. Use it at your own risk.
  • Responsibility: By running this script, you assume all responsibility and liability for any results.

About

MacOS Demo for Claude Computer Use

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp