Environment Setup
Core and plugin development share this environment. Start the local AUTO-MAS host before developing or debugging a plugin.
Technology Stack
Backend
- Python: 3.12.x
- Environment and dependency management: uv (
pyproject.toml+uv.lock) - Web framework: FastAPI
- Realtime communication: WebSockets 15.0.1
- Logging: Loguru 0.7.3
- Image processing: OpenCV, Pillow, PyAutoGUI
- OCR: RapidOCR (ONNX Runtime)
Frontend
- Framework: Vue 3 + TypeScript
- UI component library: Ant Design Vue 4.x
- Desktop: Electron
- Build tool: Vite Plus (Vite)
- Routing: Vue Router 4
- State management: Pinia 3.x
Environment Requirements
Required Software
- uv
- Follow the official uv installation guide. On Windows, run
winget install --id=astral-sh.uv -e, then reopen your terminal. - The root
.python-versionfile selects the Python version (currently 3.12.13). uv downloads it if it is missing, so a separate Python installation is not required.
- Follow the official uv installation guide. On Windows, run
- Node.js 22.18+
- Download: https://nodejs.org/
- Node.js 24 LTS is recommended, matching the current frontend checks.
- Yarn (recommended)
- The project uses Yarn 4. Enable it through Corepack:
corepack enable - After entering
frontend, you can directly use the Yarn version declared by the repository.
- The project uses Yarn 4. Enable it through Corepack:
- Git
- Download: https://git-scm.com/downloads
- VC runtime
Quick Start
Commands below are provided for both PowerShell and Bash. Select the tab matching your terminal. Run commands from the repository root unless a step explicitly enters frontend.
1. Clone the Project
git clone --branch dev https://github.com/AUTO-MAS-Project/AUTO-MAS.git
cd AUTO-MASgit clone --branch dev https://github.com/AUTO-MAS-Project/AUTO-MAS.git
cd AUTO-MASBefore making changes, create a development branch from the latest upstream dev as described in the development specifications.
Agent Development Prerequisite
If an AI assistant participates in development, first confirm that the main repository contains and loads .agents/skills/mas-skills/SKILL.md. If project-owned Skills are missing, complete the main repository content first. Do not let the AI assistant start work directly.
2. Backend Environment Setup
Sync the Python environment and dependencies
uv --version
uv sync --lockeduv --version
uv sync --lockeduv selects Python from .python-version, creates or reuses .venv in the repository root, and installs dependencies from uv.lock. The development dependency group, including Ruff and pytest, is installed by default. --locked checks that the lockfile matches pyproject.toml without rewriting it.
Use pyproject.toml and uv.lock for development. You do not need to create or activate a virtual environment manually or run pip install -r requirements.txt. Select .venv\Scripts\python.exe as your IDE's Python interpreter. Run uv sync --locked again after pulling code to sync dependencies.
3. Frontend Environment Setup
Enter the frontend directory and install dependencies
cd frontend
yarn installcd frontend
yarn installIf the Electron binary download is slow or fails, select the npmmirror source before installing:
$env:ELECTRON_MIRROR = "https://npmmirror.com/mirrors/electron/"
yarn installELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" yarn installThe PowerShell setting lasts for the current terminal session; the Bash setting affects only this command. Neither option requires cross-env to have been installed or changes global configuration.
4. Start the App
Administrator Privileges
Run the terminal or IDE as administrator when debugging features that require elevated access, such as game or emulator control. The development backend does not elevate itself.
If you use a JetBrains IDE or VS Code, start the IDE as administrator so terminals opened inside it also have administrator privileges.
Both options below run backend code from your current local checkout. Choose one.
4.1 Start Backend and Frontend Separately
- Start the backend service from the repository root
uv run --locked python main.pyuv run --locked python main.pyThe backend defaults to development mode when launched from source and does not read .env. It listens on http://127.0.0.1:36164 by default. Open http://127.0.0.1:36164/docs to inspect the API and keep the terminal running. The packaged application uses port 36163 by default.
- Start the frontend service
Open a new terminal at the repository root:
cd frontend
yarn dev:frontendcd frontend
yarn dev:frontendThe frontend server starts at http://localhost:5173. The Electron window connects to the development backend running in the first terminal.
yarn dev:frontend starts only the frontend. Synchronize Python dependencies and start the backend first.
4.2 Start Backend and Frontend Together
Open a terminal at the repository root and run:
cd frontend
yarn dev:fullstackOn Windows, this option starts the frontend and uses Runtime to supervise the local development backend. Use the two-terminal method for backend breakpoints or on systems without Runtime.
Debugging in the IDE
In VS Code, select the repository’s .venv Python interpreter and debug main.py with the repository root as the working directory. In a second terminal, run yarn dev:frontend from frontend/. Once the host is running, see Local Plugin Development and Debugging for plugin entry points and reload.
To save the backend launch settings, add this configuration to .vscode/launch.json. Start VS Code as administrator if the features you are debugging require elevated access.
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug AUTO-MAS backend",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/main.py",
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
}
]
}Project Structure
See Project Structure for the repository layout and module responsibilities.
FAQ
Q: Do I still need to activate the Python virtual environment?
A: No. Start the backend in the project environment with uv run --locked python main.py. Select .venv\Scripts\python.exe as your IDE's interpreter.
Q: The uv command cannot be found
A: Reopen your terminal after installing uv, then run uv --version. If it is still unavailable, check that its installation directory is on PATH using the official uv installation guide.
Q: uv sync --locked says the lockfile needs updating
A: First confirm that pyproject.toml, uv.lock, and .python-version come from the same checkout. If you intentionally changed dependency declarations, run uv lock from the repository root, then verify with uv sync --locked. Commit the dependency declarations and lockfile together. Do not delete uv.lock to bypass the error.
Q: yarn install fails
A: Try:
- Clear cache:
yarn cache clean - Delete
node_modules, keeping the repository'syarn.lock - Install again:
yarn install - If the Electron binary download is slow or fails, select the mirror as shown in Frontend Environment Setup, then retry.
Q: Backend startup fails due to insufficient permissions
A: AUTO-MAS requires administrator privileges. Run as administrator:
- Open PowerShell or Git Bash as administrator
- Or start VS Code as administrator
Q: Electron window cannot open
A: Check:
- Whether the frontend dev server is running normally at
http://localhost:5173 - Confirm the backend is running at
http://127.0.0.1:36164/docs. For a separate frontend, useyarn dev:frontend. - Error output in the terminal
License
This project is open source under the AGPL-3.0 License.
When using, distributing, or modifying this software, comply with AGPL-3.0 and the supplementary terms in the project README.
Thank you for contributing to AUTO-MAS.