Skip to main content

Review user prompts for evidence-backed improvement in AI coding collaboration.

Project description

Prompt Diary

Language: English | 简体中文

CI Publish PyPI Coverage budget

Prompt Diary prepares bounded workspaces from local assistant session history and generates evidenced prompt diary reports that help users review and improve how they collaborate with AI coding agents.

The tool targets Python 3.10 and newer. The package exposes report and prompt-diary console commands after installation.

Usage

Install Prompt Diary from PyPI as an isolated uv tool:

uv tool install prompt-diary

Then run:

report --help
prompt-diary --help
report prepare --date 2026-05-12 --timezone Asia/Shanghai
report generate --date 2026-05-12 --timezone Asia/Shanghai
report render notion --date 2026-05-12 --timezone Asia/Shanghai

Generation is an artifact-first pipeline with standalone phase commands:

report generate evidence --date 2026-05-12 --timezone Asia/Shanghai --project-key <project> --session-ref S0001
report generate project --date 2026-05-12 --timezone Asia/Shanghai --project-key <project>
report generate daily --date 2026-05-12 --timezone Asia/Shanghai

Once Notion is configured, report render notion can publish an already-generated report as a new row in the Notion database. It resolves the existing workspace, requires daily-report.json, regenerates the deterministic report.notion.json payload beside report.md, and publishes that payload. report generate delegates to the same render path after a successful pipeline: by default it publishes when Notion is configured; pass --no-notion to skip publishing, or --notion to require it (which errors if Notion is not configured). Configure the Notion integration token and target database id once with prompt-diary config init (see Configuration); credentials never pass on the command line. Each run appends a new dated row; re-publishing never edits or deletes existing rows.

Generation drives a three-phase, artifact-first pipeline — evidence extraction, then project synthesis, then daily report synthesis — through the Codex CLI, producing daily-report.json, the rendered report.md, and report.notion.json. It requires the codex CLI to be installed and authenticated; the subcommands above run each phase standalone against an already-prepared workspace.

Prepared workspaces and generated reports are written under a per-user data directory by default (~/.local/share/prompt-diary/ on Linux; the platform equivalent on macOS and Windows), organized by date as <reports-root>/work/<YYYY-MM-DD>/. Override the location with --reports-root <path> on prepare, generate, and render notion, PROMPT_DIARY_HOME, or the stored config (see Configuration); precedence is --reports-root over PROMPT_DIARY_HOME over the stored config over the default data directory. (Earlier versions wrote to ./.reports in the current directory — pass --reports-root .reports to keep using an existing local directory.)

Both prepare and generate show a live progress dashboard when running on a TTY and write append-only log lines when output is piped, redirected, or running in CI. Pass --quiet to either command to suppress the live output and print only the final summary.

Configuration

Run prompt-diary config init once to set up credentials and settings interactively. It prompts for the Notion integration token, an optional data folder, the Notion database id, and an optional reporter name (a free-form label, like git config user.name, written into the 汇报人 column at publish time). Each credential is validated live against the Notion API and saved the moment it passes — the token check reports the authenticated integration and workspace, and the database check reports the connected database's name — so an interrupted run keeps whatever was already verified. Everything is written to a single config file with 0600 permissions. The token is read only from that file or the environment — never passed on the command line, and never printed (config show masks it).

prompt-diary config init   # interactive setup; validates the token and database live
prompt-diary config show   # print the configuration (token masked) and the file location
prompt-diary config path   # print the config file location

The config file lives under the per-user config directory (~/.config/prompt-diary/config.json on Linux; the platform equivalent on macOS and Windows), overridable with PROMPT_DIARY_CONFIG. Each setting is resolved from the first source that provides it: a CLI flag (where one exists), then the environment, then the stored config, then a built-in default (where one exists). So NOTION_API_KEY / NOTION_PAGE_ID and --reports-root / PROMPT_DIARY_HOME still override the stored config (useful in CI). Once Notion is configured — including via those environment variables — a bare report generate publishes by default; pass --no-notion in CI or any pipeline that should not publish.

Development

This project uses uv for Python version, environment, dependency, build, and release workflows.

Read docs/src/product.md before designing new features, changing report content, or modifying the generation pipeline. It defines the tool's purposes and principles that downstream design must satisfy.

For environment setup, build commands, type checking, testing, coverage, linting, and pre-submit checks, including the optional Ubuntu 24.04 devcontainer, see the Development Guide. For codebase architecture and API design, see Architecture.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prompt_diary-0.1.0.tar.gz (126.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prompt_diary-0.1.0-py3-none-any.whl (165.8 kB view details)

Uploaded Python 3

File details

Details for the file prompt_diary-0.1.0.tar.gz.

File metadata

  • Download URL: prompt_diary-0.1.0.tar.gz
  • Upload date:
  • Size: 126.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for prompt_diary-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b217b32df046ee08d8dfabe0b9aa9aa2613009a577715f9b56f1f1bd71cb944e
MD5 737a7eff73b571531827a45daf309703
BLAKE2b-256 e72d22b1f24b6ba25ae91e50ad08f56b757565016976c2e763228e1449f0a85a

See more details on using hashes here.

File details

Details for the file prompt_diary-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: prompt_diary-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 165.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for prompt_diary-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f6da4acfc35c8c73aa2420989fe9cd1f5f1407c2712e077ab41caa6e86fa376
MD5 d97df56c8b38998fa43d49c82574e9d4
BLAKE2b-256 d9ece23e6d8156b24bd6a6521d237fba93728ab8bb09e23168531a2a56df1418

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page