v0.24.0 - CommandHistory Library Module (2026-06-21)¶
What Changed?¶
This release promotes CommandHistory from a standalone example script (history.py) into a proper library module (kazunoko.history).
All example scripts now import it directly from kazunoko, and the output filename command_history.jsonl is centralized as CommandHistory.FILENAME.
What's New¶
Main Feature: CommandHistory as Library Module¶
What it does:
Tracks command execution metadata (invocation, status, duration, device info) and persists it as JSONL for troubleshooting support. When users report problems, they can submit command_history.jsonl to trace the full measurement-to-analysis workflow.
How to use it:
from kazunoko import CommandHistory
from pathlib import Path
import sys
history_path = Path("./data") / CommandHistory.FILENAME
history = CommandHistory.from_cli_context(
executable=Path(sys.argv[0]).name,
argv=sys.argv,
kazunoko_version=__version__,
)
history.save(history_path)
try:
# ... your code ...
history.update_status("completed")
history.save(history_path)
except KeyboardInterrupt:
history.update_status("interrupted")
history.save(history_path)
raise
except Exception:
history.update_status("error")
history.save(history_path)
raise
Installation¶
Quick Start¶
What's Different from the Last Version?¶
✅ Added¶
src/kazunoko/history.py: new library module withCommandHistorydataclass andreconstruct_command()functionCommandHistory.FILENAME: class attribute centralizing the"command_history.jsonl"filenameCommandHistoryandreconstruct_commandexported fromkazunokotop-level packageCommandHistoryadded tocheck_bme280.py(previously missing)
🔧 Changed¶
- All 12 example scripts migrated from
try/except ImportError+HAS_HISTORYpattern to directfrom kazunoko import CommandHistory - All scripts now reference
CommandHistory.FILENAMEinstead of hardcoding"command_history.jsonl" examples/history.pyremoved (promoted to library)
Is It Safe to Upgrade?¶
Backward Compatible: Yes
- Existing
command_history.jsonlfiles are unaffected - Example scripts produce identical output
CommandHistoryAPI is unchanged; only the import path changed
Tests Passed¶
- ✅ Builds without errors
- ✅
uvx ruff check src/passes - ✅ All example scripts import
CommandHistorywithout errors
Release Details¶
- Date: 2026-06-21
- Version: v0.24.0
- Files Changed: 15
- Commits: 995b50e, 33a022e, c2bf0e2, 7ff0d87, 23885cb
Next Steps¶
- Add tests for
CommandHistoryintests/