Prerequisites
- Home Assistant
2025.2.4or newer - An OpenCode Zen API key (free to create)
- Python 3.12+ (bundled with Home Assistant)
Option 1 — HACS (recommended)
Add this repository as a custom repository, then install it as a normal integration.
-
Open HACS
Go to HACS → Integrations in the sidebar.
-
Add the custom repository
Click the ⋮ menu (top-right) → Custom repositories. Add:
https://github.com/pranjal-joshi/opencodewith category Integration, then click Add.
-
Install
Find OpenCode in the list, click Download, then Install.
-
Restart Home Assistant
Restart, then head to Configuration.
Option 2 — Manual install
Download the latest release ZIP and extract custom_components/opencode into your config/custom_components/ directory. Restart Home Assistant.
The integration pulls in the
openai Python package automatically during setup. On some installs, you may need to wait a moment for the dependency to be installed.
Never share your OpenCode Zen API key. It is stored in Home Assistant's encrypted
.storage files and grants access to your account billing.