Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(install): split Pi from OMP targets

AkitaOnRailse292445a46f3
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b42f593..b1cf1053 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
posts through a bounded best-effort queue instead of spawning one unbounded
fetch per event, reducing client-side request bursts while preserving direct
handoff fetches.
+- Corrected the Pi vs Oh My Pi / OMP install split: OMP remains supported via
+ `--client omp` / `--agent omp` (or `oh-my-pi`) and writes `.omp` config, while
+ real `pi` install commands now fail closed with guidance until the Pi bridge
+ lands. Users who previously used `pi` to mean OMP should switch to `omp` or
+ `oh-my-pi`.
## [1.5.0] - 2026-07-01
diff --git a/README.md b/README.md
index 1f5d0852..1b7b520d 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,8 @@
| OpenCode | Supported | Remote MCP config + generated TypeScript plugin. |
| Cursor | Supported | MCP config + lifecycle hooks. |
| Gemini CLI | Supported | MCP config + lifecycle hooks. |
-| Oh My Pi / OMP | Supported | `pi` / `omp` aliases for MCP config + TypeScript extension. |
+| Oh My Pi / OMP | Supported | Use `--client omp` / `--agent omp` (or `oh-my-pi`) for native `.omp` MCP config + TypeScript extension. |
+| Pi | Recognized, pending bridge | `--client pi` / `--agent pi` fail closed with guidance; real Pi MCP/hooks support needs the bridge tracked in #138. |
| Claude Desktop | MCP-only | Uses `mcp-remote`; no lifecycle hooks. |
| OpenClaw | Supported | MCP config + native plugin lifecycle hooks. |
| Antigravity CLI | Supported | MCP config (`serverUrl`) + lifecycle hooks (`agy` alias). |
@@ -81,7 +82,8 @@ priors are at the [bottom](#influences-and-prior-art).
- **Multi-agent + multi-machine ready.** Supported clients: Claude
Code, Codex, OpenCode, Cursor, Claude Desktop (via `mcp-remote`),
Gemini CLI, Antigravity CLI, Grok Build CLI, OpenClaw, Oh My Pi / OMP
- (`pi` / `omp` aliases), and VS Code GitHub Copilot agent mode
+ (`omp` / `oh-my-pi`), recognized-but-pending Pi, and VS Code GitHub
+ Copilot agent mode
(MCP-only, workspace `.vscode/mcp.json`).
Server runs local (loopback) OR on a homelab box (LAN/VPN/cloud)
with bearer-token auth. Shared servers can opt into
@@ -255,7 +257,8 @@ docker run -d --name ai-memory \
# 3. Wire your agent CLI in two commands. The wrapper takes care of
# mounts + auto-detecting ~/.claude/settings.json. Re-run with
# `--agent codex`, `--agent opencode`, `--agent gemini-cli`,
-# `--agent omp`/`pi`, `--client cursor`, `--client gemini-cli`, etc.
+# `--agent omp`, `--agent oh-my-pi`, `--client cursor`,
+# `--client gemini-cli`, etc.
# for additional agents; full list in docs/install.md.
ai-memory install-mcp --client claude-code --apply
ai-memory install-hooks --agent claude-code --apply
diff --git a/crates/ai-memory-cli/src/cli.rs b/crates/ai-memory-cli/src/cli.rs
index 01eef68a..8cc3a2a4 100644
--- a/crates/ai-memory-cli/src/cli.rs
+++ b/crates/ai-memory-cli/src/cli.rs
@@ -69,7 +69,7 @@ pub enum Command {
Hook(HookArgs),
/// Print MCP server registration snippets for any supported client
/// (Claude Code, Codex, OpenCode, Cursor, Claude Desktop, Gemini
- /// CLI, OpenClaw, pi). See docs/mcp-install.md for the full guide.
+ /// CLI, OpenClaw, OMP, Pi). See docs/mcp-install.md for the full guide.
InstallMcp(InstallMcpArgs),
/// Stage + commit the wiki tree under git.
Commit(CommitArgs),
@@ -791,10 +791,13 @@ pub enum AgentChoice {
/// them straight to `--agent`, which used to fail on this one.
#[value(alias = "opencode")]
OpenCode,
- /// Oh My Pi (`omp`) / Pi coding agent fork — TypeScript extension
+ /// Real Pi coding agent. Recognized separately from OMP, but hook
+ /// install intentionally fails closed until the Pi bridge lands.
+ Pi,
+ /// Oh My Pi (`omp`) — TypeScript extension
/// under `~/.omp/agent/extensions/`. `--apply` writes the extension
/// file directly; restart `omp` for it to load.
- #[value(alias = "pi", alias = "oh-my-pi")]
+ #[value(alias = "oh-my-pi")]
Omp,
/// OpenClaw personal AI gateway — native plugin package with
/// session/tool/compaction hooks.
@@ -837,9 +840,11 @@ pub enum McpClient {
GeminiCli,
/// OpenClaw personal AI gateway — `~/.openclaw/config.json`.
Openclaw,
- /// Oh My Pi (`omp`) / Pi-compatible coding agent — `~/.omp/agent/mcp.json`.
- #[value(alias = "omp", alias = "oh-my-pi")]
+ /// Real Pi coding agent. Pi core has no native MCP config yet.
Pi,
+ /// Oh My Pi (`omp`) — `~/.omp/agent/mcp.json`.
+ #[value(alias = "oh-my-pi")]
+ Omp,
/// Google Antigravity CLI (`agy`) — `~/.gemini/antigravity-cli/mcp_config.json`.
#[value(alias = "antigravity", alias = "agy")]
AntigravityCli,
@@ -1360,8 +1365,8 @@ mod tests {
use clap::Parser;
#[test]
- fn pi_mcp_client_aliases_parse_to_same_variant() {
- for alias in ["pi", "omp", "oh-my-pi"] {
+ fn pi_and_omp_mcp_clients_parse_to_distinct_variants() {
+ for (alias, expected_pi) in [("pi", true), ("omp", false), ("oh-my-pi", false)] {
let cli = Cli::try_parse_from([
"ai-memory",
"install-mcp",
@@ -1376,8 +1381,9 @@ mod tests {
panic!("expected install-mcp command for alias {alias}");
};
assert!(
- matches!(args.client, McpClient::Pi),
- "alias {alias} must resolve to the Pi/OMP MCP client"
+ matches!(args.client, McpClient::Pi) == expected_pi,
+ "alias {alias} resolved to unexpected MCP client: {:?}",
+ args.client
);
}
}
@@ -1572,8 +1578,8 @@ mod tests {
}
#[test]
- fn pi_hook_agent_aliases_parse_to_same_variant() {
- for alias in ["omp", "pi", "oh-my-pi"] {
+ fn pi_and_omp_hook_agents_parse_to_distinct_variants() {
+ for (alias, expected_pi) in [("pi", true), ("omp", false), ("oh-my-pi", false)] {
let cli = Cli::try_parse_from([
"ai-memory",
"install-hooks",
@@ -1588,8 +1594,9 @@ mod tests {
panic!("expected install-hooks command for alias {alias}");
};
assert!(
- matches!(args.agent, AgentChoice::Omp),
- "alias {alias} must resolve to the OMP hook agent"
+ matches!(args.agent, AgentChoice::Pi) == expected_pi,
+ "alias {alias} resolved to unexpected hook agent: {:?}",
+ args.agent
);
}
}
diff --git a/crates/ai-memory-cli/src/commands/install_hooks.rs b/crates/ai-memory-cli/src/commands/install_hooks.rs
index 66cc7391..3cd8785e 100644
--- a/crates/ai-memory-cli/src/commands/install_hooks.rs
+++ b/crates/ai-memory-cli/src/commands/install_hooks.rs
@@ -135,6 +135,7 @@ pub fn run(config: &Config, args: InstallHooksArgs) -> Result<()> {
if args.apply {
return match args.agent {
AgentChoice::OpenCode => apply_to_opencode_plugin(&server_url, auth, &args),
+ AgentChoice::Pi => bail_pi_hooks_unsupported(),
AgentChoice::Omp => apply_to_omp_extension(&server_url, auth, &args),
AgentChoice::ClaudeCode => {
let hooks_dir = resolve_hooks_dir(args.hooks_dir.as_deref(), args.agent)?;
@@ -178,6 +179,7 @@ pub fn run(config: &Config, args: InstallHooksArgs) -> Result<()> {
let strategy = args.project_strategy.baked();
match args.agent {
AgentChoice::OpenCode => render_opencode_plugin(&server_url, auth, strategy),
+ AgentChoice::Pi => bail_pi_hooks_unsupported(),
AgentChoice::Omp => render_omp_extension(&server_url, auth, strategy),
AgentChoice::ClaudeCode => {
let hooks_dir = resolve_hooks_dir(args.hooks_dir.as_deref(), args.agent)?;
@@ -327,7 +329,8 @@ fn infer_installed_mcp_config(agent: AgentChoice) -> Option<InferredMcpConfig> {
McpClient::Openclaw => {
infer_json_mcp_config(&content, &["mcp", "servers", "ai-memory"], "url")
}
- McpClient::Pi => infer_json_mcp_config(&content, &["mcpServers", "ai-memory"], "url"),
+ McpClient::Omp => infer_json_mcp_config(&content, &["mcpServers", "ai-memory"], "url"),
+ McpClient::Pi => None,
McpClient::AntigravityCli => {
infer_json_mcp_config(&content, &["mcpServers", "ai-memory"], "serverUrl")
}
@@ -348,15 +351,21 @@ fn mcp_client_for_agent(agent: AgentChoice) -> Option<McpClient> {
AgentChoice::Cursor => Some(McpClient::Cursor),
AgentChoice::GeminiCli => Some(McpClient::GeminiCli),
AgentChoice::OpenCode => Some(McpClient::OpenCode),
- AgentChoice::Omp => Some(McpClient::Pi),
+ AgentChoice::Omp => Some(McpClient::Omp),
AgentChoice::Openclaw => Some(McpClient::Openclaw),
AgentChoice::AntigravityCli => Some(McpClient::AntigravityCli),
// Grok manages its own MCP config under ~/.grok/; we don't
// auto-infer a hook server URL from it.
- AgentChoice::Grok => None,
+ AgentChoice::Pi | AgentChoice::Grok => None,
}
}
+fn bail_pi_hooks_unsupported<T>() -> Result<T> {
+ anyhow::bail!(
+ "Pi hook install is recognized but not supported in ai-memory yet. This command will not write ~/.pi or ~/.omp files. If you meant Oh My Pi / OMP, use `ai-memory install-hooks --agent omp --apply`; real Pi support will arrive with the bridge in issue #138."
+ )
+}
+
fn infer_json_mcp_config(
content: &str,
entry_path: &[&str],
@@ -2056,7 +2065,7 @@ fn resolve_hooks_dir(explicit: Option<&Path>, agent: AgentChoice) -> Result<Path
AgentChoice::GeminiCli => "gemini-cli",
AgentChoice::AntigravityCli => "antigravity-cli",
AgentChoice::Grok => "grok",
- AgentChoice::OpenCode | AgentChoice::Omp | AgentChoice::Openclaw => {
+ AgentChoice::OpenCode | AgentChoice::Pi | AgentChoice::Omp | AgentChoice::Openclaw => {
anyhow::bail!("{agent:?} uses a generated integration, not a hook script directory")
}
};
@@ -3211,6 +3220,27 @@ model = "gpt-5"
);
}
+ #[test]
+ fn pi_hook_install_fails_closed_without_writing_even_with_config_override() {
+ let tmp = TempDir::new().unwrap();
+ let path = tmp.path().join("extensions").join("ai-memory.ts");
+ let args = InstallHooksArgs {
+ agent: AgentChoice::Pi,
+ hooks_dir: None,
+ server_url: "http://127.0.0.1:49374".into(),
+ auth_token: None,
+ as_user: None,
+ apply: true,
+ config_file: Some(path.clone()),
+ project_strategy: ProjectStrategyArg::Basename,
+ };
+
+ let err = run(&Config::default(), args).unwrap_err().to_string();
+
+ assert!(err.contains("--agent omp"), "unexpected error: {err}");
+ assert!(!path.exists(), "Pi hook install must not write files");
+ }
+
// Windows 11 + Git Bash support matters for regulated enterprise setups
// where Git Bash is the approved shell available from the corporate
// repository, so this installer contract should be exercised anywhere
@@ -3227,7 +3257,7 @@ model = "gpt-5"
return;
};
- for alias in ["opencode", "openclaw", "pi", "oh-my-pi"] {
+ for alias in ["opencode", "openclaw", "omp", "oh-my-pi", "pi"] {
let output = Command::new(&bash)
.arg(&script)
.arg("--agent")
@@ -3248,10 +3278,15 @@ model = "gpt-5"
match alias {
"opencode" => assert!(stdout.contains("install-hooks --agent opencode --apply")),
"openclaw" => assert!(stdout.contains("install-hooks --agent openclaw --apply")),
- "pi" | "oh-my-pi" => {
+ "omp" | "oh-my-pi" => {
assert!(stdout.contains("install-hooks --agent omp --apply"));
assert!(stdout.contains("~/.omp/agent/extensions/ai-memory.ts"));
}
+ "pi" => {
+ assert!(stdout.contains("does not install real Pi hooks yet"));
+ assert!(!stdout.contains("install-hooks --agent omp --apply"));
+ assert!(!stdout.contains("~/.omp/agent/extensions/ai-memory.ts"));
+ }
_ => unreachable!(),
}
}
diff --git a/crates/ai-memory-cli/src/commands/install_mcp.rs b/crates/ai-memory-cli/src/commands/install_mcp.rs
index b3fc4de8..1f814f6c 100644
--- a/crates/ai-memory-cli/src/commands/install_mcp.rs
+++ b/crates/ai-memory-cli/src/commands/install_mcp.rs
@@ -11,7 +11,7 @@
//! community-standard `npx mcp-remote` stdio shim so the same HTTP
//! endpoint still works.
//!
-//! OMP/Pi uses a native `~/.omp/agent/mcp.json` file with the same
+//! OMP uses a native `~/.omp/agent/mcp.json` file with the same
//! `mcpServers` root as several other clients.
use std::path::PathBuf;
@@ -64,6 +64,7 @@ pub fn run(config: &Config, args: InstallMcpArgs) -> Result<()> {
McpClient::GeminiCli => render_gemini_cli(&args)?,
McpClient::Openclaw => render_openclaw(&args)?,
McpClient::Pi => render_pi(&args)?,
+ McpClient::Omp => render_omp(&args)?,
McpClient::AntigravityCli => render_antigravity_cli(&args)?,
McpClient::VsCodeCopilot => render_vscode_copilot(&args)?,
};
@@ -143,7 +144,8 @@ pub(crate) fn mcp_config_path(client: crate::cli::McpClient) -> Result<PathBuf>
}
McpClient::GeminiCli => home()?.join(".gemini").join("settings.json"),
McpClient::Openclaw => home()?.join(".openclaw").join("config.json"),
- McpClient::Pi => home()?.join(".omp").join("agent").join("mcp.json"),
+ McpClient::Pi => bail!(pi_mcp_unsupported_message()),
+ McpClient::Omp => home()?.join(".omp").join("agent").join("mcp.json"),
McpClient::AntigravityCli => home()?
.join(".gemini")
.join("antigravity-cli")
@@ -173,6 +175,9 @@ fn resolve_config_file(args: &InstallMcpArgs) -> Result<PathBuf> {
/// Mutate the resolved client config file in place. Idempotent —
/// re-runs that produce the same content are reported as no-op.
fn apply_to_config_file(args: &InstallMcpArgs) -> Result<()> {
+ if matches!(args.client, McpClient::Pi) {
+ bail!(pi_mcp_unsupported_message());
+ }
let path = resolve_config_file(args)?;
let outcome = match args.client {
McpClient::Codex => apply_atomic(&path, |existing| {
@@ -201,12 +206,12 @@ fn json_mcp_location(client: McpClient) -> Option<JsonMcpLocation> {
| McpClient::ClaudeDesktop
| McpClient::Cursor
| McpClient::GeminiCli
- | McpClient::Pi
+ | McpClient::Omp
| McpClient::AntigravityCli => Some(JsonMcpLocation::RootMcpServers),
McpClient::OpenCode => Some(JsonMcpLocation::RootMcp),
McpClient::Openclaw => Some(JsonMcpLocation::NestedMcpServers),
McpClient::VsCodeCopilot => Some(JsonMcpLocation::RootServers),
- McpClient::Codex => None,
+ McpClient::Codex | McpClient::Pi => None,
}
}
@@ -325,7 +330,7 @@ fn build_mcp_entry(args: &InstallMcpArgs) -> Result<serde_json::Value> {
entry.insert("headers".into(), json!({"Authorization": b}));
}
}
- McpClient::Pi => {
+ McpClient::Omp => {
entry.insert("type".into(), json!("http"));
entry.insert("url".into(), json!(args.server_url));
entry.insert("enabled".into(), json!(true));
@@ -608,12 +613,20 @@ fn render_openclaw(args: &InstallMcpArgs) -> Result<String> {
}
fn render_pi(args: &InstallMcpArgs) -> Result<String> {
+ let _ = args;
+ bail!(pi_mcp_unsupported_message())
+}
+
+fn pi_mcp_unsupported_message() -> &'static str {
+ "Pi core has no native MCP config support in ai-memory yet. If you meant Oh My Pi / OMP, use `ai-memory install-mcp --client omp`; real Pi MCP support will be added by the bridge in issue #138."
+}
+
+fn render_omp(args: &InstallMcpArgs) -> Result<String> {
Ok(format!(
"# Oh My Pi / OMP — merge into ~/.omp/agent/mcp.json:\n\
#\n\
# The current Oh My Pi package exposes the `omp` binary and native\n\
- # `.omp` config directories; `pi` is accepted here as the compatible\n\
- # client name. Restart `omp` after changing MCP config.\n\
+ # `.omp` config directories. Restart `omp` after changing MCP config.\n\
{snippet}\n",
snippet = render_json_mcp_fragment(args)?,
))
@@ -691,6 +704,7 @@ mod tests {
McpClient::GeminiCli => render_gemini_cli(&args).unwrap(),
McpClient::Openclaw => render_openclaw(&args).unwrap(),
McpClient::Pi => render_pi(&args).unwrap(),
+ McpClient::Omp => render_omp(&args).unwrap(),
McpClient::AntigravityCli => render_antigravity_cli(&args).unwrap(),
McpClient::VsCodeCopilot => render_vscode_copilot(&args).unwrap(),
}
@@ -708,7 +722,7 @@ mod tests {
McpClient::ClaudeDesktop,
McpClient::GeminiCli,
McpClient::Openclaw,
- McpClient::Pi,
+ McpClient::Omp,
McpClient::AntigravityCli,
McpClient::VsCodeCopilot,
] {
@@ -740,7 +754,7 @@ mod tests {
McpClient::ClaudeDesktop,
McpClient::GeminiCli,
McpClient::Openclaw,
- McpClient::Pi,
+ McpClient::Omp,
McpClient::AntigravityCli,
McpClient::VsCodeCopilot,
] {
@@ -763,6 +777,7 @@ mod tests {
McpClient::GeminiCli => render_gemini_cli(&args).unwrap(),
McpClient::Openclaw => render_openclaw(&args).unwrap(),
McpClient::Pi => render_pi(&args).unwrap(),
+ McpClient::Omp => render_omp(&args).unwrap(),
McpClient::AntigravityCli => render_antigravity_cli(&args).unwrap(),
McpClient::VsCodeCopilot => render_vscode_copilot(&args).unwrap(),
}
@@ -822,7 +837,13 @@ mod tests {
assert!(render_for_test(McpClient::ClaudeDesktop).contains("mcp-remote"));
assert!(render_for_test(McpClient::Openclaw).contains("\"streamable-http\""));
assert!(render_for_test(McpClient::Codex).contains("[mcp_servers.ai-memory]"));
- assert!(render_for_test(McpClient::Pi).contains("~/.omp/agent/mcp.json"));
+ assert!(render_for_test(McpClient::Omp).contains("~/.omp/agent/mcp.json"));
+ assert!(
+ render_pi(&args_for(McpClient::Pi))
+ .unwrap_err()
+ .to_string()
+ .contains("--client omp")
+ );
assert!(render_for_test(McpClient::AntigravityCli).contains("\"serverUrl\""));
// VS Code Copilot must use the `servers` top-level key — the
// `mcpServers` form is silently ignored by VS Code's MCP
@@ -834,6 +855,20 @@ mod tests {
assert!(vsc.contains("\"type\": \"http\""));
}
+ #[test]
+ fn pi_apply_fails_closed_without_writing_even_with_config_override() {
+ let tmp = tempfile::TempDir::new().unwrap();
+ let path = tmp.path().join("mcp.json");
+ let mut args = args_for(McpClient::Pi);
+ args.apply = true;
+ args.config_file = Some(path.clone());
+
+ let err = apply_to_config_file(&args).unwrap_err().to_string();
+
+ assert!(err.contains("--client omp"), "unexpected error: {err}");
+ assert!(!path.exists(), "Pi install must not write ignored config");
+ }
+
/// The Codex apply path must emit block-form `[mcp_servers.<name>]`
/// headers, NOT a dotted inline-table on one line. Regression
/// guard: M22 originally created `mcp_servers = { ai-memory = {...} }`
diff --git a/crates/ai-memory-cli/src/commands/setup_agent.rs b/crates/ai-memory-cli/src/commands/setup_agent.rs
index 70bd1daf..89c57360 100644
--- a/crates/ai-memory-cli/src/commands/setup_agent.rs
+++ b/crates/ai-memory-cli/src/commands/setup_agent.rs
@@ -59,11 +59,16 @@ pub fn run(config: &Config, args: SetupAgentArgs) -> Result<()> {
auth_token: args.auth_token.or_else(|| config.auth.bearer_token.clone()),
..args
};
+ if matches!(args.agent, AgentChoice::Pi) {
+ bail!(
+ "Pi setup is recognized but not supported in ai-memory yet. This command will not write ~/.pi or ~/.omp files. If you meant Oh My Pi / OMP, use the OMP agent/client names instead; real Pi support will arrive with the bridge in issue #138."
+ );
+ }
if matches!(
args.agent,
AgentChoice::OpenCode | AgentChoice::Omp | AgentChoice::Openclaw
) {
- emit_extension_setup_hint(&args);
+ emit_extension_setup_hint(&args)?;
return Ok(());
}
let agent_sub = match args.agent {
@@ -73,9 +78,9 @@ pub fn run(config: &Config, args: SetupAgentArgs) -> Result<()> {
AgentChoice::GeminiCli => "gemini-cli",
AgentChoice::AntigravityCli => "antigravity-cli",
AgentChoice::Grok => "grok",
- AgentChoice::OpenCode => unreachable!("opencode handled above"),
- AgentChoice::Omp => unreachable!("omp handled above"),
- AgentChoice::Openclaw => unreachable!("openclaw handled above"),
+ AgentChoice::OpenCode | AgentChoice::Pi | AgentChoice::Omp | AgentChoice::Openclaw => {
+ bail!("internal: generated integration should have returned before staging hooks")
+ }
};
let source = resolve_source(args.source.as_deref(), agent_sub)?;
@@ -142,10 +147,10 @@ pub fn run(config: &Config, args: SetupAgentArgs) -> Result<()> {
&args,
&[&ANTIGRAVITY_TOOL_EVENTS, &ANTIGRAVITY_LIFECYCLE_EVENTS],
),
- AgentChoice::OpenCode => unreachable!("opencode handled above"),
- AgentChoice::Omp => unreachable!("omp handled above"),
- AgentChoice::Openclaw => {
- unreachable!("openclaw handled by the generated-integration hint above");
+ AgentChoice::OpenCode | AgentChoice::Pi | AgentChoice::Omp | AgentChoice::Openclaw => {
+ bail!(
+ "internal: generated integration should have returned before emitting staged hooks"
+ )
}
}
Ok(())
@@ -155,7 +160,7 @@ fn normalise_hook_server_url(url: &str) -> String {
url.trim().trim_end_matches('/').to_string()
}
-fn emit_extension_setup_hint(args: &SetupAgentArgs) {
+fn emit_extension_setup_hint(args: &SetupAgentArgs) -> Result<()> {
let (label, agent, restart_note, mcp_client) = match args.agent {
AgentChoice::OpenCode => (
"OpenCode",
@@ -167,7 +172,7 @@ fn emit_extension_setup_hint(args: &SetupAgentArgs) {
"OMP",
"omp",
"Then restart OMP so it loads ~/.omp/agent/extensions/ai-memory.ts.",
- "pi",
+ "omp",
),
AgentChoice::Openclaw => (
"OpenClaw",
@@ -175,7 +180,7 @@ fn emit_extension_setup_hint(args: &SetupAgentArgs) {
"Then restart the OpenClaw gateway if it does not auto-restart after plugin install.",
"openclaw",
),
- _ => unreachable!("only generated-integration agents reach this hint"),
+ other => bail!("internal: {other:?} is not a generated-integration agent"),
};
println!("# {label} uses a TypeScript extension/plugin, not extracted shell scripts.");
println!("# Install it directly instead:");
@@ -190,6 +195,7 @@ fn emit_extension_setup_hint(args: &SetupAgentArgs) {
println!();
println!("{restart_note}");
println!("Also run `ai-memory install-mcp --client {mcp_client}` to wire MCP separately.");
+ Ok(())
}
fn emit_claude_code(emit_root: &Path, args: &SetupAgentArgs) -> Result<()> {
@@ -401,6 +407,24 @@ mod tests {
assert_eq!(candidates, vec![PathBuf::from("/custom/src/codex")]);
}
+ #[test]
+ fn pi_setup_fails_closed_before_copying() {
+ let tmp = tempfile::TempDir::new().unwrap();
+ let args = SetupAgentArgs {
+ agent: AgentChoice::Pi,
+ to: tmp.path().join("hooks"),
+ host_prefix: None,
+ server_url: "http://127.0.0.1:49374".into(),
+ auth_token: None,
+ source: Some(tmp.path().join("source")),
+ };
+
+ let err = run(&Config::default(), args).unwrap_err().to_string();
+
+ assert!(err.contains("real Pi support"), "unexpected error: {err}");
+ assert!(!tmp.path().join("hooks").exists());
+ }
+
#[test]
fn manual_script_paths_use_agent_specific_events() {
let root = Path::new("/hooks/gemini-cli");
diff --git a/crates/ai-memory-cli/src/commands/uninstall.rs b/crates/ai-memory-cli/src/commands/uninstall.rs
index e57f9777..c5f04d8c 100644
--- a/crates/ai-memory-cli/src/commands/uninstall.rs
+++ b/crates/ai-memory-cli/src/commands/uninstall.rs
@@ -190,7 +190,7 @@ fn build_plan(args: &UninstallArgs) -> anyhow::Result<Vec<PlannedChange>> {
ClaudeDesktop,
GeminiCli,
Openclaw,
- Pi,
+ Omp,
AntigravityCli,
VsCodeCopilot,
] {
@@ -660,12 +660,12 @@ fn mcp_servers_path(client: McpClient) -> Option<&'static [&'static str]> {
| McpClient::ClaudeDesktop
| McpClient::Cursor
| McpClient::GeminiCli
- | McpClient::Pi
+ | McpClient::Omp
| McpClient::AntigravityCli => Some(&["mcpServers"]),
McpClient::OpenCode => Some(&["mcp"]),
McpClient::Openclaw => Some(&["mcp", "servers"]),
McpClient::VsCodeCopilot => Some(&["servers"]),
- McpClient::Codex => None,
+ McpClient::Codex | McpClient::Pi => None,
}
}
@@ -1156,11 +1156,11 @@ mod tests {
}
#[test]
- fn strip_mcp_pi_root_servers() {
+ fn strip_mcp_omp_root_servers() {
let content = r#"{"mcpServers":{"ai-memory":{"type":"http","url":"http://127.0.0.1:49374/mcp","enabled":true}}}"#;
let (out, removed) = strip_mcp_json(
content,
- McpClient::Pi,
+ McpClient::Omp,
Some("ai-memory"),
"http://127.0.0.1:49374/mcp",
)
diff --git a/docs/deploy.md b/docs/deploy.md
index ca0ec4a7..8641dddb 100644
--- a/docs/deploy.md
+++ b/docs/deploy.md
@@ -100,7 +100,7 @@ curl -sI http://homelab:49374/handoff \
**Then update every MCP client** to send the same token. `ai-memory
install-mcp --client <name> --auth-token <token>` prints the exact
snippet per client (Claude Code, Codex, OpenCode, Cursor, Claude
-Desktop, Gemini CLI, OpenClaw, OMP/Pi, Antigravity CLI). The agent CLI sends an
+Desktop, Gemini CLI, OpenClaw, OMP / Oh My Pi, Antigravity CLI). The agent CLI sends an
`Authorization: Bearer <token>` header on every call; ai-memory's
middleware validates with a constant-time comparison.
diff --git a/docs/install.md b/docs/install.md
index e9f5232c..14e01d2a 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -534,7 +534,7 @@ loaded at startup.
```bash
docker run --rm akitaonrails/ai-memory:latest \
- install-mcp --client pi \
+ install-mcp --client omp \
--server-url "http://homelab:49374/mcp" \
--auth-token "$TOKEN"
@@ -546,9 +546,11 @@ ai-memory install-hooks --agent omp --apply \
```
Restart OMP after installing or changing the extension; extensions are
-loaded at startup. The ai-memory CLI accepts `--client pi` /
-`--client omp` for MCP and `--agent omp` / `--agent pi` for hooks;
-all four target the same current Oh My Pi integration surface.
+loaded at startup. The ai-memory CLI accepts `--client omp` (or
+`--client oh-my-pi`) for MCP and `--agent omp` (or `--agent oh-my-pi`)
+for hooks; both target OMP's native `.omp` integration surface. Real Pi
+is recognized separately, but `--client pi` and `--agent pi` fail closed
+until the Pi bridge lands in #138.
### Bind mounts vs docker cp
@@ -659,10 +661,12 @@ docker run --rm akitaonrails/ai-memory:latest \
```
The curl script installer supports
-`--agent claude-code|codex|cursor|gemini-cli|antigravity-cli|grok|opencode|openclaw|omp|pi`
+`--agent claude-code|codex|cursor|gemini-cli|antigravity-cli|grok|opencode|openclaw|omp|oh-my-pi|pi`
and `--to <dir>`; `--help` prints the full flag list. OpenCode,
-OpenClaw, and OMP do not need script extraction because `install-hooks`
-generates TypeScript plugin/extension files for them instead.
+OpenClaw, and OMP / Oh My Pi do not need script extraction because
+`install-hooks` generates TypeScript plugin/extension files for them
+instead. Real Pi is recognized separately, but the curl installer only
+prints fail-closed guidance until the Pi bridge lands.
This path is friction-free when:
- You have curl + bash but not docker
diff --git a/docs/mcp-install.md b/docs/mcp-install.md
index fa561ffd..0e46d051 100644
--- a/docs/mcp-install.md
+++ b/docs/mcp-install.md
@@ -84,7 +84,7 @@ metadata.
> **One-shot tip:** every snippet below is also reachable from the
> CLI:
> ```bash
-> ai-memory install-mcp --client gemini-cli # or cursor / claude-desktop / openclaw / pi|omp / antigravity-cli / vscode-copilot
+> ai-memory install-mcp --client gemini-cli # or cursor / claude-desktop / openclaw / omp / antigravity-cli / vscode-copilot
> ```
---
@@ -436,18 +436,18 @@ OpenClaw distinguishes transports explicitly. Use
## Oh My Pi / OMP
-**Status:** ✅ MCP supported via `install-mcp --client pi` or
-`--client omp`. ✅ Lifecycle capture supported via
-`ai-memory install-hooks --agent omp --apply` or `--agent pi --apply`.
+**Status:** ✅ MCP supported via `install-mcp --client omp` (or
+`--client oh-my-pi`). ✅ Lifecycle capture supported via
+`ai-memory install-hooks --agent omp --apply` (or `--agent oh-my-pi`).
**Config file:**
- User: `~/.omp/agent/mcp.json`
- Project: `.omp/mcp.json`
The current Oh My Pi package exposes the `omp` binary and native
-`.omp` config directories. The ai-memory CLI accepts `--client pi` /
-`--client omp` for MCP and `--agent omp` / `--agent pi` for lifecycle
-capture; they are aliases for this same integration surface.
+`.omp` config directories. Use `omp` (or `oh-my-pi`) for this integration;
+real `pi` is recognized separately, but install commands fail closed until
+the Pi bridge lands in #138.
```json
{
@@ -465,14 +465,17 @@ capture; they are aliases for this same integration surface.
```bash
ai-memory install-hooks --agent omp --apply
-# or:
-ai-memory install-hooks --agent pi --apply
+# or: ai-memory install-hooks --agent oh-my-pi --apply
```
This writes `~/.omp/agent/extensions/ai-memory.ts`, which OMP discovers
as a direct TypeScript extension on startup. Restart `omp` after
installing or changing the file.
+`ai-memory install-mcp --client pi` does not write `~/.pi/agent/mcp.json`:
+Pi core has no native MCP config in ai-memory yet. Users who meant OMP should
+use `--client omp`; real Pi support will be added by the bridge in #138.
+
**Gotchas:**
- OMP extensions are TypeScript modules, not shell hooks; stdout is not
used for context injection.
diff --git a/docs/windows.md b/docs/windows.md
index 1de92e0b..d6bb0111 100644
--- a/docs/windows.md
+++ b/docs/windows.md
@@ -268,9 +268,11 @@ Windows agent builds.
- MCP over HTTP should be less path-sensitive than hooks, but
`install-mcp --apply` still writes to a client-specific config file;
confirm the agent actually loads it.
-- OpenClaw, OpenCode, and OMP/Pi use generated TypeScript integrations
- rather than the shell hook bundle, so their Windows behavior depends
- on the host runtime loading those files correctly.
+- OpenClaw, OpenCode, and OMP / Oh My Pi use generated TypeScript
+ integrations rather than the shell hook bundle, so their Windows
+ behavior depends on the host runtime loading those files correctly.
+ Real Pi is recognized separately, but ai-memory does not install real
+ Pi hooks until the bridge integration lands.
## Suggested Test Checklist
diff --git a/scripts/install-hooks.sh b/scripts/install-hooks.sh
index d7ee22ed..4a8eea7d 100755
--- a/scripts/install-hooks.sh
+++ b/scripts/install-hooks.sh
@@ -10,7 +10,7 @@
# | bash -s -- --agent claude-code
#
# Options:
-# --agent <claude-code|codex|cursor|gemini-cli|antigravity-cli|grok|opencode|openclaw|omp|pi>
+# --agent <claude-code|codex|cursor|gemini-cli|antigravity-cli|grok|opencode|openclaw|omp|oh-my-pi|pi>
# which agent (default: claude-code;
# generated-plugin agents print hints)
# --to <dir> install root (default: $HOME/.ai-memory/hooks)
@@ -66,13 +66,21 @@ if [[ "$AGENT" == "openclaw" ]]; then
exit 0
fi
-if [[ "$AGENT" == "omp" || "$AGENT" == "pi" || "$AGENT" == "oh-my-pi" ]]; then
+if [[ "$AGENT" == "omp" || "$AGENT" == "oh-my-pi" ]]; then
echo "OMP uses a generated TypeScript extension, not shell hook scripts."
echo "Run: ai-memory install-hooks --agent omp --apply"
echo "Then restart OMP so it loads ~/.omp/agent/extensions/ai-memory.ts."
exit 0
fi
+if [[ "$AGENT" == "pi" ]]; then
+ echo "Pi is recognized separately from Oh My Pi / OMP, but ai-memory does not install real Pi hooks yet."
+ echo "This installer will not write ~/.pi or ~/.omp files."
+ echo "If you meant Oh My Pi / OMP, rerun with --agent omp or --agent oh-my-pi."
+ echo "Real Pi support will arrive with the bridge in issue #138."
+ exit 0
+fi
+
SCRIPTS=(
"session-start"
"user-prompt-submit"