Skip to content

Releases

v0.3.0

Choose a tag to compare

@kenshaw kenshaw released this 14 Nov 02:22

This release changes the API, with no compatibility with v0.2.

  • termcast has no flags. A program owns its flags and calls Start only when it wants the stream. The type Flags is gone.
  • Start detects the terminal with rasterm.Detect. WithTerminal skips detection, and WithDetectOptions passes options to it. Stream.Terminal returns the terminal, and Stream.Keys returns the keys that detection read.
  • On kitty and Ghostty, the stream draws each frame into one Kitty image with rasterm.KittyStream, so the picture changes with no flicker. WithAnimation turns this on or off. Other terminals clear the screen at each redraw.
  • Stop returns the first error of the stream. A nil stream is a stream that is off, and its methods are safe.
  • Removed: Available, ErrVerbose, Fatal, Err and WithEncoder.
  • Uses rasterm v0.3.1, chromedp v0.23.1 and cdproto v0.160.1. Needs Go 1.25 or later.

See docs/decisions/2026-11-14-options-only-and-the-kitty-stream.md.

v0.2.2

Choose a tag to compare

@kenshaw kenshaw released this 05 Oct 22:50

Documentation only. The README lists the example programs that use termcast, and the comment of Stop describes the final frame.

v0.2.1

Choose a tag to compare

@kenshaw kenshaw released this 05 Oct 22:12

termcast supports Go 1.25 and later. It requires chromedp v0.20.0 and cdproto v0.157.8. The CI runs Go 1.25, 1.26 and stable.

v0.2.0

Choose a tag to compare

@kenshaw kenshaw released this 04 Oct 04:23

New option WithElement draws only the element that a chromedp selector finds, and not the whole page. The stream looks the element up again at each frame, so an element that moves or changes its size stays in view. The README also lists the example programs that use termcast.

v0.1.1

Choose a tag to compare

@kenshaw kenshaw released this 04 Oct 03:58

Stop draws a screenshot as the final frame when no screencast frame arrived. A program that ends fast, before the browser sends the first frame, no longer shows an empty final frame.

v0.1.0

Choose a tag to compare

@kenshaw kenshaw released this 04 Oct 03:43

This is the first release of termcast. The package streams the screen of a chromedp page to a terminal that has graphics, with the screencast of the Chrome DevTools Protocol and the package rasterm. It works in Kitty, iTerm2 and Sixel terminals.

var tc termcast.Flags
tc.Register(flag.CommandLine)
flag.Parse()
// ... create the chromedp context ...
s, err := tc.Start(ctx, *verbose)
if err != nil {
	log.Fatal(err)
}
defer s.Stop()
log.SetOutput(s.LogWriter())

What it does

  • Start draws the page at 4 frames per second by default. A WithFPS option or the flag -terminal-fps changes the rate.
  • Each redraw clears the terminal and draws the latest frame. The package uses no alternate screen and does not hide the cursor, so a program that ends with log.Fatal never leaves the terminal in a changed state.
  • The browser sends a frame only when the page changes. The stream keeps the latest frame, so a page that stops changing stays on the screen.
  • Start returns ErrNoGraphics when the terminal has no graphics. The message names the terminals that work and the variable TERM_GRAPHICS that forces a type.
  • Stream.LogWriter holds the log lines of the program while the stream runs, and prints them after a final frame when the stream stops. Every method of *Stream is safe on a nil pointer, so a program can call s.Stop() and s.Fatal(err) whether the stream is on or off.
  • Flags registers -visible-on-terminal and -terminal-fps, and Flags.Start returns ErrVerbose when the stream is on together with -v, because the protocol messages would draw over the frames.
  • The options WithQuality, WithMaxSize, WithOutput, WithLogOutput and WithEncoder change the JPEG quality, the frame size, the writers and the encoder.

Install

go get github.com/chromedp/termcast@v0.1.0

The package needs Go 1.27 or later and chromedp v0.19.0.

⌂ 换网址