MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / opencode_prompt_path

Function opencode_prompt_path

src/agents/opencode.rs:179–194  ·  view source on GitHub ↗

Returns the path to the global AGENTS.md prompt file.

(home: &Path)

Source from the content-addressed store, hash-verified

177
178/// Returns the path to the global AGENTS.md prompt file.
179fn opencode_prompt_path(home: &Path) -> std::path::PathBuf {
180 let modern = home.join(".config/opencode/AGENTS.md");
181 if modern.exists() || home.join(".config/opencode").exists() {
182 return modern;
183 }
184 if let Ok(xdg) = std::env::var("XDG_CONFIG_HOME") {
185 let xdg_path = std::path::PathBuf::from(&xdg);
186 if xdg_path.starts_with(home) {
187 let xdg_dir = xdg_path.join("opencode");
188 if xdg_dir.exists() {
189 return xdg_dir.join("AGENTS.md");
190 }
191 }
192 }
193 home.join("AGENTS.md")
194}
195
196// ---------------------------------------------------------------------------
197// Install helpers

Callers 4

installMethod · 0.70
uninstallMethod · 0.70
export_managed_skillsMethod · 0.70
doctor_check_promptFunction · 0.70

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected