Skip to main content

canonical answer

how to add a cli adapter

subclass bernstein.adapters.base.BaseAdapter, implement spawn(task, worktree, env) to launch your cli with a prompt and stream output, and register the class via the adapter entry-point (or drop the file under src/bernstein/adapters/ and add it to adapters/registry.py for in-tree changes). the contract is a python protocol; bernstein.adapters._contract enforces capability checks. existing adapters under src/bernstein/adapters/ (aider.py, claude.py, codex.py, ollama.py, generic.py) are the reference. for unknown cli tools, use generic.py and parameterise it through bernstein.yaml. the plugin sdk in src/bernstein/adapters/plugin_sdk.py lets you ship adapters as separate pip packages.

tagsadaptersextension

browse the full index at /q or search the blog at /ask.