opencode-autopilot-logbookOpenCode plugin that auto-generates daily reports on session idle
0
265
265 in 7 days
34.9
Multi-signal model
9 hours ago
2026-08-20
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-autopilot-logbook@1.1.0"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-autopilot-logbook@1.1.0"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-autopilot-logbookopencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
An OpenCode plugin that automatically generates daily reports when a session becomes idle.
Features
- Auto-generates daily reports on
session.idleevents - Configurable output directory
- Custom templates supported via environment variable
- If the session includes mixed Japanese/English, prefer English in the generated logbook
Install
npm install -g opencode-autopilot-logbook
opencode plugin opencode-autopilot-logbook -g
If you get "No plugin targets found", clear the OpenCode cache first:
rm -rf ~/.cache/opencode/packages/opencode-autopilot-logbook*
Restart OpenCode
Quit and relaunch OpenCode.
Verify
- Start a session, do some work, then let it idle
- A daily report will be generated automatically
Uninstall
opencode plugin opencode-autopilot-logbook -g --remove
npm uninstall -g opencode-autopilot-logbook
rm -rf ~/.cache/opencode/packages/opencode-autopilot-logbook*
Environment Variables
OPENCODE_DAILY_LOGBOOK_DISABLED
- Default:
false - Set to
trueto disable the plugin
export OPENCODE_DAILY_LOGBOOK_DISABLED=true
OPENCODE_DAILY_LOGBOOK_TEMPLATE
- Default: not set (uses built-in
SAMPLE_TEMPLATE) - Set to a file path to use a custom template
- Falls back to
SAMPLE_TEMPLATEif the specified file cannot be read
export OPENCODE_DAILY_LOGBOOK_TEMPLATE="documents/plans/dev/daily-logbook.md"
OPENCODE_DAILY_LOGBOOK_OUTPUT_DIR
- Default:
artifacts/daily - Set to change the output directory for daily reports
export OPENCODE_DAILY_LOGBOOK_OUTPUT_DIR="daily"
OPENCODE_DAILY_LOGBOOK_REDACT
- Default:
true - When enabled, known secret patterns (
sk-.../SK-...,Bearer <token>,AKIA...,ghp_...,github_pat_...,xoxb-..., JWT (eyJ...), PEM private keys,password:-style pairs, etc.) in the transcript are replaced with***before being embedded into the prompt - Only the exact value
"false"disables masking. Any other value keeps the default (true) - Masking is a fail-safe to reduce accidental disclosure. It is not a guarantee of complete secrecy. Never rely on it to protect sensitive information
Masking limitations:
- OpenAI-style keys are matched case-insensitively (
sk-...andSK-...) - JWTs with any segment shorter than 10 characters are not masked (the matcher requires at least 10 characters per segment)
Bearermatching is context-free, so natural-language phrases such as "bearer of" may be over-masked
export OPENCODE_DAILY_LOGBOOK_REDACT=false
OPENCODE_DAILY_LOGBOOK_INCLUDE_TRANSCRIPT
- Default:
true - When
"false", the transcript is not embedded into the prompt at all (the template alone is used) - Only the exact value
"false"disables embedding. Any other value keeps the default (true) - When this is
"false", the transcript is never embedded regardless of theOPENCODE_DAILY_LOGBOOK_REDACTsetting
export OPENCODE_DAILY_LOGBOOK_INCLUDE_TRANSCRIPT=false
OPENCODE_DAILY_LOGBOOK_THROTTLE_MS
- Default:
90000(90 seconds) - Minimum interval between two automatic generations for the same session
- Parsed as an integer. If the value cannot be parsed as a non-negative integer, the default is used
0disables throttling (every idle event triggers generation, subject to other limits)- Values in scientific notation (e.g.
1e3) are truncated by the integer parser and read as1, not1000
export OPENCODE_DAILY_LOGBOOK_THROTTLE_MS=180000
OPENCODE_DAILY_LOGBOOK_DAILY_LIMIT
- Default:
false - Only the exact value
"true"enables the limit. Any other value keeps the default (false) - When enabled, generation is skipped if
{{ outputDir }}/{{ date }}_logbook.mdalready exists for today (file-based check, survives process restarts) - When enabled, the append-style workflow becomes once per day (Issue C)
- If the file exists but is empty or incomplete (e.g. a previous generation failed), regeneration is blocked for the rest of the day (Issue D). The check is purely file-existence based
- Concurrent idle events for the same date are suppressed: while a generation for today is in flight, other sessions that idle at the same time are skipped (an in-memory, date-keyed guard; does not survive process restarts)
- When enabled,
{{ outputDir }}is passed to the prompt as an absolute path resolved against the plugin's directory, so the agent writes to the same location the existence check inspects. When disabled, the relative string (e.g.artifacts/daily) is passed as before - Not supported together with
OPENCODE_DAILY_LOGBOOK_TEMPLATE: a custom template may change the file name pattern, so the existence check cannot be performed. A warning is logged and the daily limit check is skipped in that case
export OPENCODE_DAILY_LOGBOOK_DAILY_LIMIT=true
Output
- Daily report:
{{ outputDir }}/YYYYMMDD_logbook.md
Existing files are updated (appended), not overwritten.
License
MIT