diff --git a/tools/render_jsonl.py b/tools/render_jsonl.py index 3372ee1..2bec0da 100755 --- a/tools/render_jsonl.py +++ b/tools/render_jsonl.py @@ -11,10 +11,12 @@ Usage: Stdlib only. Python 3.9+. Read-only on the input. """ + import json import sys from pathlib import Path + def extract_text(content): if isinstance(content, str): return content.strip() @@ -28,6 +30,7 @@ def extract_text(content): return "\n".join(parts) return "" + def main(): if len(sys.argv) < 2: print(__doc__) @@ -62,7 +65,8 @@ def main(): f"# Claude Code transcript: {src}", f"# Total turns: {len(turns)}", f"# Date range : {min(stamps) if stamps else 'n/a'} -> {max(stamps) if stamps else 'n/a'}", - "#" + "-" * 70, "", + "#" + "-" * 70, + "", ] out.write("\n".join(header)) for ts, role, text in turns: @@ -71,5 +75,6 @@ def main(): out.close() print(f"Wrote {len(turns)} turns to {sys.argv[2]}") + if __name__ == "__main__": main()