OpenCode plugin for Doodba-based Odoo development. Fast code indexing, environment setup, and test execution.
- Search — Find Odoo models, fields, views, methods by name or pattern
- Detailed Info — Get field types, method signatures, view XML, etc.
- References — Find all references to a model or field in your codebase
- Filtering — Search by attributes (e.g., "required fields") or module
- Indexing — Re-index Odoo code with automatic change detection
- Status — View current index statistics and metadata
- Setup —
/doodba-setupvalidates Docker, Python, uv, and builds the indexer - Testing —
/doodba-testruns module tests via Doodba'sinvoke test
Add to your Doodba project's opencode.json (in the project root, not your global OpenCode config):
{
"plugin": ["doodba-dev@git+https://github.com/rrebollo/opencode-doodba-dev.git"]
}This ensures the plugin is only active when you open the Doodba project. Restart OpenCode. The plugin auto-installs and tools auto-register.
Nine tools appear in chat immediately after installation:
-
doodba_search — Search for Odoo models, fields, views, or methods. Use
typeparameter to filter (model/field/view/method/menuitem/xml_id),parentto scope to specific model,moduleto filter by module. -
doodba_get_details — Get detailed information about a specific Odoo entity. Returns field types, method signatures, view XML, or menuitem hierarchy depending on entity type.
-
doodba_list_modules — List all indexed Odoo modules. Use optional
patternparameter for glob-style filtering (e.g., 'sale*'). -
doodba_module_stats — Get item count statistics for a specific Odoo module. Shows counts of models, fields, views, methods, etc.
-
doodba_find_refs — Find all references to a model or field in the index. Returns file paths, line numbers, reference types, and context for each reference.
-
doodba_search_by_attr — Search entities by attribute value. For example, find all required fields by passing
{"required": true}as filters. -
doodba_search_xml_id — Search for Odoo XML IDs (external IDs) in the index. Use optional
modulefilter andlimitparameters. -
doodba_update_index — Re-index Odoo source code. Provide comma-separated root paths containing Odoo modules. Use
modulesparameter to index specific modules only. Usefullflag for complete re-index (clears existing data first). Note:/and the home directory are blocked for safety. -
doodba_index_status — Show current index status including item counts (models, fields, views, etc.) and last indexed timestamp.
When a Doodba project is detected, the plugin automatically injects the doodba-exploring skill into OpenCode. This skill instructs the AI to use the doodba_* tools proactively when exploring Odoo code — before reading files, before writing code, and when validating model/field/XML ID references.
-
/doodba-setup — Validate Doodba environment (Docker, Python, uv), detect Odoo path, and build the indexer database.
-
/doodba-test — Run Odoo module tests using Doodba's
invoke testcommand.
The plugin is installed once in OpenCode's cache and then frozen at that version. To get a newer version, delete the cache directory and restart OpenCode:
rm -rf ~/.cache/opencode/packages/doodba-dev@git+https:/github.com/rrebollo/opencode-doodba-dev.gitOpenCode will re-install the latest version on next start.
To pin a specific version instead, use a git tag in the URL:
{
"plugin": ["doodba-dev@git+https://github.com/rrebollo/opencode-doodba-dev.git#v0.1.0"]
}Then delete and re-install (as above) when you want to update to a new pinned version.
- Check OpenCode logs:
opencode run --print-logs "hello" 2>&1 | grep -i doodba - Verify the plugin line in your
opencode.jsonis correct - Restart OpenCode
- Verify plugin is loading (see troubleshooting above)
- Restart OpenCode
- Check that your
opencode.jsonis valid JSON
Built with TypeScript and Bun.
bun install
bun testMIT