Summary
Surfaced via automated review on #2727 (_install_opencode_command, adding the native /graphify slash command). A non-project (global, no --project) OpenCode install writes the plugin and the slash command to the current working directory's .opencode/ instead of the documented ~/.config/opencode/.
Where
Both _install_opencode_plugin and _install_opencode_command in graphify/install.py document the intended global location in their own docstrings:
OpenCode auto-loads every plugin file under .opencode/plugins/ (project) or ~/.config/opencode/plugins/ (global) at startup
Only a markdown file under .opencode/commands/ (or ~/.config/opencode/commands/ globally) becomes a /-menu entry
But every call site passes Path(".") for the non-project case instead of a ~/.config/opencode base:
_install_opencode_plugin(project_dir if project else Path("."))
_install_opencode_command(project_dir if project else Path("."))
_OPENCODE_PLUGIN_PATH/_OPENCODE_COMMAND_PATH also hardcode a leading .opencode/ segment, which is right for a project-relative install (<project_dir>/.opencode/plugins/graphify.js) but wrong for the global case (should be ~/.config/opencode/plugins/graphify.js, no extra .opencode/ nesting) — so this needs more than just swapping the base path.
This predates #2709/#2727; the slash command PR just inherited the same pattern from its sibling function for consistency, since fixing it there would have meant reworking both functions across their several call sites in install(), _agents_install, _agents_uninstall, and uninstall_all.
Fix
Likely needs _install_opencode_plugin/_install_opencode_command (and their uninstall counterparts) to take an explicit project: bool (or a pre-resolved base path) rather than always joining onto whatever project_dir they're handed, so the global case can correctly target ~/.config/opencode/ without the extra .opencode/ segment, matching how ~/.config/opencode/skills/graphify/SKILL.md is already resolved elsewhere in this file for the OpenCode skill itself.
Summary
Surfaced via automated review on #2727 (
_install_opencode_command, adding the native/graphifyslash command). A non-project (global, no--project) OpenCode install writes the plugin and the slash command to the current working directory's.opencode/instead of the documented~/.config/opencode/.Where
Both
_install_opencode_pluginand_install_opencode_commandingraphify/install.pydocument the intended global location in their own docstrings:But every call site passes
Path(".")for the non-project case instead of a~/.config/opencodebase:_OPENCODE_PLUGIN_PATH/_OPENCODE_COMMAND_PATHalso hardcode a leading.opencode/segment, which is right for a project-relative install (<project_dir>/.opencode/plugins/graphify.js) but wrong for the global case (should be~/.config/opencode/plugins/graphify.js, no extra.opencode/nesting) — so this needs more than just swapping the base path.This predates #2709/#2727; the slash command PR just inherited the same pattern from its sibling function for consistency, since fixing it there would have meant reworking both functions across their several call sites in
install(),_agents_install,_agents_uninstall, anduninstall_all.Fix
Likely needs
_install_opencode_plugin/_install_opencode_command(and their uninstall counterparts) to take an explicitproject: bool(or a pre-resolved base path) rather than always joining onto whateverproject_dirthey're handed, so the global case can correctly target~/.config/opencode/without the extra.opencode/segment, matching how~/.config/opencode/skills/graphify/SKILL.mdis already resolved elsewhere in this file for the OpenCode skill itself.