Show HN: Embed a real Linux terminal on your website

raboukhalil · HackerNews · 5 min read · original

Embed sandbox.bio

Add a live terminal to your website or blog post

You can embed a sandbox.bio terminal directly on your website or blog post. Simply add this script tag to your page:

<script src="https://sandbox.bio/embed.js" data-cwd="embed"></script>

A blog post with Run buttons on its code blocks and a terminal docked at the bottom

If you use GitHub Pages, any Markdown code blocks you mark as ```bash will have a "Run" button that executes directly in the embedded terminal. For HTML websites, any <div> with the class "language-bash" will get a "Run" button.

You can also customize the embedded terminal by adding attributes to the script tag:

If you need to preload files in the terminal, you can use the array files inside your config, and specify the URLs to where each file lives:

{
 tools: [
 { "url": "https://<username>.github.io/<repo>/data/example.bam", "path": "example.bam" }
 ]
}