pi-codex-footer 0.1.0 → 0.2.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 (2) hide show
  1. package/README.md +62 -64
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -1,108 +1,106 @@
1
1
  # pi-codex-footer
2
2
 
3
- A publishable Pi package that adds a readable 2-line footer with live OpenAI Codex quota information.
3
+ A Pi extension that replaces the default footer with a **2-line Codex status footer**:
4
+ - session/context/cost info
5
+ - live OpenAI Codex 5h + 7d quota usage and reset timers
4
6
 
5
- ## What it shows
7
+ ---
6
8
 
7
- Line 1:
8
- - current folder
9
- - git branch
10
- - provider + model
11
- - thinking level
12
- - context usage as `used/window`
13
- - total session cost
9
+ ## Install (npm)
14
10
 
15
- Line 2:
16
- - tokens/sec for the last assistant response
17
- - real Codex 5h usage
18
- - real Codex 7d usage
19
- - real 5h reset countdown
20
- - real 7d reset countdown
11
+ ```bash
12
+ pi install npm:pi-codex-footer
13
+ /reload
14
+ ```
21
15
 
22
- For OpenAI Codex, quota data comes from:
16
+ That’s it.
23
17
 
24
- - `https://chatgpt.com/backend-api/codex/usage`
18
+ ---
25
19
 
26
- using your existing Pi OAuth auth from:
20
+ ## What you’ll see
27
21
 
28
- - `~/.pi/agent/auth.json`
22
+ ### Line 1
23
+ - current folder
24
+ - git branch
25
+ - provider + model
26
+ - thinking level
27
+ - context usage (`used/window`)
28
+ - total session cost
29
29
 
30
- ## Privacy / secrets
30
+ ### Line 2
31
+ - tokens/sec for last assistant response
32
+ - Codex 5h usage
33
+ - Codex 7d usage
34
+ - 5h reset countdown
35
+ - 7d reset countdown
31
36
 
32
- This package **does not bundle or publish any secrets**.
37
+ > Live quota fields appear when your active provider is `openai-codex`.
33
38
 
34
- It reads your existing local `openai-codex` OAuth token and account id from `~/.pi/agent/auth.json` at runtime, then makes a request to OpenAI's ChatGPT backend to fetch live quota data.
39
+ ---
35
40
 
36
- It does **not**:
37
- - write your token into the package
38
- - store your token in the repo
39
- - print your token in UI output
40
- - require manual config edits
41
+ ## Commands
41
42
 
42
- ## Install
43
+ - `/codex-footer-on` — enable footer (reloads Pi)
44
+ - `/codex-footer-off` — restore Pi default footer
45
+ - `/codex-footer-status` — show Codex quota/auth status
43
46
 
44
- ### From a local folder
47
+ ---
45
48
 
46
- ```bash
47
- pi install ./pi-codex-footer
48
- ```
49
+ ## Troubleshooting
49
50
 
50
- ### From npm
51
+ If quota shows `n/a`:
52
+ 1. Make sure your model provider is `openai-codex`
53
+ 2. Run `/codex-footer-status`
54
+ 3. If auth is expired/missing, re-authenticate in Pi and `/reload`
51
55
 
52
- ```bash
53
- pi install npm:pi-codex-footer
54
- ```
56
+ Quota refreshes about once per minute, while countdown timers update every second.
55
57
 
56
- ### From git
58
+ ---
57
59
 
58
- ```bash
59
- pi install git:github.com/glnarayanan/pi-codex-footer
60
- ```
60
+ ## Privacy & security
61
61
 
62
- Then reload Pi:
62
+ This extension **does not bundle or store secrets** in the package.
63
63
 
64
- ```text
65
- /reload
66
- ```
64
+ At runtime, it reads your existing Pi OAuth credentials from:
67
65
 
68
- ## Commands
66
+ - `~/.pi/agent/auth.json`
69
67
 
70
- - `/codex-footer-on` — reload Pi and enable the footer
71
- - `/codex-footer-off` — restore Pi's default footer
72
- - `/codex-footer-status` — show whether live Codex quota data is available
68
+ and calls:
73
69
 
74
- ## Behavior
70
+ - `https://chatgpt.com/backend-api/codex/usage`
75
71
 
76
- - If the active provider is `openai-codex`, the footer shows live quota numbers.
77
- - If the active provider is something else, quota fields show `n/a`.
78
- - Quota data refreshes roughly once per minute.
79
- - Reset countdowns update every second.
72
+ It does **not** write tokens to your repo or print raw tokens in the UI.
80
73
 
81
- ## Development
74
+ ---
82
75
 
83
- Try it locally without publishing:
76
+ ## Other install options
84
77
 
78
+ ### Local folder
85
79
  ```bash
86
80
  pi install ./pi-codex-footer
81
+ /reload
87
82
  ```
88
83
 
89
- or:
90
-
84
+ ### Git
91
85
  ```bash
92
- pi -e ./pi-codex-footer/extensions/index.ts
86
+ pi install git:github.com/glnarayanan/pi-codex-footer
87
+ /reload
93
88
  ```
94
89
 
95
- ## Publish to npm
90
+ ---
91
+
92
+ ## For maintainers
93
+
94
+ Publish a new release:
96
95
 
97
96
  ```bash
98
- cd pi-codex-footer
97
+ npm version patch
99
98
  npm publish --access public
100
99
  ```
101
100
 
102
- ## Publish from git
103
-
104
- Push this folder to a repo, then install with:
101
+ Then users can update with:
105
102
 
106
103
  ```bash
107
- pi install git:github.com/glnarayanan/pi-codex-footer
104
+ pi install npm:pi-codex-footer@latest
105
+ /reload
108
106
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-codex-footer",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Pi extension that adds a 2-line footer with live OpenAI Codex 5h/7d quota usage and reset timers.",
5
5
  "type": "module",
6
6
  "author": "glnarayanan",
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "scripts": {
40
40
  "build": "echo 'nothing to build'",
41
- "check": "echo 'load in pi with pi -e ./extensions/index.ts or pi install ./pi-codex-footer'"
41
+ "check": "echo 'load in pi with pi -e ./extensions/index.ts or pi install ./pi-codex-footer'",
42
+ "release": "bash publish.sh"
42
43
  }
43
44
  }