Install Optics
Install the optics command, then add only the drivers and engines your platform needs.
Optics has two parts. The core is the optics command, which reads your tests and runs them. Engines are optional add-ons: a driver for each kind of target (browser, phone, TV) and extra ways to find things on screen. You install the core once and add engines as you need them.
Before you begin#
You need Python 3.12 or newer. Check with:
$ python3 --version
Python 3.12.13If you have an older version, install a current one from python.org or your system's package manager.
Install the core#
We recommend the installer. It creates a private Python environment under ~/.optics, adds optics to your PATH, and leaves your system Python alone.
$ curl -fsSL https://optics-framework.org/install | shPS> irm https://optics-framework.org/install.ps1 | iexUse pip when you manage your own virtual environment, for example inside a CI job or an existing test repository.
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install optics-frameworkOpen a new terminal so it picks up the updated PATH, then check the install:
$ optics --version
Optics Framework 1.10.5Installer options
Pass options after sh -s --. On Windows, set the matching environment variable before running the installer.
| Option | Windows variable | What it does |
|---|---|---|
--version 1.10.5 | OPTICS_VERSION | Install a specific release. |
--extra appium,easyocr | OPTICS_EXTRA | Install engines at the same time. |
--dir PATH | OPTICS_INSTALL_DIR | Install somewhere other than ~/.optics. |
--no-modify-path | OPTICS_NO_MODIFY_PATH | Don't edit your shell profile. |
--dry-run | Print what would happen and change nothing. | |
--uninstall | Remove the managed install. |
$ curl -fsSL https://optics-framework.org/install | sh -s -- --extra playwright,easyocrAdd engines for your platform#
The core install ships without drivers, so it stays small. Add the ones for what you test. optics setup installs engines that match your Optics version:
$ optics setup --install playwrightPlaywright needs no server. Optics downloads its Chromium browser for you. To use Selenium instead, see Web.
$ optics setup --install appiumYou also need the Appium server, the Android SDK (for adb) and a device or emulator. Set up Android testing covers each one.
$ optics setup --install appiumYou also need the Appium server with the XCUITest driver, Xcode, and a simulator or device. See iOS.
Run optics setup with no options to pick engines from a list instead, or optics setup --list to see every name.
Optional engines#
Add these when a page tells you to. You don't need them for your first test.
| Engine | Install name | Adds |
|---|---|---|
| EasyOCR | easyocr | Finds elements by reading text on a screenshot. Runs locally. |
| Tesseract | pytesseract | A lighter OCR engine. Needs the Tesseract program installed too. |
| Google Vision | google-vision | Cloud OCR. Needs Google Cloud credentials. |
| Gemini | llm | Plain-English test creation and AI self-heal. Needs a Gemini API key. |
| MCP server | mcp | Lets AI agents drive Optics. Install with pip: pip install "optics-framework[mcp]". |
Bundles install several at once: mobile (Appium), web (Playwright and Selenium), vision (all OCR engines) and all (everything except the MCP server). The engines reference lists every engine.
Check your setup#
optics doctor checks Python, each engine, and the tools around them:
$ optics doctor🩺 optics doctor
Core
✅ python 3.12.13
✅ optics-framework installed, version 1.10.5
Engines
⚠️ Appium appium-python-client not installed
→ optics setup --install appium
✅ Playwright playwright 1.63.0
Web
✅ playwright browser Chromium download found✅ rows are ready. ⚠️ rows are optional or not needed for your platform. Pass a project folder (optics doctor my_project) to also check its config.yaml.
If the install doesn't work#
- **
optics: command not found.** Open a new terminal. If it still fails, add~/.optics/binto your PATH, as the installer printed. - **
optics setuprefuses to install.** Conda, pipx and tool-managed environments (uv tool, Poetry, PDM) manage their own packages, sooptics setupprints the right command for that tool instead. Run that command, or use a plain virtual environment. - EasyOCR fails under Conda. EasyOCR and Optics need different NumPy versions under Conda. Use the installer or a standard
venv.
Troubleshooting covers more cases.