Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ interface MexPersistedConfig {
[key: string]: unknown;
}

const VALID_AI_TOOLS = new Set<string>(["claude", "cursor", "windsurf", "copilot", "opencode", "codex"]);
const VALID_AI_TOOLS = new Set<string>(["claude", "cursor", "windsurf", "copilot", "opencode", "codex", "pi"]);

function loadAiTools(raw: MexPersistedConfig | null): AiTool[] {
const arr = raw?.aiTools;
Expand Down
16 changes: 10 additions & 6 deletions src/setup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const TOOL_CONFIGS: Record<string, { src: string; dest: string }> = {
"4": { src: ".tool-configs/copilot-instructions.md", dest: ".github/copilot-instructions.md" },
"5": { src: ".tool-configs/opencode.json", dest: ".opencode/opencode.json" },
"6": { src: ".tool-configs/CLAUDE.md", dest: "AGENTS.md" }, // Codex reads AGENTS.md at root
"7": { src: ".tool-configs/CLAUDE.md", dest: "AGENTS.md" }, // Pi reads AGENTS.md at startup
};

// ── Helpers ──
Expand Down Expand Up @@ -346,6 +347,7 @@ const TOOL_CHOICE_MAP: Record<string, AiTool> = {
"4": "copilot",
"5": "opencode",
"6": "codex",
"7": "pi",
};

async function selectToolConfig(
Expand All @@ -361,11 +363,12 @@ async function selectToolConfig(
console.log(" 4) GitHub Copilot");
console.log(" 5) OpenCode");
console.log(" 6) Codex (OpenAI)");
console.log(" 7) Multiple (select next)");
console.log(" 8) None / skip");
console.log(" 7) Pi");
console.log(" 8) Multiple (select next)");
console.log(" 9) None / skip");
console.log();

const choice = (await rl.question("Choice [1-8] (default: 1): ")).trim() || "1";
const choice = (await rl.question("Choice [1-9] (default: 1): ")).trim() || "1";

let selectedClaude = false;
const selectedTools: AiTool[] = [];
Expand Down Expand Up @@ -409,16 +412,17 @@ async function selectToolConfig(
case "4":
case "5":
case "6":
case "7":
copyConfig(choice);
break;
case "7": {
const multi = (await rl.question("Enter tool numbers separated by spaces (e.g. 1 2 5): ")).trim();
case "8": {
const multi = (await rl.question("Enter tool numbers separated by spaces (e.g. 1 2 5 7): ")).trim();
for (const c of multi.split(/\s+/)) {
copyConfig(c);
}
break;
}
case "8":
case "9":
info("Skipped tool config — AGENTS.md in .mex/ works with any tool that can read files");
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export async function runSync(
case "1":
if (!syncTool) {
console.log(chalk.yellow("No supported AI CLI detected. Falling back to prompts mode."));
console.log(chalk.dim("Supported CLIs: claude, opencode, codex"));
console.log(chalk.dim("Supported CLIs: claude, opencode, codex, pi"));
console.log();
mode = "prompts";
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// ── AI Tool ──

export type AiTool = "claude" | "cursor" | "windsurf" | "copilot" | "opencode" | "codex";
export type AiTool = "claude" | "cursor" | "windsurf" | "copilot" | "opencode" | "codex" | "pi";

export interface AiToolMeta {
name: string;
Expand All @@ -18,6 +18,7 @@ export const AI_TOOLS: Record<AiTool, AiToolMeta> = {
copilot: { name: "Copilot", cli: null, promptFlag: [] },
opencode: { name: "OpenCode", cli: "opencode", promptFlag: ["run"] },
codex: { name: "Codex", cli: "codex", promptFlag: [] },
pi: { name: "Pi", cli: "pi", promptFlag: ["-p"] },
};

// ── Config ──
Expand Down
4 changes: 4 additions & 0 deletions templates/.tool-configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Most embed the same content — a pointer to `.mex/ROUTER.md`. OpenCode uses a J
| GitHub Copilot | `copilot-instructions.md` → copy to `.github/` in project root |
| OpenCode | `opencode.json` → copy to `.opencode/` in project root |
| Codex (OpenAI) | Copy `CLAUDE.md` as `AGENTS.md` to project root |
| Pi | Copy `CLAUDE.md` as `AGENTS.md` to project root |
| Any other tool | Point agent to `.mex/AGENTS.md` |

## Setup
Expand All @@ -37,6 +38,9 @@ mkdir -p .opencode && cp .tool-configs/opencode.json ./.opencode/opencode.json

# Codex (OpenAI)
cp .tool-configs/CLAUDE.md ./AGENTS.md

# Pi
cp .tool-configs/CLAUDE.md ./AGENTS.md
```

## If your tool is not listed
Expand Down