A cross-platform desktop automation tool with a FastAPI backend. Automate window actions, screenshots, and text input via API.
- List open windows
- Screenshot any window
- Automate mouse and keyboard actions
- View logs of actions and requests
- Python 3.8 or higher
- (macOS only) Accessibility permissions for your terminal or Python (for automation)
git clone <your-repo-url>
cd <your-repo-directory>
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
bash run.shSee interactive API docs at http://localhost:8000/docs
GET /
curl http://localhost:8000/GET /api/v1/health
curl http://localhost:8000/api/v1/healthGET /api/v1/windows
curl http://localhost:8000/api/v1/windowsReplace <window_id> with the actual window ID.
curl http://localhost:8000/api/v1/windows/<window_id>/screenshot --output screenshot.pngReplace <window_id> with the actual window ID.
curl -X POST http://localhost:8000/api/v1/automate \
-H "Content-Type: application/json" \
-d '{
"window_id": "<window_id>",
"actions": [
{"x": 100, "y": 200, "text": "hello"}
]
}'curl http://localhost:8000/api/v1/logs?limit=50curl http://localhost:8000/api/v1/requests_log?limit=20Open in your browser:
http://localhost:8000/docs
- On macOS, grant Accessibility permissions to your terminal or Python for automation to work:
- System Settings → Privacy & Security → Accessibility
- Logs are stored in the
logs/directory. - For development, see and edit
src/main.pyfor API logic.
Pull requests welcome! Please open an issue first to discuss major changes.
You can build a standalone macOS app bundle using PyInstaller:
bash build.sh- The app bundle will be in
release/DTopApp.app - A zip file for distribution will be in
release/DTopApp-macOS.zip
python3 -m pip install pyinstaller
pyinstaller --name DTopApp \
--windowed \
--onedir \
--add-data "src:src" \
--add-data "ui:ui" \
src/ui.pyThis project includes a GitHub Actions workflow that automatically builds and uploads a macOS app bundle as a release artifact whenever you push a tag starting with v (e.g., v1.0.0).
- The workflow is defined in
.github/workflows/build.yml. - The release artifact will be available as
DTopApp-macOS.zipin the GitHub release.
- Make sure all changes are committed and pushed before tagging a release.
- Tag a new release with:
git tag v1.0.0 git push origin v1.0.0
- The GitHub Actions workflow will build and upload the release automatically.
If you download the macOS app from GitHub Releases, macOS will mark it as quarantined and unsigned. To run the app, follow these steps:
- Download the latest
DTopApp.zipfrom the GitHub Releases. - Unzip the file (double-click in Finder).
- Remove the quarantine attribute by running this command in Terminal:
Replace
xattr -dr com.apple.quarantine /path/to/DTopApp.app
/path/to/DTopApp.appwith the actual path to the app (e.g.,~/Downloads/DTopApp.app). - Double-click the app to launch it.
Note: This step is required because unsigned apps downloaded from the internet are blocked by default on macOS. Removing the quarantine attribute allows the app to run normally.