free-pi-cli 0.0.1 → 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.
Files changed (4) hide show
  1. package/README.md +33 -3
  2. package/dist/index.js +14936 -0
  3. package/package.json +24 -4
  4. package/index.js +0 -1
package/README.md CHANGED
@@ -1,4 +1,34 @@
1
- # free-pi
1
+ # free-pi-cli
2
2
 
3
- This is a name-reservation placeholder for free-pi, a free ad-supported distribution of the pi coding agent.
4
- The real release is coming.
3
+ A preconfigured [pi](https://github.com/earendil-works/pi) coding agent, free
4
+ for the user because ads pay for inference. All model calls route through the
5
+ free-pi proxy — you never handle a model API key.
6
+
7
+ ```
8
+ npx free-pi-cli
9
+ ```
10
+
11
+ First run shows a consent screen (free inference, ads pay for it, sessions
12
+ may be used to train models), then signs you in with GitHub. Config and the
13
+ signed-in token live under `~/.free-pi/agent`, kept separate from any
14
+ existing `~/.pi/agent` install.
15
+
16
+ ## Development
17
+
18
+ - `FREEPI_BASE_URL` overrides the backend base URL (default
19
+ `https://api.freepi.ai`) — point it at a local dev server.
20
+ - `bun test` runs the test suite against an in-process stub server; no real
21
+ network or real pi TUI involved.
22
+
23
+ ## Layout
24
+
25
+ | File | Purpose |
26
+ |---|---|
27
+ | `src/index.ts` | bin entry — wires real dependencies, calls `run()` |
28
+ | `src/run.ts` | orchestration: consent → login → token check → launch |
29
+ | `src/consent.ts` | consent screen text/parsing |
30
+ | `src/auth-flow.ts` | GitHub device flow client (`/auth/github/device`, `/auth/consent`, `/auth/token`), `/me` token check |
31
+ | `src/credentials.ts` | JWT file storage (mode 0600) under the free-pi config dir |
32
+ | `src/provider.ts` | pure builder for the `pi.registerProvider` config |
33
+ | `src/pi-launch.ts` | the actual pi SDK integration (registers the provider, launches the TUI) |
34
+ | `src/paths.ts` | free-pi-namespaced config dir, isolated from `~/.pi/agent` |