Skip to content

Instantly share code, notes, and snippets.

@ericjuta
Created January 25, 2026 20:03
Show Gist options
  • Select an option

  • Save ericjuta/cbef4665d70b268f62a456a2146f05cd to your computer and use it in GitHub Desktop.

Select an option

Save ericjuta/cbef4665d70b268f62a456a2146f05cd to your computer and use it in GitHub Desktop.
update-pi.ts
#!/usr/bin/env bun
import { $ } from "bun";
console.log("Updating pi...");
await $`bun update -g @mariozechner/pi-coding-agent`.quiet();
console.log("✓ pi updated\n");
const BASE = "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/examples/extens
ions";
const files: Record<string, string> = {
"extensions/inline-bash.ts": "inline-bash.ts",
"extensions/permission-gate.ts": "permission-gate.ts",
"extensions/protected-paths.ts": "protected-paths.ts",
"extensions/notify.ts": "notify.ts",
"extensions/git-checkpoint.ts": "git-checkpoint.ts",
"extensions/subagent/index.ts": "subagent/index.ts",
"extensions/subagent/agents.ts": "subagent/agents.ts",
"agents/scout.md": "subagent/agents/scout.md",
"agents/planner.md": "subagent/agents/planner.md",
"agents/reviewer.md": "subagent/agents/reviewer.md",
"agents/worker.md": "subagent/agents/worker.md",
"prompts/implement.md": "subagent/prompts/implement.md",
"prompts/scout-and-plan.md": "subagent/prompts/scout-and-plan.md",
"prompts/implement-and-review.md": "subagent/prompts/implement-and-review.md",
};
const piDir = `${Bun.env.HOME}/.pi/agent`;
for (const [local, remote] of Object.entries(files)) {
const url = `${BASE}/${remote}`;
const path = `${piDir}/${local}`;
const res = await fetch(url);
if (res.ok) {
await Bun.write(path, await res.text());
console.log(`\u2713 ${local}`);
} else {
console.log(`\u2717 ${local} (${res.status})`);
}
}
console.log("\nDone!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment