pi-minimal 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pi_minimal-0.1.0/.gitignore +67 -0
- pi_minimal-0.1.0/LICENSE +21 -0
- pi_minimal-0.1.0/PKG-INFO +96 -0
- pi_minimal-0.1.0/README.md +78 -0
- pi_minimal-0.1.0/assets/build.py +122 -0
- pi_minimal-0.1.0/assets/demo/demo.tape +58 -0
- pi_minimal-0.1.0/assets/demo/setup.sh +32 -0
- pi_minimal-0.1.0/assets/demo.gif +0 -0
- pi_minimal-0.1.0/assets/hero.svg +1 -0
- pi_minimal-0.1.0/assets/screen.svg +1 -0
- pi_minimal-0.1.0/docs/discovery.md +47 -0
- pi_minimal-0.1.0/pi_minimal.py +761 -0
- pi_minimal-0.1.0/pyproject.toml +35 -0
- pi_minimal-0.1.0/tests/pi_resolve.mjs +36 -0
- pi_minimal-0.1.0/tests/test_pi_parity.py +182 -0
- pi_minimal-0.1.0/tests/test_project_skills.py +553 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
MANIFEST
|
|
27
|
+
|
|
28
|
+
# Virtual environments
|
|
29
|
+
.venv/
|
|
30
|
+
venv/
|
|
31
|
+
ENV/
|
|
32
|
+
env/
|
|
33
|
+
|
|
34
|
+
# Unit test / coverage reports
|
|
35
|
+
htmlcov/
|
|
36
|
+
.tox/
|
|
37
|
+
.nox/
|
|
38
|
+
.coverage
|
|
39
|
+
.coverage.*
|
|
40
|
+
.coverage.*.json
|
|
41
|
+
.pytest_cache/
|
|
42
|
+
coverage.py
|
|
43
|
+
coverage.xml
|
|
44
|
+
*.cover
|
|
45
|
+
.hypothesis/
|
|
46
|
+
|
|
47
|
+
# Jupyter
|
|
48
|
+
.ipynb_checkpoints/
|
|
49
|
+
*.ipynb_checkpoints
|
|
50
|
+
|
|
51
|
+
# mypy / type checkers
|
|
52
|
+
.mypy_cache/
|
|
53
|
+
.dmypy.json
|
|
54
|
+
dmypy.json
|
|
55
|
+
.pyre/
|
|
56
|
+
.ruff_cache/
|
|
57
|
+
|
|
58
|
+
# Formatters
|
|
59
|
+
.black
|
|
60
|
+
|
|
61
|
+
# Environments
|
|
62
|
+
.env
|
|
63
|
+
.env.*
|
|
64
|
+
!.env.example
|
|
65
|
+
|
|
66
|
+
# macOS
|
|
67
|
+
.DS_Store
|
pi_minimal-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 John McCambridge
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: pi-minimal
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Start pi with only the extensions and skills you pick
|
|
5
|
+
Project-URL: Homepage, https://github.com/nol166/pi-minimal
|
|
6
|
+
Project-URL: Issues, https://github.com/nol166/pi-minimal/issues
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: cli,coding-agent,extensions,llm,pi,skills,tui
|
|
10
|
+
Classifier: Environment :: Console :: Curses
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="https://raw.githubusercontent.com/nol166/pi-minimal/main/assets/hero.svg" alt="pi-minimal" width="640">
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
Start <a href="https://github.com/earendil-works/pi">pi</a> with only the extensions and skills you pick.
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="#install">Install</a> ·
|
|
29
|
+
<a href="#usage">Usage</a> ·
|
|
30
|
+
<a href="docs/discovery.md">How it works</a>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<br>
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img src="https://raw.githubusercontent.com/nol166/pi-minimal/main/assets/demo.gif" alt="Running pi-minimal: ticking an extension, a skill and a project skill, then pressing Enter, and pi starting with only those loaded" width="760">
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<br>
|
|
40
|
+
|
|
41
|
+
pi loads everything it can find: every extension, every skill, every package's resources, your context files. Each one costs context, and most sessions need only a few.
|
|
42
|
+
|
|
43
|
+
pi-minimal lists all of it on one screen. Tick what this session needs and press Enter: pi starts with exactly that, and nothing else.
|
|
44
|
+
|
|
45
|
+
- **Nothing is changed.** Your pi settings are never written. A plain `pi` afterwards behaves exactly as before.
|
|
46
|
+
- **What you see is what runs.** The bottom line is the exact `pi` command, updated as you toggle.
|
|
47
|
+
- **It matches pi.** Discovery follows pi's own rules (packages, settings filters, project resources), and CI checks it against pi's resolver.
|
|
48
|
+
- **Your picks are remembered.** The next launch starts from your last selection.
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
Needs [pi](https://github.com/earendil-works/pi), Python 3.10+ and [uv](https://docs.astral.sh/uv/). macOS and Linux.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
uv tool install git+https://github.com/nol166/pi-minimal
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Or try it without installing: `uvx --from git+https://github.com/nol166/pi-minimal pi-minimal`
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
pi-minimal # pick, then launch pi
|
|
64
|
+
pi-minimal --list # print every item and the command that would run
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
| Key | Action |
|
|
68
|
+
| --- | --- |
|
|
69
|
+
| `j` `k` / `↑` `↓` | move |
|
|
70
|
+
| `space` | toggle |
|
|
71
|
+
| `enter` | save and launch pi |
|
|
72
|
+
| `q` | save and quit |
|
|
73
|
+
|
|
74
|
+
Run it from a project directory to see that project's skills, extensions and settings too.
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
| File or variable | What it is |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `~/.config/pi-minimal/selections.json` | your saved picks ([format](docs/discovery.md#selections-file)) |
|
|
81
|
+
| `~/.config/pi-minimal/config.json` | `{"default_checked": [...]}`: items ticked before your first launch |
|
|
82
|
+
| `PI_CODING_AGENT_DIR` | pi's agent directory (default `~/.pi/agent`), passed on to pi |
|
|
83
|
+
| `PI_MINIMAL_STATE` | a different selections file |
|
|
84
|
+
|
|
85
|
+
Running pi inside herdr? Put `herdr-agent-state` in `default_checked`, or herdr can't see when pi is working.
|
|
86
|
+
|
|
87
|
+
## Development
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
git clone https://github.com/nol166/pi-minimal && cd pi-minimal
|
|
91
|
+
uv run pi_minimal.py # run from source
|
|
92
|
+
python3 tests/test_project_skills.py
|
|
93
|
+
python3 tests/test_pi_parity.py # diff against the installed pi's resolver (needs node)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
No dependencies beyond the standard library. `python3 assets/build.py` redraws the README graphics, and `vhs assets/demo/demo.tape` re-records the demo in a throwaway home.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/nol166/pi-minimal/main/assets/hero.svg" alt="pi-minimal" width="640">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
Start <a href="https://github.com/earendil-works/pi">pi</a> with only the extensions and skills you pick.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="#install">Install</a> ·
|
|
11
|
+
<a href="#usage">Usage</a> ·
|
|
12
|
+
<a href="docs/discovery.md">How it works</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<br>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<img src="https://raw.githubusercontent.com/nol166/pi-minimal/main/assets/demo.gif" alt="Running pi-minimal: ticking an extension, a skill and a project skill, then pressing Enter, and pi starting with only those loaded" width="760">
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<br>
|
|
22
|
+
|
|
23
|
+
pi loads everything it can find: every extension, every skill, every package's resources, your context files. Each one costs context, and most sessions need only a few.
|
|
24
|
+
|
|
25
|
+
pi-minimal lists all of it on one screen. Tick what this session needs and press Enter: pi starts with exactly that, and nothing else.
|
|
26
|
+
|
|
27
|
+
- **Nothing is changed.** Your pi settings are never written. A plain `pi` afterwards behaves exactly as before.
|
|
28
|
+
- **What you see is what runs.** The bottom line is the exact `pi` command, updated as you toggle.
|
|
29
|
+
- **It matches pi.** Discovery follows pi's own rules (packages, settings filters, project resources), and CI checks it against pi's resolver.
|
|
30
|
+
- **Your picks are remembered.** The next launch starts from your last selection.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
Needs [pi](https://github.com/earendil-works/pi), Python 3.10+ and [uv](https://docs.astral.sh/uv/). macOS and Linux.
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
uv tool install git+https://github.com/nol166/pi-minimal
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or try it without installing: `uvx --from git+https://github.com/nol166/pi-minimal pi-minimal`
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
pi-minimal # pick, then launch pi
|
|
46
|
+
pi-minimal --list # print every item and the command that would run
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
| Key | Action |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `j` `k` / `↑` `↓` | move |
|
|
52
|
+
| `space` | toggle |
|
|
53
|
+
| `enter` | save and launch pi |
|
|
54
|
+
| `q` | save and quit |
|
|
55
|
+
|
|
56
|
+
Run it from a project directory to see that project's skills, extensions and settings too.
|
|
57
|
+
|
|
58
|
+
## Configuration
|
|
59
|
+
|
|
60
|
+
| File or variable | What it is |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| `~/.config/pi-minimal/selections.json` | your saved picks ([format](docs/discovery.md#selections-file)) |
|
|
63
|
+
| `~/.config/pi-minimal/config.json` | `{"default_checked": [...]}`: items ticked before your first launch |
|
|
64
|
+
| `PI_CODING_AGENT_DIR` | pi's agent directory (default `~/.pi/agent`), passed on to pi |
|
|
65
|
+
| `PI_MINIMAL_STATE` | a different selections file |
|
|
66
|
+
|
|
67
|
+
Running pi inside herdr? Put `herdr-agent-state` in `default_checked`, or herdr can't see when pi is working.
|
|
68
|
+
|
|
69
|
+
## Development
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
git clone https://github.com/nol166/pi-minimal && cd pi-minimal
|
|
73
|
+
uv run pi_minimal.py # run from source
|
|
74
|
+
python3 tests/test_project_skills.py
|
|
75
|
+
python3 tests/test_pi_parity.py # diff against the installed pi's resolver (needs node)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
No dependencies beyond the standard library. `python3 assets/build.py` redraws the README graphics, and `vhs assets/demo/demo.tape` re-records the demo in a throwaway home.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Regenerate the README graphics: python3 assets/build.py
|
|
3
|
+
|
|
4
|
+
Writes hero.svg and screen.svg next to this file. Both are dark cards with their own
|
|
5
|
+
background, so they read the same on a light or dark page, on GitHub (whose theme the
|
|
6
|
+
README can't detect: prefers-color-scheme follows the OS) and on PyPI. The screen is a
|
|
7
|
+
drawing of the TUI with made-up item names, laid out exactly as pi_minimal._draw does.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from xml.sax.saxutils import escape
|
|
12
|
+
|
|
13
|
+
HERE = Path(__file__).resolve().parent
|
|
14
|
+
MONO = "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace"
|
|
15
|
+
|
|
16
|
+
PALETTES = {
|
|
17
|
+
"light": dict(ink="#171717", mute="#a3a3a3", line="#e5e5e5", faint="#ededed",
|
|
18
|
+
window="#ffffff", bar="#fafafa", inv="#ffffff"),
|
|
19
|
+
"dark": dict(ink="#ededed", mute="#737373", line="#262626", faint="#1f1f1f",
|
|
20
|
+
window="#0a0a0a", bar="#111111", inv="#0a0a0a"),
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def hero(c: dict) -> str:
|
|
25
|
+
"""Many rows, a few ticked, and the ticked ones join into one `pi` launch."""
|
|
26
|
+
rows = [(118, True), (82, False), (146, False), (96, True), (130, True), (70, False)]
|
|
27
|
+
x0, y0, step, box = 302, 44, 26, 14
|
|
28
|
+
join_x, cy = x0 + 242, y0 + box / 2 + step * (len(rows) - 1) / 2
|
|
29
|
+
out = [f'<rect x=".5" y=".5" width="959" height="299" rx="16" fill="{c["window"]}" stroke="{c["line"]}"/>']
|
|
30
|
+
for i, (w, on) in enumerate(rows):
|
|
31
|
+
y = y0 + i * step
|
|
32
|
+
if on:
|
|
33
|
+
out.append(f'<rect x="{x0}" y="{y}" width="{box}" height="{box}" rx="3" fill="{c["ink"]}"/>')
|
|
34
|
+
out.append(f'<path d="M{x0 + 3.5} {y + 7.2}l2.6 2.6 4.6-5.2" fill="none" '
|
|
35
|
+
f'stroke="{c["inv"]}" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>')
|
|
36
|
+
out.append(f'<rect x="{x0 + 26}" y="{y + 4}" width="{w}" height="6" rx="3" fill="{c["ink"]}"/>')
|
|
37
|
+
sx, sy = x0 + 26 + w + 10, y + box / 2
|
|
38
|
+
mx = (sx + join_x) / 2
|
|
39
|
+
out.append(f'<path d="M{sx} {sy}C{mx} {sy} {mx} {cy} {join_x} {cy}" fill="none" '
|
|
40
|
+
f'stroke="{c["ink"]}" stroke-width="1.25"/>')
|
|
41
|
+
else:
|
|
42
|
+
out.append(f'<rect x="{x0 + .75}" y="{y + .75}" width="{box - 1.5}" height="{box - 1.5}" rx="2.5" '
|
|
43
|
+
f'fill="none" stroke="{c["mute"]}" stroke-opacity=".55" stroke-width="1.5"/>')
|
|
44
|
+
out.append(f'<rect x="{x0 + 26}" y="{y + 4}" width="{w}" height="6" rx="3" fill="{c["line"]}"/>')
|
|
45
|
+
out.append(f'<circle cx="{join_x}" cy="{cy}" r="2.5" fill="{c["ink"]}"/>')
|
|
46
|
+
out.append(f'<path d="M{join_x} {cy}H{join_x + 26}" stroke="{c["ink"]}" stroke-width="1.25"/>')
|
|
47
|
+
px, pw, ph = join_x + 26, 88, 40
|
|
48
|
+
out.append(f'<rect x="{px + .5}" y="{cy - ph / 2 + .5}" width="{pw}" height="{ph}" rx="8" '
|
|
49
|
+
f'fill="{c["window"]}" stroke="{c["ink"]}" stroke-width="1.25"/>')
|
|
50
|
+
out.append(f'<text x="{px + 18}" y="{cy + 5.5}" font-family="{MONO}" font-size="16" fill="{c["mute"]}">$</text>')
|
|
51
|
+
out.append(f'<text x="{px + 36}" y="{cy + 5.5}" font-family="{MONO}" font-size="16" '
|
|
52
|
+
f'font-weight="600" fill="{c["ink"]}">pi</text>')
|
|
53
|
+
out.append(f'<rect x="{px + 62}" y="{cy - 9}" width="9" height="18" rx="1" fill="{c["ink"]}"/>')
|
|
54
|
+
out.append(f'<text x="480" y="262" text-anchor="middle" font-family="{MONO}" font-size="30" '
|
|
55
|
+
f'font-weight="600" letter-spacing="-0.5" fill="{c["ink"]}">pi-minimal</text>')
|
|
56
|
+
return ('<svg xmlns="http://www.w3.org/2000/svg" width="960" height="300" viewBox="0 0 960 300" '
|
|
57
|
+
'role="img" aria-label="pi-minimal">' + "".join(out) + "</svg>\n")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# (text, style): style is "" plain, "b" bold, "cur" the cursor row, "dim" the command line
|
|
61
|
+
SCREEN = [
|
|
62
|
+
("pi-minimal — check what to load, Enter launches", ""),
|
|
63
|
+
("", ""),
|
|
64
|
+
("BUILT-IN", "b"),
|
|
65
|
+
(" [x] builtin:mcp", ""),
|
|
66
|
+
(" [ ] builtin:llama.cpp", ""),
|
|
67
|
+
(" [x] builtin:codemode", ""),
|
|
68
|
+
(" [x] builtin:tool-search", ""),
|
|
69
|
+
("", ""),
|
|
70
|
+
("EXTENSIONS", "b"),
|
|
71
|
+
(" [x] pi-web-access", ""),
|
|
72
|
+
(" [ ] git-guard", "cur"),
|
|
73
|
+
(" [ ] token-meter", ""),
|
|
74
|
+
("", ""),
|
|
75
|
+
("SKILLS", "b"),
|
|
76
|
+
(" [x] release-notes", ""),
|
|
77
|
+
(" [ ] code-review", ""),
|
|
78
|
+
("", ""),
|
|
79
|
+
("PROJECT SKILLS", "b"),
|
|
80
|
+
(" [x] db-migrations", ""),
|
|
81
|
+
("", ""),
|
|
82
|
+
("OPTIONS", "b"),
|
|
83
|
+
(" [x] AGENTS.md / CLAUDE.md context files", ""),
|
|
84
|
+
("", ""),
|
|
85
|
+
("pi --no-extensions --no-skills --no-prompt-templates --no-themes -e builtin:mcp -e builtin:", "dim"),
|
|
86
|
+
("j/↓ down k/↑ up space toggle enter launch q quit", ""),
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def screen(c: dict) -> str:
|
|
91
|
+
W, pad, top, lh, fs, cw = 880, 28, 44, 22, 14, 8.43
|
|
92
|
+
H = top + 22 + lh * len(SCREEN) + 18
|
|
93
|
+
out = [
|
|
94
|
+
f'<rect x=".5" y=".5" width="{W - 1}" height="{H - 1}" rx="12" fill="{c["window"]}" stroke="{c["line"]}"/>',
|
|
95
|
+
f'<path d="M1 {top}V13a12 12 0 0 1 12-12h{W - 26}a12 12 0 0 1 12 12V{top}z" fill="{c["bar"]}"/>',
|
|
96
|
+
f'<path d="M1 {top}H{W - 1}" stroke="{c["line"]}"/>',
|
|
97
|
+
]
|
|
98
|
+
for i in range(3):
|
|
99
|
+
out.append(f'<circle cx="{22 + i * 18}" cy="{top / 2}" r="5.5" fill="{c["line"]}"/>')
|
|
100
|
+
out.append(f'<text x="{W / 2}" y="{top / 2 + 4.5}" text-anchor="middle" font-family="{MONO}" '
|
|
101
|
+
f'font-size="12.5" fill="{c["mute"]}">pi-minimal</text>')
|
|
102
|
+
y = top + 22
|
|
103
|
+
for text, style in SCREEN:
|
|
104
|
+
base = y + fs - 3
|
|
105
|
+
if style == "cur":
|
|
106
|
+
out.append(f'<rect x="{pad - 2}" y="{y - 3}" width="{len(text) * cw + 4}" height="{lh - 2}" '
|
|
107
|
+
f'rx="2" fill="{c["ink"]}"/>')
|
|
108
|
+
fill = {"cur": c["inv"], "dim": c["mute"]}.get(style, c["ink"])
|
|
109
|
+
weight = ' font-weight="700"' if style == "b" else ""
|
|
110
|
+
if text:
|
|
111
|
+
out.append(f'<text x="{pad}" y="{base}" xml:space="preserve" font-family="{MONO}" '
|
|
112
|
+
f'font-size="{fs}" fill="{fill}"{weight}>{escape(text)}</text>')
|
|
113
|
+
y += lh
|
|
114
|
+
return (f'<svg xmlns="http://www.w3.org/2000/svg" width="{W}" height="{H}" viewBox="0 0 {W} {H}" '
|
|
115
|
+
f'role="img" aria-label="The pi-minimal picker">' + "".join(out) + "</svg>\n")
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
if __name__ == "__main__":
|
|
119
|
+
c = PALETTES["dark"]
|
|
120
|
+
(HERE / "hero.svg").write_text(hero(c))
|
|
121
|
+
(HERE / "screen.svg").write_text(screen(c))
|
|
122
|
+
print("wrote", ", ".join(sorted(p.name for p in HERE.glob("*.svg"))))
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Records assets/demo.gif. Run from the repo root: vhs assets/demo/demo.tape
|
|
2
|
+
# setup.sh makes a throwaway home with made-up items; the real pi starts at the end.
|
|
3
|
+
|
|
4
|
+
Output assets/demo.gif
|
|
5
|
+
|
|
6
|
+
Set Shell bash
|
|
7
|
+
Set FontFamily "Menlo"
|
|
8
|
+
Set FontSize 16
|
|
9
|
+
Set LineHeight 1.25
|
|
10
|
+
Set Width 1000
|
|
11
|
+
Set Height 700
|
|
12
|
+
Set Padding 28
|
|
13
|
+
Set WindowBar Rings
|
|
14
|
+
Set WindowBarSize 40
|
|
15
|
+
Set BorderRadius 12
|
|
16
|
+
Set TypingSpeed 70ms
|
|
17
|
+
Set Framerate 30
|
|
18
|
+
Set Theme { "name": "pi-minimal", "background": "#0a0a0a", "foreground": "#ededed", "cursor": "#ededed", "selection": "#262626", "black": "#0a0a0a", "red": "#ededed", "green": "#ededed", "yellow": "#ededed", "blue": "#ededed", "magenta": "#ededed", "cyan": "#ededed", "white": "#ededed", "brightBlack": "#737373", "brightRed": "#ededed", "brightGreen": "#ededed", "brightYellow": "#ededed", "brightBlue": "#ededed", "brightMagenta": "#ededed", "brightCyan": "#ededed", "brightWhite": "#ffffff" }
|
|
19
|
+
|
|
20
|
+
Hide
|
|
21
|
+
Type "source assets/demo/setup.sh && clear"
|
|
22
|
+
Enter
|
|
23
|
+
Sleep 500ms
|
|
24
|
+
Show
|
|
25
|
+
|
|
26
|
+
Sleep 700ms
|
|
27
|
+
Type "pi-minimal"
|
|
28
|
+
Sleep 400ms
|
|
29
|
+
Enter
|
|
30
|
+
Sleep 1.6s
|
|
31
|
+
|
|
32
|
+
# llama.cpp off
|
|
33
|
+
Down
|
|
34
|
+
Sleep 350ms
|
|
35
|
+
Space
|
|
36
|
+
Sleep 700ms
|
|
37
|
+
|
|
38
|
+
# pi-web-access on
|
|
39
|
+
Down 4
|
|
40
|
+
Sleep 350ms
|
|
41
|
+
Space
|
|
42
|
+
Sleep 700ms
|
|
43
|
+
|
|
44
|
+
# release-notes on
|
|
45
|
+
Down 3
|
|
46
|
+
Sleep 350ms
|
|
47
|
+
Space
|
|
48
|
+
Sleep 600ms
|
|
49
|
+
|
|
50
|
+
# this project's db-migrations skill on
|
|
51
|
+
Down
|
|
52
|
+
Sleep 350ms
|
|
53
|
+
Space
|
|
54
|
+
Sleep 1.4s
|
|
55
|
+
|
|
56
|
+
# launch: pi starts with only what was ticked
|
|
57
|
+
Enter
|
|
58
|
+
Sleep 5s
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Sourced by demo.tape (hidden): a throwaway home with made-up extensions and skills,
|
|
2
|
+
# so the recording shows none of your own. The real pi is launched; its placeholder
|
|
3
|
+
# model is never called, because the demo types no prompt.
|
|
4
|
+
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
5
|
+
REAL_AGENT="${PI_CODING_AGENT_DIR:-$HOME/.pi/agent}"
|
|
6
|
+
DEMO="$(cd "$(mktemp -d)" && pwd -P)"
|
|
7
|
+
export HOME="$DEMO/home" PI_CODING_AGENT_DIR="$DEMO/home/.pi/agent" PI_MINIMAL_STATE="$DEMO/state.json"
|
|
8
|
+
A="$PI_CODING_AGENT_DIR"
|
|
9
|
+
mkdir -p "$A/extensions/pi-web-access" "$A/bin" "$HOME/code/api/.git"
|
|
10
|
+
for ext in pi-web-access/index git-guard token-meter; do
|
|
11
|
+
echo 'export default function () {}' > "$A/extensions/$ext.ts"
|
|
12
|
+
done
|
|
13
|
+
skill() { mkdir -p "$1"; printf -- '---\ndescription: demo\n---\n' > "$1/SKILL.md"; }
|
|
14
|
+
skill "$A/skills/release-notes"
|
|
15
|
+
skill "$A/skills/code-review"
|
|
16
|
+
skill "$HOME/code/api/.pi/skills/db-migrations"
|
|
17
|
+
# no trust prompt for the demo project, and a model so pi starts without a warning
|
|
18
|
+
cat > "$A/settings.json" <<'JSON'
|
|
19
|
+
{"defaultProjectTrust": "always", "defaultProvider": "local", "defaultModel": "qwen-3.8-flash-next"}
|
|
20
|
+
JSON
|
|
21
|
+
cat > "$A/models.json" <<'JSON'
|
|
22
|
+
{"providers": {"local": {"baseUrl": "http://127.0.0.1:11434/v1", "api": "openai-completions",
|
|
23
|
+
"apiKey": "demo", "models": [{"id": "qwen-3.8-flash-next", "name": "Qwen3.8 Flash Next",
|
|
24
|
+
"contextWindow": 131072, "maxTokens": 8192}]}}}
|
|
25
|
+
JSON
|
|
26
|
+
# reuse pi's fd and rg rather than letting it download them into the throwaway home
|
|
27
|
+
for tool in fd rg; do
|
|
28
|
+
[ -e "$REAL_AGENT/bin/$tool" ] && ln -s "$REAL_AGENT/bin/$tool" "$A/bin/$tool"
|
|
29
|
+
done
|
|
30
|
+
pi-minimal() { python3 "$REPO/pi_minimal.py" "$@"; }
|
|
31
|
+
cd "$HOME/code/api"
|
|
32
|
+
export PS1='\[\033[2m\]~/code/api\[\033[0m\] $ '
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="300" viewBox="0 0 960 300" role="img" aria-label="pi-minimal"><rect x=".5" y=".5" width="959" height="299" rx="16" fill="#0a0a0a" stroke="#262626"/><rect x="302" y="44" width="14" height="14" rx="3" fill="#ededed"/><path d="M305.5 51.2l2.6 2.6 4.6-5.2" fill="none" stroke="#0a0a0a" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><rect x="328" y="48" width="118" height="6" rx="3" fill="#ededed"/><path d="M456 51.0C500.0 51.0 500.0 116.0 544 116.0" fill="none" stroke="#ededed" stroke-width="1.25"/><rect x="302.75" y="70.75" width="12.5" height="12.5" rx="2.5" fill="none" stroke="#737373" stroke-opacity=".55" stroke-width="1.5"/><rect x="328" y="74" width="82" height="6" rx="3" fill="#262626"/><rect x="302.75" y="96.75" width="12.5" height="12.5" rx="2.5" fill="none" stroke="#737373" stroke-opacity=".55" stroke-width="1.5"/><rect x="328" y="100" width="146" height="6" rx="3" fill="#262626"/><rect x="302" y="122" width="14" height="14" rx="3" fill="#ededed"/><path d="M305.5 129.2l2.6 2.6 4.6-5.2" fill="none" stroke="#0a0a0a" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><rect x="328" y="126" width="96" height="6" rx="3" fill="#ededed"/><path d="M434 129.0C489.0 129.0 489.0 116.0 544 116.0" fill="none" stroke="#ededed" stroke-width="1.25"/><rect x="302" y="148" width="14" height="14" rx="3" fill="#ededed"/><path d="M305.5 155.2l2.6 2.6 4.6-5.2" fill="none" stroke="#0a0a0a" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><rect x="328" y="152" width="130" height="6" rx="3" fill="#ededed"/><path d="M468 155.0C506.0 155.0 506.0 116.0 544 116.0" fill="none" stroke="#ededed" stroke-width="1.25"/><rect x="302.75" y="174.75" width="12.5" height="12.5" rx="2.5" fill="none" stroke="#737373" stroke-opacity=".55" stroke-width="1.5"/><rect x="328" y="178" width="70" height="6" rx="3" fill="#262626"/><circle cx="544" cy="116.0" r="2.5" fill="#ededed"/><path d="M544 116.0H570" stroke="#ededed" stroke-width="1.25"/><rect x="570.5" y="96.5" width="88" height="40" rx="8" fill="#0a0a0a" stroke="#ededed" stroke-width="1.25"/><text x="588" y="121.5" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="16" fill="#737373">$</text><text x="606" y="121.5" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="16" font-weight="600" fill="#ededed">pi</text><rect x="632" y="107.0" width="9" height="18" rx="1" fill="#ededed"/><text x="480" y="262" text-anchor="middle" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="30" font-weight="600" letter-spacing="-0.5" fill="#ededed">pi-minimal</text></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="880" height="634" viewBox="0 0 880 634" role="img" aria-label="The pi-minimal picker"><rect x=".5" y=".5" width="879" height="633" rx="12" fill="#0a0a0a" stroke="#262626"/><path d="M1 44V13a12 12 0 0 1 12-12h854a12 12 0 0 1 12 12V44z" fill="#111111"/><path d="M1 44H879" stroke="#262626"/><circle cx="22" cy="22.0" r="5.5" fill="#262626"/><circle cx="40" cy="22.0" r="5.5" fill="#262626"/><circle cx="58" cy="22.0" r="5.5" fill="#262626"/><text x="440.0" y="26.5" text-anchor="middle" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="12.5" fill="#737373">pi-minimal</text><text x="28" y="77" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed">pi-minimal — check what to load, Enter launches</text><text x="28" y="121" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed" font-weight="700">BUILT-IN</text><text x="28" y="143" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [x] builtin:mcp</text><text x="28" y="165" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [ ] builtin:llama.cpp</text><text x="28" y="187" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [x] builtin:codemode</text><text x="28" y="209" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [x] builtin:tool-search</text><text x="28" y="253" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed" font-weight="700">EXTENSIONS</text><text x="28" y="275" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [x] pi-web-access</text><rect x="26" y="283" width="122.02" height="20" rx="2" fill="#ededed"/><text x="28" y="297" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#0a0a0a"> [ ] git-guard</text><text x="28" y="319" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [ ] token-meter</text><text x="28" y="363" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed" font-weight="700">SKILLS</text><text x="28" y="385" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [x] release-notes</text><text x="28" y="407" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [ ] code-review</text><text x="28" y="451" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed" font-weight="700">PROJECT SKILLS</text><text x="28" y="473" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [x] db-migrations</text><text x="28" y="517" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed" font-weight="700">OPTIONS</text><text x="28" y="539" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed"> [x] AGENTS.md / CLAUDE.md context files</text><text x="28" y="583" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#737373">pi --no-extensions --no-skills --no-prompt-templates --no-themes -e builtin:mcp -e builtin:</text><text x="28" y="605" xml:space="preserve" font-family="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace" font-size="14" fill="#ededed">j/↓ down k/↑ up space toggle enter launch q quit</text></svg>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# How pi-minimal discovers and launches
|
|
2
|
+
|
|
3
|
+
The details behind the [README](../README.md): what goes on the command line, where items come from, and how pi's own settings filters are honoured.
|
|
4
|
+
|
|
5
|
+
## What a launch changes
|
|
6
|
+
|
|
7
|
+
By default pi discovers a lot: every extension in your agent directory, every skill, prompt templates, themes, context files, and anything shipped inside installed packages. pi-minimal launches pi with `--no-extensions --no-skills --no-prompt-templates --no-themes` so that nothing is discovered, then adds back only the items you checked: one `-e` flag per extension, one `--skill` flag per skill. Prompt templates and themes have no checkboxes: they are always off in a pi-minimal launch.
|
|
8
|
+
|
|
9
|
+
`--no-extensions` also switches off pi's built-in extensions, so they get their own section: MCP (which is how your `mcp.json` servers run), llama.cpp, codemode, and tool-search. They start checked, which is what a plain `pi` launch gives you; uncheck one to actually drop it. Switching MCP off also turns off every MCP server.
|
|
10
|
+
|
|
11
|
+
There is also a toggle for the AGENTS.md / CLAUDE.md context files. Leave it checked and pi runs normally; uncheck it and `--no-context-files` goes on the command line.
|
|
12
|
+
|
|
13
|
+
Your pi `settings.json` is never touched. The selection list is saved to `~/.config/pi-minimal/selections.json`, and a plain `pi` launch afterwards behaves exactly as before.
|
|
14
|
+
|
|
15
|
+
## Selections file
|
|
16
|
+
|
|
17
|
+
The state file is a list of names: a plain name is checked, and a name prefixed with `-` records that you switched a default-on item (a built-in extension, or the context-files option) off. So `["builtin:codemode", "ollama-lan"]` means codemode off, ollama-lan on.
|
|
18
|
+
|
|
19
|
+
Before you have launched once, only the built-in extensions (as your pi settings leave them) and the context-files option start ticked; extensions and skills start unticked, plus whatever you name in a `default_checked` list in `~/.config/pi-minimal/config.json`. If you run pi inside herdr, put `herdr-agent-state` there, or herdr cannot see whether pi is working. Once `selections.json` exists it wins, and stays in control until you delete it.
|
|
20
|
+
|
|
21
|
+
## Where it looks
|
|
22
|
+
|
|
23
|
+
Discovery follows pi 1.6.0, in pi's load order, so a name that exists twice is listed where pi would load it:
|
|
24
|
+
|
|
25
|
+
- Packages listed in `~/.pi/agent/settings.json` (`git:` and `npm:` sources). What a package ships comes from its `package.json` `pi` manifest (`extensions`, `skills`); without a manifest it is the conventional `extensions/` and `skills/` folders. A directory entry is resolved like an extension folder: the directory's own `pi` manifest, else its `index.ts`, else its `index.js`, and only when it has none of those its loose `.ts`/`.js` files plus each subfolder's own resolution. So a package declaring `"./dist"` whose `dist/` has an `index.js` lists just `dist/index.js`.
|
|
26
|
+
- Project skills: `.pi/skills/` in the current directory, and `.agents/skills/` in the current directory and each ancestor up to the repo root.
|
|
27
|
+
- `~/.pi/agent/skills/` and `~/.agents/skills/`: folders with a `SKILL.md`, searched recursively (grouping folders are fine) and through symlinks.
|
|
28
|
+
- The `skills` arrays in `~/.pi/agent/settings.json` and project `.pi/settings.json`: entries naming a skill folder, a folder of skills, or a `.md` file add those files. A relative entry resolves against that settings file's own directory - the agent directory for the user file, `<cwd>/.pi` for a project one - never against `~/.agents`.
|
|
29
|
+
- `<cwd>/.pi/extensions/` and `~/.pi/agent/extensions/`: standalone `.ts`/`.js` files, and folders that resolve to their declared `pi.extensions`, to `index.ts`/`index.js`, or to their loose files and subfolders. Project extensions are listed first, since pi loads them first. Files ending in `.disabled` are skipped.
|
|
30
|
+
- The `extensions` arrays in `~/.pi/agent/settings.json` and project `.pi/settings.json`: entries naming a `.ts`/`.js` file or a folder of them add those files, the same way the `skills` arrays add skills.
|
|
31
|
+
|
|
32
|
+
Settings entries can also turn things off, and pi-minimal honours that instead of listing the item anyway. `-path` excludes one exact path and `+path` puts it back: the path is relative to the settings file's own directory (`~/.pi/agent` for user settings, `<cwd>/.pi` for project settings, a package's own directory for its filter entries) or absolute - a bare file name never matches. `!pattern` is a glob, tried against the relative path, the file name and the absolute path, with `*` and `?` stopping at `/` and `**` crossing it. They apply in that order: `!` disables, `+` restores what `!` excluded, and `-` beats both. Each settings array filters only its own scope's resources - project settings never touch `~/.pi/agent` ones, and user settings never touch the project's. A package entry can filter itself, e.g. `{"source": "npm:pi-web-access", "extensions": ["+index.ts"]}`. An item lists only the files that survive: a folder with some of its files switched off is still offered with the rest.
|
|
33
|
+
|
|
34
|
+
Deduplication matches pi: an extension file reached twice (through a symlink, or once by its package and once by the extensions folder) is listed once by its resolved path, so two different files sharing a name are still both listed. Skills keep pi's name-based dedupe, and extensions and skills keep separate names.
|
|
35
|
+
|
|
36
|
+
Project extensions, project skills and project settings are discovered relative to where you run pi-minimal, so they only appear for the project you launch from. pi only loads them in an untrusted project after you answer its trust prompt.
|
|
37
|
+
|
|
38
|
+
The agent directory defaults to `~/.pi/agent` and is read from `PI_CODING_AGENT_DIR` (`PI_AGENT_DIR` still works), and is passed on to the pi it launches. The state file location can be overridden with `PI_MINIMAL_STATE`.
|
|
39
|
+
|
|
40
|
+
Not covered yet: packages declared in a project's `.pi/settings.json`, and pinned package sources with a `@version` or `@ref` suffix.
|
|
41
|
+
|
|
42
|
+
What all of this lists is checked against pi itself: `python3 tests/test_pi_parity.py` runs the installed pi's own resolver over fixtures and compares the result with `discover()` (needs node and an installed pi; the rules above are pi 1.6.0's).
|
|
43
|
+
|
|
44
|
+
## Notes
|
|
45
|
+
|
|
46
|
+
- The launch is an `exec`, so pi replaces the pi-minimal process; quitting pi returns you to your shell.
|
|
47
|
+
- If an item you once checked disappears (package removed, file renamed, or a project skill in another directory), its name stays in the state file, so the item comes back ticked when it is found again (for example a project skill when you return to that project).
|