No description
| install.sh | ||
| README.md | ||
| wtd.py | ||
| wtd_hook.sh | ||
| wtd_monitor.py | ||
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
.mdxfiles 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
- Clone or download this project.
- 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
wtduses the Linux Audit Subsystem (auditd) to trackexecve(commands) and file system calls (open,write, etc.) system-wide.- A background monitor (
wtd_monitor) watches the audit logs in real-time. - When a file is about to be modified for the first time in a session,
wtdcreates a backup of its original state. - When you stop the session,
wtdcompares the backups with the final files to generatediffblocks in your documentation.