An open-source alternative to Anthropic's Computer Use, leveraging Vision Language Models for desktop automation and RPA (Robotic Process Automation).
Note: Open Computer Use only works on macOS at the moment, others will be supported in near future.
Open Computer Use is a framework that enables AI to interact with your computer through:
- Visual understanding of your screen using Vision Language Models
- Direct control of keyboard and mouse inputs
- Automated screenshot capture and analysis
- Continuous feedback loop for complex tasks
- Vision-First Approach: Uses advanced Vision LLMs to understand screen context
- Basic I/O Operations: Performs fundamental computer interactions that can solve complex automation problems
- Ideal for RPA: Perfect for repetitive task automation and business process automation
- Open Architecture: Fully open-source and customizable
- Visual Understanding: Uses GPT-4 Vision to interpret screen contents
- Automated Actions: Performs keyboard and mouse actions programmatically
- State Management: Maintains conversation context and screen state
- Error Handling: Robust error handling for image processing and LLM interactions
- Modular Design: Built using LangGraph (I'm a huge fan :D)
- Start: Application initialization
- Initialization: System setup and initial state configuration
- AI Processing: Vision LLM analyzes screen content
- Tools Execution:
- Keyboard operations
- Mouse control
- Screenshot: Captures new screen state
- Loop/End: Continues process or terminates based on task completion
- Python 3.x
- Foundation Model API key (e.g. Gemini, OpenAI)
- Clone the repository:
git clone https://github.com/taham655/open-computer-use.git
cd open-computer-use- Install required dependencies:
pip install langchain-openai langgraph pyautogui python-dotenv- Create a
.envfile in the project root and add your Foundation Model API key:
OPENAI_API_KEY=your_api_key_here
├── tools.py # Custom automation tools (keyboard/mouse)
├── prompts.py # System prompts and messages
├── utils.py # Utility functions
└── main.py # Main application logic
class State(TypedDict):
messages: Annotated[list[AnyMessage], add_messages]
screen_size: str
latest_image: str
initialized: boolThe framework includes several automation tools:
click_at_position: Mouse clickingpress_key: Keyboard key pressingkey_combination: Complex keyboard shortcutstype_text: Text inputwait: Time-based delays
The application uses LangGraph's StateGraph to manage the flow:
- Initialize -> Takes initial screenshot
- Assistant -> Processes user input and current screen state
- Tools -> Executes required actions
- Screenshot -> Captures new state
- Loop back to Assistant or END
Contributions are welcome! Please feel free to submit a Pull Request.
This is in no way a complete product. It's still in development and has a lot of bugs, but I'm working on it :)
