Skip to content

Instantly share code, notes, and snippets.

@badlogic
badlogic / template-accelerator.ts
Created March 2, 2026 20:49
pi template accelerator extension - auto-fill prompt template args from conversation context
/**
* Template Accelerator - use conversation context to auto-fill prompt template args.
*
* Type `$$ /template` (no args) and the extension will:
* 1. Read the template file
* 2. Ask the current LLM to extract arguments from conversation context
* 3. Put the filled `/template "arg1" "arg2" ...` into the editor for review
*
* Press Enter to execute, or edit first.
*
@badlogic
badlogic / diff.ts
Last active January 23, 2026 23:34
pi extension: /diff command to show git changes and open in VS Code diff view
/**
* Diff Extension
*
* /diff command shows modified/deleted/new files from git status and opens
* the selected file in VS Code's diff view.
*/
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { DynamicBorder } from "@mariozechner/pi-coding-agent";
import { Container, Key, matchesKey, type SelectItem, SelectList, Text } from "@mariozechner/pi-tui";
@badlogic
badlogic / review-extension-v3.ts
Created January 16, 2026 14:02
Pi extension: /review - branch from root with UI side effects documented
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
/**
* /review command - Create a review branch from root, return with summary
*
* Usage:
* /review - Start review branch from root (null parent)
* /end-review - Return to origin with auto-summary
* /end-review <text> - Return with custom summary text
*
@badlogic
badlogic / review-extension-v2.ts
Created January 16, 2026 13:56
Pi extension: /review command - branch from root (parentId: null), work, return with summary
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
/**
* /review command - Create a review branch from root, return with summary
*
* Usage:
* /review - Start review branch from root (null parent)
* /end-review - Return to origin with auto-summary
* /end-review <text> - Return with custom summary text
*
@badlogic
badlogic / review-extension.ts
Created January 16, 2026 13:53
Pi extension: /review command - branch from root, work, return with summary (in-session branching)
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
/**
* /review command - Create a review branch from root, return with summary
*
* Usage:
* /review - Start review branch from root
* /end-review - Return to origin with auto-summary
* /end-review <text> - Return with custom summary text
*
@badlogic
badlogic / review-extension-corrected.ts
Last active January 16, 2026 13:51
Pi extension: /review command for branching and returning with summary
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
export default function (pi: ExtensionAPI) {
// Store review state
let reviewState: {
originalSessionFile: string;
reviewSessionFile: string;
branchFromId: string;
} | undefined;
@badlogic
badlogic / session.html
Created January 13, 2026 13:50
Token Clicker - We don't need your bank account, we need tokens
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Token Clicker - We don't need your bank account</title>
<style>
* {
margin: 0;
padding: 0;
@badlogic
badlogic / token-clicker.html
Last active January 13, 2026 13:49
Token Clicker - We don't need your bank account, we need tokens
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Token Clicker - We don't need your bank account</title>
<style>
* {
margin: 0;
padding: 0;
@badlogic
badlogic / session.html
Created January 1, 2026 11:28
pi session export - export-html rewrite conversation
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Session 7609c215-fea3-4e26-af1e-44a78b432602 - pi</title>
<style>
:root {
--accent: #8abeb7;
--border: #5f87ff;
@badlogic
badlogic / this-session.html
Created January 1, 2026 11:26
pi session export - export-html rewrite conversation
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Session 7609c215-fea3-4e26-af1e-44a78b432602 - pi</title>
<style>
:root {
--accent: #8abeb7;
--border: #5f87ff;