pi-daily0.1.5
Daily work reports for Pi from local session activity.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-daily
Daily work reports for Pi, generated from local session activity.
pi-daily is a Pi Coding Agent extension that turns your local Pi session history into a concise Markdown daily report.
pi install npm:pi-daily
English | 简体中文
✨ What it does
| Scenario | Behavior |
|---|---|
Run /daily |
Generates today's work report from local Pi sessions. Run between 00:00-05:00 and it auto-traces the previous workday (yesterday 05:00 → today 05:00) so overnight work is included |
Run /daily YYYY-MM-DD |
Generates a report for a specific date |
Run /daily --project current |
Restricts the report to the current working directory |
Run /daily 昨晚到今天凌晨 |
Uses natural language to pick an overnight work window |
Run /daily 最近 8 小时 |
Generates a report for a relative time window |
Run /daily --day-start 05:00 |
Advanced form: treats the workday as 05:00 → next day 05:00; before 05:00 it belongs to the previous workday |
Run /daily --since 18:00 --until 02:00 |
Advanced form: generates a custom time window that can cross midnight |
Run /daily --from 2026-06-12T20:00 --to 2026-06-13T03:00 |
Advanced form: uses an absolute time range |
| Language | Auto-detected from PI_LOCALE > LC_ALL > LANG; 11 languages supported (zh-Hans/zh-Hant/ja/ko/de/fr/es/pt/ru/ar/en) |
Run /daily --save |
Saves the generated report to ~/Documents/pi-daily-reports/ |
| AI summary fails | Falls back to a local rule-based Markdown report |
🚀 Install
pi install npm:pi-daily
Then run in Pi:
/daily
Why this exists
Pi already stores session activity locally. pi-daily reads those session files and turns them into a lightweight daily worklog:
- what you worked on;
- which projects or concrete work items were active;
- what files and tools were involved;
- what got done;
- what is blocked or worth following up;
- per-project or per-item progress, outputs, risks, and follow-ups.
Privacy model
- Reads local
<sessionRoot>/**/*.jsonl. - Pi selects session storage with
--session-dir, thenPI_CODING_AGENT_SESSION_DIR, then thesessionDirsetting. The default is<agentDir>/sessions, where--agent-dirorPI_CODING_AGENT_DIRcan select a separate agent directory. Reports skip standaloneusageentries such as cache warming to keep conversation activity statistics comparable. - Does not modify original session files.
- Does not upload raw session text.
- Sends only redacted structured facts to the current conversation model.
- Redacts common secrets before rendering output.
- Saves reports only when explicitly requested with
--save.
AI summary model
pi-daily directly uses the current conversation model. There is no separate model configuration file and no package-level fallback model chain.
If the current conversation model call fails, pi-daily falls back to the local rule-based Markdown report.
Internationalization
Headings, stat lines, AI language instructions, and AI prompt scaffolding are localized, following the pi-compaction-i18n pattern. Language is auto-detected from PI_LOCALE > LC_ALL > LANG and supports 11 languages: Simplified Chinese, Traditional Chinese, Japanese, Korean, German, French, Spanish, Portuguese, Russian, Arabic, and English (default).
That includes project placeholder headings and section scaffolding inside the AI summary prompt, so non-Chinese locales no longer inherit Chinese-only prompt structure.
Output shape
AI reports are grouped by real project directories and concrete work items. Default workspace folders such as /Users/diwu are not treated as projects; their content is split into actual work items.
# YYYY-MM-DD 工作日报
## 今日概览
## 项目/事项一:<项目名或事项名>
### 进展
### 产出
### 阻塞 / 风险
### 待跟进
## 项目/事项二:<项目名或事项名>
### 进展
### 产出
### 阻塞 / 风险
### 待跟进
## 跨项目观察
## 工具与文件活动
Current implementation
index.tsregisters/daily.src/session-scan.tsscans and parses local session JSONL files.src/session-extract.tsextracts tasks, files, tools, errors, and blockers.src/report-model.tsaggregates a report model by project/workspace.src/ai-summary.tssummarizes structured facts with the current conversation model.src/markdown-render.tsrenders the local fallback Markdown report.src/redact.tsredacts obvious secrets.- Runtime logic uses direct TypeScript modules throughout the source tree.
Public contract
- Extension entry —
index.tsregisters the/dailycommand;package.jsonregisters the extension throughpi.extensionswithpi.nameset todaily. - Command contract —
/daily(today),/daily YYYY-MM-DD(a specific date),/daily --project current(current working directory),/daily --day-start,--since/--until,--from/--to(explicit time windows),/daily --save(save the report); natural-language windows such as昨晚到今天凌晨and最近 8 小时. - Time attribution — the default window is the calendar day; running the default
/dailybetween 00:00 and 05:00 auto-tracesyesterday 05:00 → today 05:00. A confirmation prompt precedes generation for a natural-language window. - Data boundary — reads only local session JSONL files, never modifies originals, and never uploads raw session text; only redacted structured facts reach the current conversation model; reports are written to
~/Documents/pi-daily-reports/only with an explicit--save. - Report contract — grouped by real project directories and concrete work items, preserving progress, outputs, blockers/risks, and follow-ups; default workspace folders are not treated as projects.
- Language contract — 11 languages detected from
PI_LOCALE>LC_ALL>LANG; headings, stat lines, AI language instructions, and AI prompt scaffolding are localized. - Model contract — uses the current conversation model directly, with no separate model configuration or package-level fallback chain; failure falls back to a local rule-based Markdown report.
- Implementation map — module responsibilities are in src/README.md, test coverage in tests/README.md, and the mechanism in doc/架构/10-系统架构.md.
Development
npm install
npm run check
npm test
npm run verify runs the type check, unit tests, and the handler smoke test in sequence.
Local testing with Pi
From this repository:
pi -e ./index.ts
Then run:
/daily
If you work past midnight, you can use natural language first. Pi will confirm the interpreted time window before generating:
/daily 昨晚到今天凌晨
/daily 昨晚加班
/daily 最近 8 小时
/daily 6月21号凌晨5点到6月22号凌晨5点
Natural-language time parsing uses the current conversation model for semantic understanding (handles arbitrary phrasing, absolute dates, relative terms), and falls back to a local regex parser when the model is unavailable. A confirmation prompt always lets you verify or cancel the interpreted window before the report is generated.
Advanced deterministic forms are still available:
/daily --day-start 05:00
/daily 2026-06-12 --since 18:00 --until 02:00
If you want to save the report:
/daily --save
Contributing
- Entry points —
index.tsandsrc/(implementation; see src/README.md),tests/(unit tests and handler smoke; see tests/README.md),README.mdandREADME-zh.md(user documentation),AGENTS.md(privacy and engineering boundaries),doc/README.md(documentation navigation),PROGRESS.md(current execution state). - Local verification —
npm run verify(type check + unit tests + handler smoke). Add a smoke case when the entry point or time parsing changes. If Pi loading or TUI behavior changes, also load the extension temporarily from the checkout and manually verify the target command; state explicitly when no real model call was made. - Documentation sync — update
README.md(English) andREADME-zh.md(Chinese) in the same change, keep every technical detail in both, and keep the two pages linked at the top; mechanism changes go todoc/架构/, product-principle changes todoc/规格/. - Change log — daily user-perceivable entries are recorded in
CHANGELOG-zh.mdin this repository and mirrored into the EnglishCHANGELOG.mdwhen a release is prepared; both changelogs and both READMEs ship in the npm package. - Packaging check — before publishing, run
npm pack --dry-run --ignore-scripts --jsonand confirm the tarball containsREADME.md,README-zh.md,CHANGELOG.md, andCHANGELOG-zh.md. - Boundaries — read only local sessions; raw JSONL, prompts, model output, paths, and sensitive content must not be uploaded, logged, or used in test fixtures; keep the report's consumable structure and make saving predictable and idempotent.
Project structure
pi-daily/
├── index.ts
├── src/
├── tests/
├── doc/
├── package.json
└── README.md
License
MIT