Skip to content

AmbroiseLoeb/Bash_Notebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bash_Notebook

A lightweight Bash “notebook” tool to capture your terminal sessions as Markdown files.

Installation

  1. Copy notebook.sh to ~/.local/lib/
  2. Add the notebook function from bashrc_function.sh to your ~/.bashrc
  3. Reload the shell:
source ~/.bashrc

Usage

Start notebook session

  • 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.

Stop notebook session

notebook --stop

This 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).

Quick Example

notebook --start session_test.md --output
echo "Hello World"
ls
notebook --stop

Then, open the markdown file session_test.md in your favourite md file viewer (Obsidian, VSCode, etc.).

About

A lightweight Bash “notebook” tool to capture your terminal sessions as Markdown files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages