Skip to content

Repository files navigation

AstroVHS

AstroVHS

npm Downloads CI Docs Node License

Astro plugin for rendering charmbracelet/vhs tapes. At Atuin, we render a ton of terminal output. We love charmbracelet/vhs and wanted it in our Starlight docs. With this astro integration, that's easy!

import VHSTape from '@atuin.sh/astro-vhs/VHSTape.astro'

<VHSTape alt="Searching shell history with Atuin">
  Type "atuin search -i" Enter Sleep 1s Type "git push" Sleep 2s Up Sleep 1s Up Sleep 1.5s Escape
  Sleep 500ms
</VHSTape>

Searching shell history with Atuin

Standout Features

  • You get to write .tape files right in your docs.
  • Solid performance—dev builds are cached and instant.
  • Custom theming support

Quick Start

First, install the library in your project:

npm i --save @atuin.sh/astro-vhs

(or, you know—bun, pnpm, yarn)

Then, add the plugin in your astro.config.mjs:

// astro.config.mjs
import { unified } from '@astrojs/markdown-remark'
import vhs from '@atuin.sh/astro-vhs'
import { defineConfig } from 'astro/config'

export default defineConfig({
  markdown: { processor: unified() },
  integrations: [
    vhs({
      theme: { light: 'Catppuccin Latte', dark: 'Catppuccin Mocha' },
      settings: { Shell: 'zsh', FontFamily: 'IBM Plex Mono', Width: 1200, Height: 600 },
    }),
  ],
})

Note

This plugin requires @astrojs/mdx (included in Starlight) and @astrojs/markdown-remark's unified processor (Astro's default processor skips remark plugins), plus VHS installed on PATH.

In any .mdx file, define your tape:

<VHSTape alt="Printing JSON">{`
  Type "echo '{ok: true}'"
  Enter
`}</VHSTape>

Printing JSON

For more information, see the docs page.