算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
demo-setup【设计与创意】Set up demo environments for Pi extensions to record videos or screenshots for the Pi package browser. Use when preparing a demo, recording a video, or creating preview assets for an extension or theme.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Set up self-contained demo directories for Pi extensions. The demo directory contains everything needed to showcase an extension: a prompt that runs through the features, fixture files, and pi configuration.
The Pi website has a package browser at buildwithpi.ai/packages. Packages can display preview media.
{
"pi": {
"extensions": ["./index.ts"],
"video": "https://example.com/demo.mp4",
"image": "https://example.com/preview.png"
}
}
Both video and image are optional. Video takes precedence when present.
aspect-ratio: 16/9 CSS)contain on black background.mp4 for video, .png/.jpg/.jpeg/.webp/.gif for imageThemes show better as images (screenshots of dark and light variants side by side). A single 16:9 image with both variants is ideal.
<demo-dir>/
├── .pi/
│ ├── settings.json # Registers the extension as a local path
│ ├── prompts/
│ │ └── demo.md # The /demo prompt
│ └── extensions/
│ └── <name>.json # Extension config overrides (if needed)
├── AGENTS.md # Agent instructions (if needed)
└── <fixture files> # Supporting files the demo needs
Check package.json in the target directory for a pi key with extensions, themes, or skills. Read the README and source to understand what the extension provides: tools, commands, hooks, providers, themes.
demo_dir=$(mktemp -d)
mkdir -p "$demo_dir/.pi/prompts"
Create .pi/settings.json pointing to the extension's absolute path:
{
"packages": [
"/absolute/path/to/extension"
],
"defaultThinkingLevel": "off"
}
Use defaultThinkingLevel: "off" to keep responses fast and visible during demos.
Create .pi/prompts/demo.md. Structure it as numbered steps, one feature per step. Each step should produce visible output.
---
description: Showcase the <extension-name> extension
---
Demo the <extension-name> extension. Do each step one at a time.
## 1. <Feature Name>
<What to do and what it demonstrates.>
## 2. <Next Feature>
...
Create any files the demo needs to function. Examples by extension type:
Hook-based extensions (e.g., guardrails):
.env with fake secrets (to trigger env file protection).env.example (to show allowed patterns).pi/extensions/<name>.json with feature toggles enabledTool-based extensions (e.g., processes, linkup):
AGENTS.md instructing the agent to use the extension's toolsProvider extensions (e.g., synthetic):
/model, send message, /quotas)Theme packages:
When the agent needs specific behavior during the demo (e.g., always use background processes, never run servers in foreground), add an AGENTS.md.
Trigger each hook by running commands that match hook patterns. Include both blocked and allowed cases.
Call each tool with representative inputs. Show the tool's output rendering.
Run each command (e.g., /extension:command) to show the interactive UI.
/model <provider>/theme <name>After creating the demo directory, print the path and instructions:
Demo ready at: <path>
cd <path>
pi
Then type /demo to start.