Show HN: AI-CLI-Log – Seamlessly Log Your AI CLI Conversations to Markdown

github.com

2 points by alingse 13 hours ago

Hey HN,

  I've developed ai-cli-log, a command-line utility designed to capture and log interactive terminal sessions. Its primary purpose is
  to provide a clean, accurate record of CLI interactions, which I found particularly useful when working with AI models or other
  interactive command-line tools.


  The tool functions by wrapping your chosen command. It leverages node-pty for pseudo-terminal emulation and @xterm/headless to
  process ANSI escape codes. This approach ensures that the captured output accurately reflects the final, rendered state of the
  terminal screen, including user input and any dynamic changes. The complete session is then saved as a Markdown file.


  Usage is simple:
  Just prefix the command you want to log with ai-cli-log. For example:
  ai-cli-log gemini
  ai-cli-log claude
  ai-cli-log my-custom-cli

  Session logs are stored as Markdown files within a .ai-cli-logs directory.


  You can find the project on GitHub: https://github.com/alingse/ai-cli-log

  Feedback and contributions are welcome.