Run code blocks from Markdown files
runblock is a command-line tool that allows you to extract and execute code blocks from Markdown files.
- List Code Blocks: List all named code blocks from a Markdown file.
- Print Code Blocks: Print the content of a specific code block by name.
- Execute Code Blocks: Execute a specific code block by name in the current shell.
- Interactive Mode: Run
runblockin interactive mode to select and execute code blocks from a list.
Download the latest release:
wget -O runblock "https://github.com/thevops/runblock/releases/latest/download/runblock_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m)"
chmod +x runblockTo install runblock, you need to have Go installed on your machine. Then, you can clone the repository and build the project:
git clone https://github.com/yourusername/runblock.git
cd runblock
go build -o runblockRun runblock --help to see the available commands and options.
Check out the example directory for a sample Markdown file and code blocks.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
- Cobra for the CLI framework.
- Goldmark for the Markdown parser.
- Charmbracelet Log for the logging library.