Commit d9f7c692a624

Vincent Demeester <vincent@sbr.pm>
2026-02-02 15:56:59
pi: add hostname extension to display host in status line
1 parent c478674
Changed files (1)
dots
pi
agent
extensions
dots/pi/agent/extensions/hostname.ts
@@ -0,0 +1,16 @@
+/**
+ * Hostname Extension
+ *
+ * Displays the current hostname in the status line (footer).
+ * Useful when working across multiple machines.
+ */
+
+import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
+import { hostname } from "node:os";
+
+export default function (pi: ExtensionAPI) {
+	pi.on("session_start", async (_event, ctx) => {
+		const host = hostname();
+		ctx.ui.setStatus("hostname", ctx.ui.theme.fg("accent", `🖥️ ${host}`));
+	});
+}