Skip to content

Instantly share code, notes, and snippets.

View pi0neerpat's full-sized avatar
🤠

Patrick Gallagher pi0neerpat

🤠
View GitHub Profile
@pi0neerpat
pi0neerpat / pi_tutorial.md
Created February 21, 2026 17:11 — forked from dabit3/pi_tutorial.md
How to Build a Custom Agent Framework with PI: The Agent Stack Powering OpenClaw

PI is a TypeScript toolkit for building AI agents. It's a monorepo of packages that layer on top of each other: pi-ai handles LLM communication across providers, pi-agent-core adds the agent loop with tool calling, pi-coding-agent gives you a full coding agent with built-in tools, session persistence, and extensibility, and pi-tui provides a terminal UI for building CLI interfaces.

These are the same packages that power OpenClaw. This guide walks through each layer, progressively building up to a fully featured coding assistant with a terminal UI, session persistence, and custom tools.

By understanding how to compose these layers, you can build production-grade agentic software on your own terms, without being locked into a specific abstraction.

Pi was created by @badlogicgames. This is a great writeup from him that explains some of the design decisions made when creating it.

The stack

STEP 1. REFRAME HOW YOU CODE

Congratulations, you’ve just been promoted! You are now a Project Manager, and have been assigned your first Junior Developer- Claude AI. Actually, wait… you still have to do your Senior Developer job. You are BOTH a Senior Dev AND Project Manager, ANDDD you need to manage Claude AI’s work

This is the mindset you should adopt. So let that sink in for a minute…

  1. Senior Dev (YOU)
  2. Project Manager (YOU)
  3. Junior Dev #1 (AI)
@pi0neerpat
pi0neerpat / privacy-pools-ceremony_attestation.log
Created February 25, 2025 22:03
Attestation for Privacy Pools Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm pi0neerpat-35622595 and I have contributed to the Privacy Pools Ceremony.
The following are my contribution signatures:
Circuit # 1 (withdraw)
Contributor # 355
Contribution Hash: 08c0bb41 208855ab 5258aff1 7198a0e5
7b2a8c8d 8b74e378 b49ca7ed 3bcc5bea
2366b3da 5bf032dc f2a1b647 f515b86f
4735878d 84ed4743 11a11f65 edf62879
@pi0neerpat
pi0neerpat / Chicken.sol
Created March 12, 2024 01:02
Chicken wars
// SPDX-License-Identifier: UNLICENSED
//
// //
// ww_ ___.///
// o__ `._.-''''' //
// |/ \ , / //
// \ ``,,,' _//
// `-. \--' .'`.
// \_/_/ `.,'
@pi0neerpat
pi0neerpat / docker-publish.yml
Created January 4, 2024 01:49
Example docker github action
# Adapted from https://github.com/users/jeliasson/packages/container/package/redwoodjs-app-api-main
name: 'Github Publish Docker'
on:
workflow_dispatch:
inputs:
image_tag_prefix:
description: 'Image Tag Prefix (dev or sandbox)'
required: true
default: 'dev'
env:
@pi0neerpat
pi0neerpat / redwood-getting-started page raw HTML
Created December 12, 2022 23:05
redwood-getting-started.html
<html lang="en"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="/favicon.png">
<script defer="" src="/static/js/runtime-app.bundle.js"></script><script defer="" src="/static/js/app.bundle.js"></script><style>
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZVJvb3QiOiIifQ== */</style><title>Redwood App | Redwood App</title></head>
<body>
<div id="redwood-app"><main><section><style>
:root {
@pi0neerpat
pi0neerpat / test-jwks.json
Last active September 27, 2022 21:37
feather-demo-jwks
{
"keys": [
{
"kty": "RSA",
"n": "_RjTfVf6CLxbEmPcNvCe1q1npk7iQHAlqvDAreq7I-Wg8ITXOi_ij_dN-eKeJMQaLJ_E5UW8Dr6AEdG2VmjcmQ",
"e": "AQAB",
"alg": "RS256",
"kid": "75d809beae4c8e9212a83874b",
"use": "sig"
}
@pi0neerpat
pi0neerpat / ChiliFarm.sol
Created July 26, 2021 21:14
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.5+commit.47a71e8f.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
@pi0neerpat
pi0neerpat / ChiliFarm.sol
Created July 26, 2021 21:14
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.5+commit.47a71e8f.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
@pi0neerpat
pi0neerpat / ERC20.abi
Last active July 26, 2021 21:08
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.6+commit.b259423e.js&optimize=false&runs=200&gist=
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},