No description
Find a file
2026-04-22 16:05:40 +02:00
install.sh Fix: Suppress locale warnings and improve container detection in install.sh 2026-04-22 15:59:04 +02:00
README.md Enhancement: Remove emojis, update author metadata, and filter logs by AUID 2026-04-22 15:53:54 +02:00
wtd.py Fix: Strict user-centric filtering, rename support and aggressive noise reduction 2026-04-22 16:05:40 +02:00
wtd_hook.sh Enhancement: Add Container-friendly fallback mode (Shell Hook + Inotify-style polling) 2026-04-22 15:57:35 +02:00
wtd_monitor.py Fix: Strict user-centric filtering, rename support and aggressive noise reduction 2026-04-22 16:05:40 +02:00

wtd (Work To Doc)

A system-wide Linux tool to automatically generate documentation (MDX) from your terminal sessions and file changes.

Features

  • Automatic Logging: Records every command you run and every file you modify system-wide.
  • Smart Filtering:
    • Deduplicates consecutive identical commands.
    • Ignores "noise" like opening an editor and closing it without changes.
    • Excludes temporary files and system directories.
  • Diff Generation: Shows exactly what changed inside the files you edited using unified_diff.
  • Advanced MDX Export: Generates structured .mdx files with frontmatter and proper code block highlighting.
  • Session Management: Start, stop, show, and delete sessions easily.
  • ZIP Export: Bundle all your guides into a single ZIP file for easy sharing.

Requirements

  • Linux OS
  • Python 3
  • auditd (for system-wide monitoring)
  • Root privileges (sudo)

Installation

  1. Clone or download this project.
  2. Run the installation script:
    sudo ./install.sh
    

Usage

Start a session

sudo wtd --start install-nginx

Stop and generate doc

sudo wtd --stop

List all sessions

sudo wtd --show

Delete a session

sudo wtd --delete install-nginx

Export all docs to ZIP

sudo wtd --export

How it works

  1. wtd uses the Linux Audit Subsystem (auditd) to track execve (commands) and file system calls (open, write, etc.) system-wide.
  2. A background monitor (wtd_monitor) watches the audit logs in real-time.
  3. When a file is about to be modified for the first time in a session, wtd creates a backup of its original state.
  4. When you stop the session, wtd compares the backups with the final files to generate diff blocks in your documentation.