Skip to content

Instantly share code, notes, and snippets.

@goofansu
Created June 19, 2026 14:12
Show Gist options
  • Select an option

  • Save goofansu/4ab224d0eecb10645bffd3588ca6154a to your computer and use it in GitHub Desktop.

Select an option

Save goofansu/4ab224d0eecb10645bffd3588ca6154a to your computer and use it in GitHub Desktop.
Backup of pi-stuff worktrunk extension before removal
/**
* Worktrunk status marker extension
*
* Updates the wt list activity marker to reflect Pi's current state:
* πŸ€– β€” Pi is working
* πŸ’¬ β€” Pi is waiting for input
*
* Requires the worktrunk CLI (https://worktrunk.dev).
* Markers appear in `wt list` alongside the current branch.
*/
import { execFile } from "node:child_process";
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
function wtMarker(args: string[]): void {
execFile("wt", ["config", "state", "marker", ...args]);
}
export default function (pi: ExtensionAPI) {
pi.on("session_start", async () => {
wtMarker(["set", "πŸ’¬"]);
});
pi.on("agent_start", async () => {
wtMarker(["set", "πŸ€–"]);
});
pi.on("agent_end", async () => {
wtMarker(["set", "πŸ’¬"]);
});
pi.on("session_shutdown", async () => {
wtMarker(["clear"]);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment