codex-work-receipt 0.3.0 → 0.5.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/CHANGELOG.md +17 -0
- package/README.en.md +28 -111
- package/README.md +29 -189
- package/docs/cli.en.md +137 -0
- package/docs/cli.md +137 -0
- package/docs/codex-skill.en.md +45 -0
- package/docs/codex-skill.md +45 -0
- package/docs/data-schema.en.md +35 -0
- package/docs/data-schema.md +19 -9
- package/docs/images/social-preview-source.svg +84 -0
- package/docs/images/social-preview.png +0 -0
- package/docs/mobile-import.en.md +19 -0
- package/docs/mobile-import.md +13 -9
- package/docs/privacy.en.md +30 -0
- package/docs/privacy.md +26 -8
- package/package.json +2 -1
- package/skills/ai-work-receipt/SKILL.md +5 -2
- package/src/cli.mjs +23 -4
- package/src/core/args.mjs +35 -4
- package/src/core/metrics.mjs +37 -25
- package/src/core/presentation.mjs +36 -13
- package/src/core/qr-payload.mjs +10 -2
- package/src/core/range.mjs +118 -0
- package/src/core/receipt-record.mjs +10 -3
- package/src/core/selector.mjs +71 -0
- package/src/parsers/codex.mjs +77 -11
- package/src/renderers/html.mjs +191 -40
- package/templates/README.md +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
- 新增网页版“保存完整长图”功能。
|
|
6
|
+
- 高清 PNG 包含主小票、小程序码和数据二维码导入联。
|
|
7
|
+
- 导出图片自动使用当前主题,并排除主题按钮、网页背景和其他页面元素。
|
|
8
|
+
- 网页主题与小程序统一为经典白票、复古粉票和夜班绿票。
|
|
9
|
+
- 小票顶部明确展示统计日期范围,默认文件名同步携带日期范围或会话短编号。
|
|
10
|
+
- 图片在浏览器本地渲染,不上传小票数据。
|
|
11
|
+
|
|
12
|
+
## 0.4.0
|
|
13
|
+
|
|
14
|
+
- 新增无参数命令行范围选择器。
|
|
15
|
+
- 新增今日、最近 7 个自然日、本周和指定会话统计。
|
|
16
|
+
- 多会话汇总改为按事件时间筛选,并按会话计算 Token 区间增量。
|
|
17
|
+
- 小票和二维码显式携带统计范围与自然日边界。
|
|
18
|
+
- Codex Skill 支持“最近七天”和“本周”等自然语言请求。
|
|
19
|
+
|
|
3
20
|
## 0.3.0
|
|
4
21
|
|
|
5
22
|
- 新增中文、英文两套完整 HTML 小票文案。
|
package/README.en.md
CHANGED
|
@@ -10,73 +10,33 @@
|
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/codex-work-receipt"><img alt="npm" src="https://img.shields.io/npm/v/codex-work-receipt?color=42CDA7"></a>
|
|
13
14
|
<img alt="Node.js 20+" src="https://img.shields.io/badge/Node.js-20%2B-339933?logo=node.js&logoColor=white">
|
|
14
|
-
<img alt="
|
|
15
|
-
<img alt="
|
|
15
|
+
<img alt="GPL-3.0" src="https://img.shields.io/badge/license-GPL--3.0-17231F">
|
|
16
|
+
<img alt="Local first" src="https://img.shields.io/badge/data-local--first-42CDA7">
|
|
16
17
|
</p>
|
|
17
18
|
|
|
18
19
|
<p align="center">
|
|
19
20
|
<img src="docs/images/readme-hero.jpg" alt="Three Codex Work Receipt themes" width="920">
|
|
20
21
|
</p>
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
Codex Work Receipt summarizes turns, tool calls, Tokens, duration, and models, then turns them into playful AI work points, a job title, and a review. Receipts never include prompts, responses, source code, project paths, or file names.
|
|
23
24
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
<p align="center">
|
|
27
|
-
<a href="https://modelflare.dev/">
|
|
28
|
-
<img src="docs/images/sponsors/modelflare-logo.png" alt="ModelFlare Logo" width="72">
|
|
29
|
-
</a>
|
|
30
|
-
</p>
|
|
31
|
-
|
|
32
|
-
<p align="center">
|
|
33
|
-
<a href="https://modelflare.dev/"><strong>ModelFlare</strong></a><br>
|
|
34
|
-
<a href="https://modelflare.dev/">modelflare.dev</a><br>
|
|
35
|
-
<sub>Stable access to leading AI model APIs at a very low cost, with developer-friendly pricing, transparent billing, and clear usage visibility.</sub>
|
|
36
|
-
</p>
|
|
37
|
-
|
|
38
|
-
## Receipt themes
|
|
25
|
+
## Quickstart
|
|
39
26
|
|
|
40
|
-
|
|
41
|
-
<tr>
|
|
42
|
-
<td align="center"><strong>Classic</strong></td>
|
|
43
|
-
<td align="center"><strong>Vintage Diner</strong></td>
|
|
44
|
-
<td align="center"><strong>Night Payroll</strong></td>
|
|
45
|
-
</tr>
|
|
46
|
-
<tr>
|
|
47
|
-
<td><img src="docs/images/receipts/receipt-classic.jpg" alt="Classic work receipt" width="320"></td>
|
|
48
|
-
<td><img src="docs/images/receipts/receipt-diner.jpg" alt="Vintage diner work receipt" width="320"></td>
|
|
49
|
-
<td><img src="docs/images/receipts/receipt-payroll.jpg" alt="Night payroll work receipt" width="320"></td>
|
|
50
|
-
</tr>
|
|
51
|
-
</table>
|
|
52
|
-
|
|
53
|
-
## Quick start
|
|
54
|
-
|
|
55
|
-
Requires Node.js 20+ and local Codex session records.
|
|
27
|
+
Requires Node.js 20+ and local Codex session records. No clone required; choose today, the last 7 days, this week, or a specific session:
|
|
56
28
|
|
|
57
29
|
```bash
|
|
58
|
-
npx codex-work-receipt@latest --
|
|
30
|
+
npx codex-work-receipt@latest --lang en
|
|
59
31
|
```
|
|
60
32
|
|
|
61
|
-
Summarize all Codex activity from today
|
|
33
|
+
Summarize all Codex activity from today:
|
|
62
34
|
|
|
63
35
|
```bash
|
|
64
36
|
npx codex-work-receipt@latest --today --lang en
|
|
65
37
|
```
|
|
66
38
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
## Desktop-to-mobile flow
|
|
70
|
-
|
|
71
|
-
```text
|
|
72
|
-
Local Codex sessions
|
|
73
|
-
→ run one command
|
|
74
|
-
→ generate an HTML receipt and data QR code
|
|
75
|
-
→ scan from the companion mini program
|
|
76
|
-
→ change themes, save, and share
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
The companion mini program supports QR import, local history, themes, and image export. Scan the official mini-program code with WeChat, then scan the adjacent data QR code to import the current receipt.
|
|
39
|
+
HTML and structured data are written to `./codex-work-receipt-output/` by default. The generated page can save a high-resolution PNG containing the full receipt and QR import stub. Non-interactive options such as `--latest` and `--today` remain available; see the [CLI guide](docs/cli.en.md).
|
|
80
40
|
|
|
81
41
|
## Ask Codex directly
|
|
82
42
|
|
|
@@ -86,79 +46,36 @@ Install the AI Work Receipt skill once:
|
|
|
86
46
|
npx codex-work-receipt@latest --install-skill --lang en
|
|
87
47
|
```
|
|
88
48
|
|
|
89
|
-
Then ask Codex
|
|
49
|
+
Then ask Codex:
|
|
90
50
|
|
|
91
51
|
> Create an AI work receipt for my latest Codex session.
|
|
92
52
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
Codex will select the correct mode and theme, run the CLI, and open the generated page. You can also invoke `$ai-work-receipt` explicitly.
|
|
96
|
-
|
|
97
|
-
The skill is installed at `~/.agents/skills/ai-work-receipt/` and does not modify the current repository. Restart Codex if the current session does not detect it.
|
|
53
|
+
Codex will choose the range and theme, run the CLI, and open the receipt. See the [Codex Skill guide](docs/codex-skill.en.md).
|
|
98
54
|
|
|
99
|
-
##
|
|
55
|
+
## Desktop to mobile
|
|
100
56
|
|
|
101
|
-
|
|
102
|
-
- Complete Chinese and English receipt copy
|
|
103
|
-
- Three visual receipt themes
|
|
104
|
-
- Turns, user messages, tool calls, interruptions, Tokens, duration, and models
|
|
105
|
-
- Playful AI work points, job titles, and reviews
|
|
106
|
-
- Versioned `cwr1` QR payload for mobile import
|
|
107
|
-
- Local JSON snapshots and deduplicated history
|
|
108
|
-
- Installable Codex skill for natural-language generation
|
|
109
|
-
- No prompt, response, code, path, or file-name export
|
|
57
|
+
The desktop page generates a privacy-safe data QR code. The companion WeChat mini program supports QR import, local history, themes, and image export. See [mobile import](docs/mobile-import.en.md).
|
|
110
58
|
|
|
111
|
-
##
|
|
59
|
+
## Docs
|
|
112
60
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
Run `npx codex-work-receipt@latest --help` for the full option list.
|
|
120
|
-
|
|
121
|
-
## Privacy
|
|
122
|
-
|
|
123
|
-
- Reads `~/.codex/sessions/**/*.jsonl` by default
|
|
124
|
-
- Extracts event types, timestamps, model names, and numerical statistics only
|
|
125
|
-
- Does not store prompts, responses, source code, project paths, or file names
|
|
126
|
-
- Does not send session data over the network while running
|
|
127
|
-
- Saves HTML and structured history locally
|
|
128
|
-
|
|
129
|
-
See [docs/privacy.md](docs/privacy.md) and [docs/data-schema.md](docs/data-schema.md).
|
|
130
|
-
|
|
131
|
-
## Open-source boundary
|
|
132
|
-
|
|
133
|
-
This repository contains the desktop CLI, receipt renderer, QR data protocol, tests, and documentation. It does not contain the companion mini-program source code or server implementation.
|
|
61
|
+
- [CLI usage and options](docs/cli.en.md)
|
|
62
|
+
- [Codex Skill](docs/codex-skill.en.md)
|
|
63
|
+
- [Mobile QR import](docs/mobile-import.en.md)
|
|
64
|
+
- [Data schema and QR protocol](docs/data-schema.en.md)
|
|
65
|
+
- [Local data and privacy](docs/privacy.en.md)
|
|
66
|
+
- [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md) · [Changelog](CHANGELOG.md)
|
|
134
67
|
|
|
135
|
-
##
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
git clone https://github.com/a-bai-2026/ai-work-receipt.git
|
|
139
|
-
cd codex-work-receipt
|
|
140
|
-
npm install
|
|
141
|
-
npm test
|
|
142
|
-
npm run receipt -- --latest
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Please read [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md) before contributing. Never submit real Codex sessions.
|
|
146
|
-
|
|
147
|
-
## Roadmap
|
|
68
|
+
## Sponsor
|
|
148
69
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
70
|
+
<p align="center">
|
|
71
|
+
<a href="https://modelflare.dev/"><img src="docs/images/sponsors/modelflare-logo.png" alt="ModelFlare Logo" width="56"></a><br>
|
|
72
|
+
<a href="https://modelflare.dev/"><strong>ModelFlare</strong></a> · <a href="https://modelflare.dev/">modelflare.dev</a><br>
|
|
73
|
+
<sub>Helping independent developers access leading AI model APIs reliably and at a very low cost, so they can quickly build their own products with advanced model capabilities.</sub>
|
|
74
|
+
</p>
|
|
154
75
|
|
|
155
|
-
## License
|
|
76
|
+
## License
|
|
156
77
|
|
|
157
|
-
|
|
158
|
-
- Modified or redistributed versions must continue to comply with GPLv3 and provide the corresponding source code
|
|
159
|
-
- GPLv3 applies only to the desktop project in this repository; it does not cover the companion mini program, backend services, or other independent products
|
|
160
|
-
- This is an unofficial community project and is not affiliated with or endorsed by OpenAI
|
|
161
|
-
- Codex and other product names belong to their respective owners
|
|
78
|
+
The desktop source is licensed under [GNU GPL v3](LICENSE) (`GPL-3.0-only`). This is an unofficial community project and is not affiliated with OpenAI.
|
|
162
79
|
|
|
163
80
|
---
|
|
164
81
|
|
package/README.md
CHANGED
|
@@ -10,102 +10,37 @@
|
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/codex-work-receipt"><img alt="npm" src="https://img.shields.io/npm/v/codex-work-receipt?color=42CDA7"></a>
|
|
13
14
|
<img alt="Node.js 20+" src="https://img.shields.io/badge/Node.js-20%2B-339933?logo=node.js&logoColor=white">
|
|
14
|
-
<img alt="
|
|
15
|
-
<img alt="
|
|
15
|
+
<img alt="GPL-3.0" src="https://img.shields.io/badge/license-GPL--3.0-17231F">
|
|
16
|
+
<img alt="Local first" src="https://img.shields.io/badge/data-local--first-42CDA7">
|
|
16
17
|
</p>
|
|
17
18
|
|
|
18
19
|
<p align="center">
|
|
19
20
|
<img src="docs/images/readme-hero.jpg" alt="Codex AI 打工小票三种主题效果" width="920">
|
|
20
21
|
</p>
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
只读取本机 Codex 会话中的时间和数字统计。<br>
|
|
24
|
-
不会把 Prompt、回复正文、代码、项目路径或文件名写入小票。
|
|
25
|
-
</p>
|
|
26
|
-
|
|
27
|
-
## 赞助商
|
|
28
|
-
|
|
29
|
-
<p align="center">
|
|
30
|
-
<a href="https://modelflare.dev/">
|
|
31
|
-
<img src="docs/images/sponsors/modelflare-logo.png" alt="ModelFlare Logo" width="72">
|
|
32
|
-
</a>
|
|
33
|
-
</p>
|
|
34
|
-
|
|
35
|
-
<p align="center">
|
|
36
|
-
<a href="https://modelflare.dev/"><strong>ModelFlare</strong></a><br>
|
|
37
|
-
<a href="https://modelflare.dev/">modelflare.dev</a><br>
|
|
38
|
-
<sub>让个人开发者也能以很低的成本稳定接入前沿 AI 模型 API,价格友好、计费透明、用量清晰可见。</sub>
|
|
39
|
-
</p>
|
|
40
|
-
|
|
41
|
-
## 三种小票主题
|
|
42
|
-
|
|
43
|
-
<table>
|
|
44
|
-
<tr>
|
|
45
|
-
<td align="center"><strong>经典白票</strong></td>
|
|
46
|
-
<td align="center"><strong>复古粉票</strong></td>
|
|
47
|
-
<td align="center"><strong>夜班绿票</strong></td>
|
|
48
|
-
</tr>
|
|
49
|
-
<tr>
|
|
50
|
-
<td><img src="docs/images/receipts/receipt-classic.jpg" alt="AI 打工小票经典白票" width="320"></td>
|
|
51
|
-
<td><img src="docs/images/receipts/receipt-diner.jpg" alt="AI 打工小票复古粉票" width="320"></td>
|
|
52
|
-
<td><img src="docs/images/receipts/receipt-payroll.jpg" alt="AI 打工小票夜班绿票" width="320"></td>
|
|
53
|
-
</tr>
|
|
54
|
-
</table>
|
|
23
|
+
它会统计 Codex 会话中的轮次、工具调用、Token、时长和模型,生成带有 AI 工分、今日工种和点评的小票。不会把 Prompt、回复正文、代码、项目路径或文件名写入小票。
|
|
55
24
|
|
|
56
|
-
|
|
25
|
+
## Quickstart
|
|
57
26
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
需要 Node.js 20 或更高版本,并且本机已经使用过 Codex。
|
|
61
|
-
|
|
62
|
-
不需要克隆仓库,统计最近一次会话并自动打开小票:
|
|
27
|
+
需要 Node.js 20 或更高版本,并且本机已经使用过 Codex。无需克隆仓库,运行后选择“今天 / 近 7 日 / 本周 / 指定会话”:
|
|
63
28
|
|
|
64
29
|
```bash
|
|
65
|
-
npx codex-work-receipt@latest
|
|
30
|
+
npx codex-work-receipt@latest
|
|
66
31
|
```
|
|
67
32
|
|
|
68
|
-
|
|
33
|
+
汇总今天的全部 Codex 活动:
|
|
69
34
|
|
|
70
35
|
```bash
|
|
71
36
|
npx codex-work-receipt@latest --today
|
|
72
37
|
```
|
|
73
38
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
npx codex-work-receipt@latest --latest --lang en
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
生成结果默认保存在:
|
|
81
|
-
|
|
82
|
-
```text
|
|
83
|
-
./codex-work-receipt-output/
|
|
84
|
-
├── codex-receipt-latest.html
|
|
85
|
-
└── codex-receipt-latest.json
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## 从电脑到手机
|
|
89
|
-
|
|
90
|
-
```text
|
|
91
|
-
Codex 本地会话
|
|
92
|
-
↓
|
|
93
|
-
运行一行命令
|
|
94
|
-
↓
|
|
95
|
-
生成 AI 打工小票网页和数据二维码
|
|
96
|
-
↓
|
|
97
|
-
在配套小程序中扫码导入
|
|
98
|
-
↓
|
|
99
|
-
换模板、保存图片、分享
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
配套小程序已经支持扫码导入、本地历史、主题切换和保存图片。微信扫码即可进入配套小程序,再扫描旁边的数据二维码导入当前小票。
|
|
103
|
-
|
|
104
|
-
数据二维码只携带版本化的脱敏统计,不携带图片和原始会话。桌面端与小程序端分别根据同一份结构数据渲染小票。
|
|
39
|
+
网页和结构数据默认保存在 `./codex-work-receipt-output/`。生成的网页支持一键保存包含主小票和二维码导入联的高清长图。也可以继续使用 `--latest`、`--today` 等非交互参数,详见 [CLI 使用文档](docs/cli.md)。
|
|
105
40
|
|
|
106
41
|
## 直接跟 Codex 说
|
|
107
42
|
|
|
108
|
-
|
|
43
|
+
安装一次 AI 打工小票 Skill:
|
|
109
44
|
|
|
110
45
|
```bash
|
|
111
46
|
npx codex-work-receipt@latest --install-skill
|
|
@@ -115,130 +50,35 @@ npx codex-work-receipt@latest --install-skill
|
|
|
115
50
|
|
|
116
51
|
> 给刚刚这次工作开一张 AI 打工小票。
|
|
117
52
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
> 用英文生成刚刚这次工作的 AI 打工小票。
|
|
121
|
-
|
|
122
|
-
Codex 会自动判断 `--latest` 或 `--today`、选择主题、执行命令并打开生成的网页。也可以通过 `$ai-work-receipt` 显式调用。
|
|
123
|
-
|
|
124
|
-
Skill 安装在用户目录 `~/.agents/skills/ai-work-receipt/`,不会写入当前代码仓库;如果当前会话没有识别到,请重启 Codex。
|
|
125
|
-
|
|
126
|
-
## 它能做什么
|
|
127
|
-
|
|
128
|
-
- 统计最近一次 Codex 会话,或汇总今天的全部活动
|
|
129
|
-
- 生成经典白票、复古粉票、夜班绿票三种主题
|
|
130
|
-
- 支持中文和英文两套完整小票文案
|
|
131
|
-
- 统计会话、轮次、用户消息、工具调用和中断次数
|
|
132
|
-
- 展示 Token、缓存输入、AI 工作时长和模型
|
|
133
|
-
- 根据工作量生成娱乐化的 AI 工分、今日工种和点评
|
|
134
|
-
- 生成可供配套小程序扫描的 `cwr1` 数据二维码
|
|
135
|
-
- 在本机保存结构 JSON 和去重后的历史记录
|
|
136
|
-
- 安装可通过自然语言触发的 Codex Skill
|
|
137
|
-
- 全程不上传 Prompt、回复、代码或项目路径
|
|
53
|
+
Codex 会选择统计范围和主题、执行命令并打开小票。详见 [Codex Skill 使用文档](docs/codex-skill.md)。
|
|
138
54
|
|
|
139
|
-
##
|
|
140
|
-
|
|
141
|
-
选择默认主题:
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
npx codex-work-receipt@latest --latest --theme diner
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
仅生成文件,不自动打开浏览器:
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
npx codex-work-receipt@latest --latest --no-open
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
指定时区和输出路径:
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
npx codex-work-receipt@latest --today \
|
|
157
|
-
--timezone Asia/Shanghai \
|
|
158
|
-
--output ./my-receipt.html
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
可用参数:
|
|
162
|
-
|
|
163
|
-
| 参数 | 说明 |
|
|
164
|
-
| --- | --- |
|
|
165
|
-
| `--latest` | 统计最近活跃的 Codex 会话,默认模式 |
|
|
166
|
-
| `--today` | 汇总指定时区今天发生的 Codex 活动 |
|
|
167
|
-
| `--timezone <name>` | 指定 IANA 时区,例如 `Asia/Shanghai` |
|
|
168
|
-
| `--lang <name>` | `zh-CN`(默认)或 `en` |
|
|
169
|
-
| `--theme <name>` | `classic`、`diner` 或 `payroll` |
|
|
170
|
-
| `--output <file>` | 指定 HTML 输出路径 |
|
|
171
|
-
| `--data-dir <directory>` | 指定本地结构历史目录 |
|
|
172
|
-
| `--install-skill` | 将 AI 打工小票 Skill 安装到当前用户的 Codex |
|
|
173
|
-
| `--no-open` | 生成后不自动打开浏览器 |
|
|
174
|
-
|
|
175
|
-
## 本地保存的数据
|
|
176
|
-
|
|
177
|
-
每次运行会生成或更新:
|
|
178
|
-
|
|
179
|
-
- `codex-work-receipt-output/codex-receipt-*.html`:可切换主题的小票网页
|
|
180
|
-
- `codex-work-receipt-output/codex-receipt-*.json`:当前小票的版本化结构数据
|
|
181
|
-
- `~/.codex-work-receipt/receipts/*.json`:本机历史快照
|
|
182
|
-
- `~/.codex-work-receipt/latest.json`:最近生成的一张小票
|
|
183
|
-
- `~/.codex-work-receipt/history.jsonl`:去重后的本地历史,方便未来批量迁移
|
|
184
|
-
|
|
185
|
-
数据结构和二维码协议见 [docs/data-schema.md](docs/data-schema.md)。
|
|
186
|
-
|
|
187
|
-
## 隐私设计
|
|
188
|
-
|
|
189
|
-
- 默认只读取 `~/.codex/sessions/**/*.jsonl`
|
|
190
|
-
- 只提取事件类型、时间、模型名称和数字统计
|
|
191
|
-
- 不保存 Prompt、回复正文、代码、项目路径或文件名
|
|
192
|
-
- 运行期间不向网络发送会话数据
|
|
193
|
-
- HTML、结构 JSON 和历史记录全部保存在本机
|
|
194
|
-
- 二维码等同于一份可扫描的数据文件,请只向信任的人展示
|
|
195
|
-
|
|
196
|
-
更完整的隐私说明见 [docs/privacy.md](docs/privacy.md)。
|
|
197
|
-
|
|
198
|
-
## 当前限制
|
|
199
|
-
|
|
200
|
-
- 暂不统计修改文件数和代码行数,避免在不同工具调用方式下产生误导
|
|
201
|
-
- `--today` 默认扫描最近 72 小时有变动的会话文件,再按事件日期筛选
|
|
202
|
-
- 当前只支持 Codex;Cursor、WorkBuddy 等数据源仍在规划中
|
|
203
|
-
- 网页端不直接导出图片,移动端渲染和保存由配套小程序完成
|
|
204
|
-
|
|
205
|
-
## 本地开发
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
git clone https://github.com/a-bai-2026/ai-work-receipt.git
|
|
209
|
-
cd codex-work-receipt
|
|
210
|
-
npm install
|
|
211
|
-
npm test
|
|
212
|
-
npm run receipt -- --latest
|
|
213
|
-
```
|
|
55
|
+
## 从电脑到手机
|
|
214
56
|
|
|
215
|
-
|
|
57
|
+
桌面网页会生成脱敏的数据二维码。配套微信小程序支持扫码导入、本地历史、主题切换和保存图片。详见 [手机扫码导入](docs/mobile-import.md)。
|
|
216
58
|
|
|
217
|
-
|
|
218
|
-
- [SECURITY.md](SECURITY.md)
|
|
219
|
-
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
|
|
59
|
+
## 文档
|
|
220
60
|
|
|
221
|
-
|
|
61
|
+
- [CLI 使用与全部参数](docs/cli.md)
|
|
62
|
+
- [Codex Skill](docs/codex-skill.md)
|
|
63
|
+
- [手机扫码导入](docs/mobile-import.md)
|
|
64
|
+
- [数据结构与二维码协议](docs/data-schema.md)
|
|
65
|
+
- [本地数据与隐私说明](docs/privacy.md)
|
|
66
|
+
- [参与贡献](CONTRIBUTING.md) · [安全说明](SECURITY.md) · [更新日志](CHANGELOG.md)
|
|
222
67
|
|
|
223
|
-
##
|
|
68
|
+
## 赞助商
|
|
224
69
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
70
|
+
<p align="center">
|
|
71
|
+
<a href="https://modelflare.dev/"><img src="docs/images/sponsors/modelflare-logo.png" alt="ModelFlare Logo" width="56"></a><br>
|
|
72
|
+
<a href="https://modelflare.dev/"><strong>ModelFlare</strong></a> · <a href="https://modelflare.dev/">modelflare.dev</a><br>
|
|
73
|
+
<sub>让个人开发者也可以以很低的成本、稳定地接入前沿 AI 模型的 API,借助模型能力快速构建自己的产品。</sub>
|
|
74
|
+
</p>
|
|
230
75
|
|
|
231
|
-
##
|
|
76
|
+
## License
|
|
232
77
|
|
|
233
|
-
|
|
234
|
-
- 修改或分发本项目时,必须继续遵守 GPLv3 并提供相应源码
|
|
235
|
-
- GPLv3 仅适用于本仓库中的电脑端项目,不覆盖配套小程序、后台服务或其他独立产品
|
|
236
|
-
- 本项目是非 OpenAI 官方社区工具,与 OpenAI 无隶属或背书关系
|
|
237
|
-
- Codex、Cursor、WorkBuddy 及相关名称和商标归各自权利人所有
|
|
78
|
+
电脑端源码采用 [GNU GPL v3](LICENSE)(`GPL-3.0-only`)。本项目是非 OpenAI 官方社区工具。
|
|
238
79
|
|
|
239
80
|
---
|
|
240
81
|
|
|
241
82
|
<p align="center">
|
|
242
|
-
<strong>如果这张小票让你觉得有点意思,欢迎点一个 Star。</strong
|
|
243
|
-
让每一次 AI 打工,都留下一张可以带走的记录。
|
|
83
|
+
<strong>如果这张小票让你觉得有点意思,欢迎点一个 Star。</strong>
|
|
244
84
|
</p>
|
package/docs/cli.en.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# CLI guide
|
|
2
|
+
|
|
3
|
+
<p><a href="./cli.md">中文</a> · <strong>English</strong> · <a href="../README.en.md">Back to README</a></p>
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js 20 or later
|
|
8
|
+
- Local Codex session records under `~/.codex/sessions/`
|
|
9
|
+
|
|
10
|
+
No clone or global installation is required.
|
|
11
|
+
|
|
12
|
+
## Interactive range selector
|
|
13
|
+
|
|
14
|
+
Run:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx codex-work-receipt@latest --lang en
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Choose all activity today, the last 7 calendar days, this week, or a specific recent session. Session choices include their time range, turns, tool calls, and model for identification.
|
|
21
|
+
|
|
22
|
+
## Non-interactive ranges
|
|
23
|
+
|
|
24
|
+
Summarize the latest active session and open the receipt:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx codex-work-receipt@latest --latest --lang en
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Summarize all Codex activity from today in your local timezone:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx codex-work-receipt@latest --today --lang en
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Last 7 calendar days, including today:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx codex-work-receipt@latest --range last-7-days --lang en
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Monday through now:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx codex-work-receipt@latest --range this-week --lang en
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Language and themes
|
|
49
|
+
|
|
50
|
+
Generate a Chinese receipt:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx codex-work-receipt@latest --latest --lang zh-CN
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Choose the initial theme:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx codex-work-receipt@latest --latest --lang en --theme diner
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Available themes:
|
|
63
|
+
|
|
64
|
+
- `classic`: classic white receipt
|
|
65
|
+
- `diner`: vintage pink diner receipt
|
|
66
|
+
- `payroll`: dark-green night payroll receipt
|
|
67
|
+
|
|
68
|
+
Themes can still be switched in the generated page without changing the metrics.
|
|
69
|
+
|
|
70
|
+
## Output
|
|
71
|
+
|
|
72
|
+
Default output:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
./codex-work-receipt-output/
|
|
76
|
+
├── codex-receipt-today-2026-07-18.html
|
|
77
|
+
└── codex-receipt-today-2026-07-18.json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Default filenames include the calendar range. Latest-session and selected-session receipts include a short identifier so receipts from different dates or sessions do not overwrite one another.
|
|
81
|
+
|
|
82
|
+
Open the generated HTML and click “Save full PNG” to download a high-resolution image. It includes the main receipt, mini-program code, and data QR import stub in the currently selected theme. Theme controls, the page background, and the footer note are excluded.
|
|
83
|
+
|
|
84
|
+
Set a timezone and output path:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npx codex-work-receipt@latest --today --lang en \
|
|
88
|
+
--timezone Asia/Shanghai \
|
|
89
|
+
--output ./my-receipt.html
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Generate files without opening a browser:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npx codex-work-receipt@latest --latest --lang en --no-open
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Options
|
|
99
|
+
|
|
100
|
+
| Option | Description |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| `--range <name>` | `latest`, `today`, `last-7-days`, or `this-week` |
|
|
103
|
+
| `--latest` | Summarize the latest active Codex session; default mode |
|
|
104
|
+
| `--today` | Summarize activity from today in the selected timezone |
|
|
105
|
+
| `--session <id>` | Summarize one specific Codex session |
|
|
106
|
+
| `--timezone <name>` | Set an IANA timezone such as `Asia/Shanghai` |
|
|
107
|
+
| `--lang <name>` | `zh-CN` (default) or `en` |
|
|
108
|
+
| `--theme <name>` | `classic`, `diner`, or `payroll` |
|
|
109
|
+
| `--output <file>` | Set the HTML output path |
|
|
110
|
+
| `--data-dir <directory>` | Set the local structured-history directory |
|
|
111
|
+
| `--install-skill` | Install the Codex AI Work Receipt skill |
|
|
112
|
+
| `--no-open` | Do not open the generated page |
|
|
113
|
+
|
|
114
|
+
Run the built-in help at any time:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npx codex-work-receipt@latest --help
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Local history
|
|
121
|
+
|
|
122
|
+
Each run creates or updates:
|
|
123
|
+
|
|
124
|
+
- `codex-work-receipt-output/codex-receipt-*.html`: theme-switchable receipt page
|
|
125
|
+
- `codex-work-receipt-output/codex-receipt-*.json`: versioned receipt data
|
|
126
|
+
- `~/.codex-work-receipt/receipts/*.json`: local snapshots
|
|
127
|
+
- `~/.codex-work-receipt/latest.json`: latest receipt
|
|
128
|
+
- `~/.codex-work-receipt/history.jsonl`: deduplicated local history
|
|
129
|
+
|
|
130
|
+
See the [data schema and QR protocol](data-schema.en.md).
|
|
131
|
+
|
|
132
|
+
## Current limitations
|
|
133
|
+
|
|
134
|
+
- Codex is the only supported data source; Cursor and WorkBuddy are planned
|
|
135
|
+
- Changed-file and line counts are intentionally omitted until they can be measured consistently
|
|
136
|
+
- Calendar ranges filter individual events by local date and calculate a Token delta for each session
|
|
137
|
+
- Desktop PNG export is rendered locally in the browser and does not upload receipt data
|