@pify/cli 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +117 -0
- package/catalog.json +85 -0
- package/dist/cli.js +1419 -0
- package/dist/index.d.ts +195 -0
- package/dist/index.js +628 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 pifydev
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# @pify/cli
|
|
2
|
+
|
|
3
|
+
Front door for the [Pify](https://github.com/pifydev) suite: install and update the
|
|
4
|
+
[pi coding agent](https://github.com/earendil-works/pi), manage the `@pify/*`
|
|
5
|
+
extension packages with short names, and scaffold new Pi Packages.
|
|
6
|
+
|
|
7
|
+
> Not to be confused with the unscoped npm package `pify` (sindresorhus's
|
|
8
|
+
> promisify library) — unrelated.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g @pify/cli
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or bootstrap without installing anything permanently:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx @pify/cli setup
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
pify setup # install the pi coding agent (safe to re-run)
|
|
26
|
+
pify setup --pi-version 0.84.4 # pin the version your team has tested
|
|
27
|
+
pify list # show the @pify catalog with install state
|
|
28
|
+
pify install goal task # short names resolve to @pify/goal, @pify/task
|
|
29
|
+
pify install goal -l -a # project scope, pre-approved (CI-friendly)
|
|
30
|
+
pify remove goal
|
|
31
|
+
pify update # update pi + every installed @pify package
|
|
32
|
+
pify update pi # agent only
|
|
33
|
+
pify doctor # diagnose node / npm / pi / settings
|
|
34
|
+
pify init my-extension # scaffold a new Pi Package
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Every command supports `--help`; `install`/`remove`/`update` support `--dry-run`;
|
|
38
|
+
`list`/`doctor` support `--json`.
|
|
39
|
+
|
|
40
|
+
## How it relates to `pi`
|
|
41
|
+
|
|
42
|
+
`pify` deliberately does **not** replace pi's package manager. Every package
|
|
43
|
+
operation delegates to `pi install` / `pi remove` / `pi update`, which own
|
|
44
|
+
`~/.pi/agent/settings.json` and the extension npm workspace — pify never edits
|
|
45
|
+
pi's settings. What `pify` adds:
|
|
46
|
+
|
|
47
|
+
- **Bootstrap** — `pi update` can't run when pi isn't installed yet; `pify setup`
|
|
48
|
+
closes that gap (`npm install -g --ignore-scripts @earendil-works/pi-coding-agent`,
|
|
49
|
+
matching pi's own self-update invocation).
|
|
50
|
+
- **Catalog** — `@pify/*` short names, discovery (including packages that are
|
|
51
|
+
planned but not yet published), and install state at a glance.
|
|
52
|
+
- **One-pass update** — `pify update` chains pi's self-update with per-package
|
|
53
|
+
updates of everything from this org, without touching non-Pify packages you
|
|
54
|
+
manage separately.
|
|
55
|
+
- **Doctor** — environment sanity checks for support requests.
|
|
56
|
+
- **Scaffolding** — `pify init` emits a correctly-shaped Pi Package: raw
|
|
57
|
+
TypeScript entry (no build step; pi loads `.ts` via jiti), host packages as
|
|
58
|
+
optional `peerDependencies`, `files` allowlist that actually ships the
|
|
59
|
+
sources, and a lifecycle-correct extension factory.
|
|
60
|
+
|
|
61
|
+
## Packages
|
|
62
|
+
|
|
63
|
+
| Package | Description |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `@pify/btw` | By-the-way notes: capture asides without derailing the agent |
|
|
66
|
+
| `@pify/goal` | Pin a session goal and keep the agent anchored to it |
|
|
67
|
+
| `@pify/memory` | Persistent memory across pi sessions |
|
|
68
|
+
| `@pify/plan-mode` | Read-only planning mode with approve-then-execute gate |
|
|
69
|
+
| `@pify/pretty` | Prettier TUI rendering for tool calls, diffs, markdown |
|
|
70
|
+
| `@pify/subagent` | Spawn scoped subagents from within a pi session |
|
|
71
|
+
| `@pify/swarm` | Coordinate multiple pi agents working in parallel |
|
|
72
|
+
| `@pify/task` | Track tasks and progress inside pi sessions |
|
|
73
|
+
| `@pify/usage` | Token and cost usage reporting |
|
|
74
|
+
| `@pify/workflow` | Deterministic multi-step agent workflows |
|
|
75
|
+
| `@pify/yolo` | Auto-approve everything, with an undo trail |
|
|
76
|
+
|
|
77
|
+
The catalog ships inside the CLI and refreshes (at most daily) from
|
|
78
|
+
[`catalog.json` on `main`](https://github.com/pifydev/cli/blob/main/catalog.json),
|
|
79
|
+
so newly published packages appear without a CLI update. A fetched catalog is
|
|
80
|
+
validated before use — every entry must stay inside the `@pify` scope — and any
|
|
81
|
+
invalid document is discarded entirely. Overrides: `PIFY_CATALOG_URL` (remote
|
|
82
|
+
URL), `PIFY_OFFLINE=1` or `PI_OFFLINE=1` (skip all network lookups).
|
|
83
|
+
|
|
84
|
+
Explicit `@pify/<name>` arguments bypass the catalog's published/planned gate
|
|
85
|
+
(with a warning), so a freshly published package is installable before the
|
|
86
|
+
catalog propagates.
|
|
87
|
+
|
|
88
|
+
## Exit codes
|
|
89
|
+
|
|
90
|
+
| Code | Meaning |
|
|
91
|
+
|---|---|
|
|
92
|
+
| 0 | Success (including warned no-ops such as offline update) |
|
|
93
|
+
| 1 | Unexpected failure; doctor found problems; init target not empty |
|
|
94
|
+
| 2 | Usage error (unknown command/flag, non-@pify source, range pin) |
|
|
95
|
+
| 3 | Environment problem (Node too old; npm/pi missing; managed-install conflict) |
|
|
96
|
+
| 4 | Not found (unknown catalog name; not yet published; not installed) |
|
|
97
|
+
| 5 | A delegated `pi`/`npm` subprocess exited non-zero |
|
|
98
|
+
|
|
99
|
+
Colored output respects `NO_COLOR`, `FORCE_COLOR`, `--no-color`, and non-TTY
|
|
100
|
+
pipes. Results go to stdout; warnings and errors go to stderr. No interactive
|
|
101
|
+
prompts anywhere — behavior is identical in TTY and CI except color.
|
|
102
|
+
|
|
103
|
+
## Development
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm install
|
|
107
|
+
npm run build # tsup -> dist/
|
|
108
|
+
npm test # builds first, then node --test
|
|
109
|
+
npm run typecheck
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Requires Node >= 22.19.0 (same floor as the pi coding agent).
|
|
113
|
+
Tested with pi 0.84.4.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
MIT © [Pify maintainers](https://github.com/pifydev)
|
package/catalog.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"org": "pifydev",
|
|
4
|
+
"scope": "@pify",
|
|
5
|
+
"remote": "https://raw.githubusercontent.com/pifydev/cli/main/catalog.json",
|
|
6
|
+
"packages": [
|
|
7
|
+
{
|
|
8
|
+
"name": "btw",
|
|
9
|
+
"npm": "@pify/btw",
|
|
10
|
+
"repo": "https://github.com/pifydev/btw",
|
|
11
|
+
"description": "By-the-way notes: capture asides during a session without derailing the agent",
|
|
12
|
+
"status": "planned"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "goal",
|
|
16
|
+
"npm": "@pify/goal",
|
|
17
|
+
"repo": "https://github.com/pifydev/goal",
|
|
18
|
+
"description": "Pin a session goal and keep the agent anchored to it",
|
|
19
|
+
"status": "planned"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "memory",
|
|
23
|
+
"npm": "@pify/memory",
|
|
24
|
+
"repo": "https://github.com/pifydev/memory",
|
|
25
|
+
"description": "Persistent memory across pi sessions",
|
|
26
|
+
"status": "planned"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "plan-mode",
|
|
30
|
+
"npm": "@pify/plan-mode",
|
|
31
|
+
"repo": "https://github.com/pifydev/plan-mode",
|
|
32
|
+
"description": "Read-only planning mode with an explicit approve-then-execute gate",
|
|
33
|
+
"status": "planned"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "pretty",
|
|
37
|
+
"npm": "@pify/pretty",
|
|
38
|
+
"repo": "https://github.com/pifydev/pretty",
|
|
39
|
+
"description": "Prettier TUI rendering for tool calls, diffs, and markdown",
|
|
40
|
+
"status": "planned"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "subagent",
|
|
44
|
+
"npm": "@pify/subagent",
|
|
45
|
+
"repo": "https://github.com/pifydev/subagent",
|
|
46
|
+
"description": "Spawn scoped subagents from within a pi session",
|
|
47
|
+
"status": "planned"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "swarm",
|
|
51
|
+
"npm": "@pify/swarm",
|
|
52
|
+
"repo": "https://github.com/pifydev/swarm",
|
|
53
|
+
"description": "Coordinate multiple pi agents working in parallel",
|
|
54
|
+
"status": "planned"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "task",
|
|
58
|
+
"npm": "@pify/task",
|
|
59
|
+
"repo": "https://github.com/pifydev/task",
|
|
60
|
+
"description": "Track tasks and progress inside pi sessions",
|
|
61
|
+
"status": "planned"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "usage",
|
|
65
|
+
"npm": "@pify/usage",
|
|
66
|
+
"repo": "https://github.com/pifydev/usage",
|
|
67
|
+
"description": "Token and cost usage reporting for pi sessions",
|
|
68
|
+
"status": "planned"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "workflow",
|
|
72
|
+
"npm": "@pify/workflow",
|
|
73
|
+
"repo": "https://github.com/pifydev/workflow",
|
|
74
|
+
"description": "Deterministic multi-step agent workflows for pi",
|
|
75
|
+
"status": "planned"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "yolo",
|
|
79
|
+
"npm": "@pify/yolo",
|
|
80
|
+
"repo": "https://github.com/pifydev/yolo",
|
|
81
|
+
"description": "One toggle to auto-approve everything, with an undo trail",
|
|
82
|
+
"status": "planned"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|