OpenCode's config dir: /.opencode, or ~/.config/opencode globally. OpenCode loads plugins from /plugins/ in both. The global dir has no .opencode/ segment, so it cannot be built by joining _OPENCODE_PLUGIN_PATH onto a base the way the project one is (#3398).
(*, project: bool, project_dir: Path | None = None)
| 1927 | |
| 1928 | |
| 1929 | def _opencode_dir(*, project: bool, project_dir: Path | None = None) -> Path: |
| 1930 | """OpenCode's config dir: <project>/.opencode, or ~/.config/opencode globally. |
| 1931 | |
| 1932 | OpenCode loads plugins from <dir>/plugins/ in both. The global dir has no |
| 1933 | .opencode/ segment, so it cannot be built by joining _OPENCODE_PLUGIN_PATH |
| 1934 | onto a base the way the project one is (#3398). |
| 1935 | """ |
| 1936 | if project: |
| 1937 | return (project_dir or Path(".")) / ".opencode" |
| 1938 | return Path.home() / ".config" / "opencode" |
| 1939 | # First line of every plugin graphify has written, back to the first one (#71). |
| 1940 | _OPENCODE_PLUGIN_HEADER = "// graphify OpenCode plugin" |
| 1941 | def _opencode_plugin_is_v1_only(body: str) -> bool: |
no outgoing calls
no test coverage detected