A lightweight Bash “notebook” tool to capture your terminal sessions as Markdown files.
- Copy
notebook.shto~/.local/lib/ - Add the
notebookfunction frombashrc_function.shto your~/.bashrc - Reload the shell:
source ~/.bashrc-
Start simple capture without output:
notebook --start mysession.md
Select simple mode. The bash code block will contain the typed commands (may differ from the executed command if it contains aliases). Ignores commands beginning with a space
, duplicates, and commands stored in HISTIGNORE (sudo, cd, history, clear, pwd). -
Start capture with commands and outputs
notebook --start mysession.md --output
Select output mode. The bash code block will contain the commands that are actually executed, not aliases. Standard output will be displayed after the bash code block.
After starting the session, type your commands as usual in the terminal.
notebook --stopThis command stops capturing and rebuilds the Markdown file.
The final file will contain:
- Bash code blocks with the executed commands.
- The corresponding command outputs (if --output was enabled).
notebook --start session_test.md --outputecho "Hello World"lsnotebook --stopThen, open the markdown file session_test.md in your favourite md file viewer (Obsidian, VSCode, etc.).