Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ changelog:

release:
github:
owner: gui-cs
owner: tui-cs
name: tuirec
draft: false
prerelease: auto
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Give it a binary and a keystroke script → get a polished GIF or PNG. No manual

```sh
# Go (requires Go 1.22+)
go install github.com/gui-cs/tuirec/cmd/tuirec@latest
go install github.com/tui-cs/tuirec/cmd/tuirec@latest
```

`go install` places the binary in `$(go env GOPATH)/bin/`. Ensure that
Expand All @@ -28,7 +28,7 @@ $gobin = "$(go env GOPATH)\bin"

Verify: `tuirec --version`

Or download a binary from [GitHub Releases](https://github.com/gui-cs/tuirec/releases). Release archives include a pinned, sixel- and Kitty-graphics-capable `agg` binary (`tig/agg v1.11.0-sixel`) next to `tuirec`, and the CLI auto-detects that sibling binary before falling back to `PATH`.
Or download a binary from [GitHub Releases](https://github.com/tui-cs/tuirec/releases). Release archives include a pinned, sixel- and Kitty-graphics-capable `agg` binary (`tig/agg v1.11.0-sixel`) next to `tuirec`, and the CLI auto-detects that sibling binary before falling back to `PATH`.
Homebrew and Scoop manifests are planned after the first release automation pass.

**Prerequisite for source builds:** [agg](https://github.com/tig/agg) `v1.11.0-sixel` — a fork of asciinema/agg that renders sixel and Kitty graphics — renders casts to GIFs. tuirec **auto-downloads `agg`** on first use if it's not found on PATH or in the local cache (`~/.cache/tuirec/agg-v1.11.0-sixel/` on Unix, `%LOCALAPPDATA%\tuirec\agg-v1.11.0-sixel\` on Windows). You can also pass `--agg-path` explicitly.
Expand Down Expand Up @@ -198,6 +198,6 @@ tuirec opencli # machine-readable command schema (OpenCLI draft spec)
```

If tuirec is not installed, download it from
[GitHub Releases](https://github.com/gui-cs/tuirec/releases) — archives
[GitHub Releases](https://github.com/tui-cs/tuirec/releases) — archives
include both `tuirec` and `agg`. See [`llms.txt`](llms.txt) for a
machine-readable project summary.
4 changes: 2 additions & 2 deletions agent/RECORDING-AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ A keystroke script is a **comma-separated** string. Each token is one of:
a sixel-aware `agg`. Caveats: **not on Windows** (ConPTY strips sixel DCS —
record on Linux/macOS); pass **`--trim=false`** for alternate-screen apps; and
the advertised sixel cell resolution may **not** equal `agg`'s rendered font
cell ([#84](https://github.com/gui-cs/tuirec/issues/84)), so a raster sized
cell ([#84](https://github.com/tui-cs/tuirec/issues/84)), so a raster sized
`cells × reportedResolution` can render a few percent undersized — verify size
by measurement (see below), do not assume it fills. To record a Terminal.Gui
sixel scenario (e.g. UICatalog's `Mandelbrot`), launch the scenario directly
Expand All @@ -139,7 +139,7 @@ A keystroke script is a **comma-separated** string. Each token is one of:
pixel-faithful render of a raster built from the wrong cell size is still wrong,
and a ~4% error is invisible by sight. Because the advertised cell resolution
may not match `agg`'s rendered font cell
([#84](https://github.com/gui-cs/tuirec/issues/84)), a sixel sized
([#84](https://github.com/tui-cs/tuirec/issues/84)), a sixel sized
`cells × reportedResolution` can come out undersized. The invariant to check is
*does the rendered sixel cover the cells it was meant to cover, in position and
size?* — verify it with arithmetic: extract a frame, measure `agg`'s real cell
Expand Down
4 changes: 2 additions & 2 deletions agent/record-app.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

Output goes to artifacts/ by default. If tuirec or agg are not on PATH,
they are automatically downloaded from
https://github.com/gui-cs/tuirec/releases and installed into ~/tools.
https://github.com/tui-cs/tuirec/releases and installed into ~/tools.

See agent/RECORDING-AGENT.md for the keystroke syntax reference and
guidance on composing keystroke scripts.
Expand Down Expand Up @@ -139,7 +139,7 @@ function Install-tuirecTools {
$null = New-Item -ItemType Directory -Force -Path $ToolsDir

$asset = Get-tuirecAssetName
$url = "https://github.com/gui-cs/tuirec/releases/download/v${tuirecVersion}/${asset}"
$url = "https://github.com/tui-cs/tuirec/releases/download/v${tuirecVersion}/${asset}"
$tempFile = Join-Path ([System.IO.Path]::GetTempPath()) $asset

Write-Host "Downloading tuirec v${tuirecVersion}: $url"
Expand Down
22 changes: 11 additions & 11 deletions artifacts/hero.cast

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cmd/tuirec/agent-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ A keystroke script is a **comma-separated** string. Each token is one of:
a sixel-aware `agg`. Caveats: **not on Windows** (ConPTY strips sixel DCS —
record on Linux/macOS); pass **`--trim=false`** for alternate-screen apps; and
the advertised sixel cell resolution may **not** equal `agg`'s rendered font
cell ([#84](https://github.com/gui-cs/tuirec/issues/84)), so a raster sized
cell ([#84](https://github.com/tui-cs/tuirec/issues/84)), so a raster sized
`cells × reportedResolution` can render a few percent undersized — verify size
by measurement (see below), do not assume it fills. To record a Terminal.Gui
sixel scenario (e.g. UICatalog's `Mandelbrot`), launch the scenario directly
Expand All @@ -139,7 +139,7 @@ A keystroke script is a **comma-separated** string. Each token is one of:
pixel-faithful render of a raster built from the wrong cell size is still wrong,
and a ~4% error is invisible by sight. Because the advertised cell resolution
may not match `agg`'s rendered font cell
([#84](https://github.com/gui-cs/tuirec/issues/84)), a sixel sized
([#84](https://github.com/tui-cs/tuirec/issues/84)), a sixel sized
`cells × reportedResolution` can come out undersized. The invariant to check is
*does the rendered sixel cover the cells it was meant to cover, in position and
size?* — verify it with arithmetic: extract a frame, measure `agg`'s real cell
Expand Down
4 changes: 2 additions & 2 deletions cmd/tuirec/e2e_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"testing"
"time"

"github.com/gui-cs/tuirec/pkg/gif"
pngrenderer "github.com/gui-cs/tuirec/pkg/png"
"github.com/tui-cs/tuirec/pkg/gif"
pngrenderer "github.com/tui-cs/tuirec/pkg/png"
)

func TestRecordCommandEndToEndGIF(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions cmd/tuirec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"strings"
"time"

"github.com/gui-cs/tuirec/pkg/gif"
"github.com/gui-cs/tuirec/pkg/keystroke"
pngrenderer "github.com/gui-cs/tuirec/pkg/png"
"github.com/gui-cs/tuirec/pkg/pointer"
"github.com/gui-cs/tuirec/pkg/pty"
"github.com/gui-cs/tuirec/pkg/record"
"github.com/tui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/pkg/keystroke"
pngrenderer "github.com/tui-cs/tuirec/pkg/png"
"github.com/tui-cs/tuirec/pkg/pointer"
"github.com/tui-cs/tuirec/pkg/pty"
"github.com/tui-cs/tuirec/pkg/record"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
Expand Down
6 changes: 3 additions & 3 deletions cmd/tuirec/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"testing"
"time"

"github.com/gui-cs/tuirec/pkg/gif"
pngrenderer "github.com/gui-cs/tuirec/pkg/png"
"github.com/gui-cs/tuirec/pkg/record"
"github.com/tui-cs/tuirec/pkg/gif"
pngrenderer "github.com/tui-cs/tuirec/pkg/png"
"github.com/tui-cs/tuirec/pkg/record"
)

func TestRecordCommandParsesFlags(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions examples/record-pipeline/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os/exec"
"time"

"github.com/gui-cs/tuirec/examples/internal/demoagg"
"github.com/gui-cs/tuirec/pkg/gif"
"github.com/gui-cs/tuirec/pkg/pty"
"github.com/gui-cs/tuirec/pkg/record"
"github.com/tui-cs/tuirec/examples/internal/demoagg"
"github.com/tui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/pkg/pty"
"github.com/tui-cs/tuirec/pkg/record"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/render-gif/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"
"time"

"github.com/gui-cs/tuirec/examples/internal/demoagg"
"github.com/gui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/examples/internal/demoagg"
"github.com/tui-cs/tuirec/pkg/gif"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/gui-cs/tuirec
module github.com/tui-cs/tuirec

go 1.22

Expand Down
8 changes: 4 additions & 4 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ agg. No manual screen recording, no browser-based tools.

## Install

Download a release archive from https://github.com/gui-cs/tuirec/releases
(includes tuirec + a sixel-capable agg). Or: `go install github.com/gui-cs/tuirec/cmd/tuirec@latest`
Download a release archive from https://github.com/tui-cs/tuirec/releases
(includes tuirec + a sixel-capable agg). Or: `go install github.com/tui-cs/tuirec/cmd/tuirec@latest`
and install agg separately (the sixel-capable fork: https://github.com/tig/agg).

## Quick start
Expand Down Expand Up @@ -52,7 +52,7 @@ The guide covers:

## Links

- Repository: https://github.com/gui-cs/tuirec
- Releases: https://github.com/gui-cs/tuirec/releases
- Repository: https://github.com/tui-cs/tuirec
- Releases: https://github.com/tui-cs/tuirec/releases
- Agent guide (in-repo): agent/RECORDING-AGENT.md
- Spec: spec.md
2 changes: 1 addition & 1 deletion pkg/png/png.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"strings"
"time"

"github.com/gui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/pkg/gif"
)

// ErrValidation indicates that a rendered PNG failed validation.
Expand Down
2 changes: 1 addition & 1 deletion pkg/png/png_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"runtime"
"testing"

"github.com/gui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/pkg/gif"
)

func TestParseFrameSelection(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/pty/session_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/gui-cs/tuirec/pkg/pty"
"github.com/tui-cs/tuirec/pkg/pty"
)

func TestSessionRunsTestappAndQuitsWithCtrlQ(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/record/calibrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"math"

"github.com/gui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/pkg/gif"
)

// alignTolerancePx is the largest per-column rounding error tolerated before the
Expand All @@ -13,7 +13,7 @@ import (
// 16t) are integers, so an app that sizes a sixel raster as cells × reportedCell
// underfills by (advance − round(advance)) per column. At ~0.15px that residual
// is well under a third of a cell across a full-width image; beyond it the gap
// becomes visible (see gui-cs/tuirec#84).
// becomes visible (see tui-cs/tuirec#84).
const alignTolerancePx = 0.15

// cellRoundingErr is how far agg's per-column advance at fontSize is from the
Expand Down Expand Up @@ -78,7 +78,7 @@ func alignLineHeight(fontSize int, requestedLineHeight float64) (cellH int, aggL
// integer cell size to report to sixel queries. This replaces a static
// advance-ratio guess (which is wrong for whatever font agg resolves on the
// host) with a measurement, and aligns the grid so apps that size rasters as
// cells × reportedCell fill exactly (gui-cs/tuirec#84). The returned Config has
// cells × reportedCell fill exactly (tui-cs/tuirec#84). The returned Config has
// FontSize/LineHeight adjusted for rendering; changed reports whether the
// font-size moved from the request.
func calibrateGeometry(ctx context.Context, gifCfg gif.Config) (adjusted gif.Config, cellW, cellH int, changed bool, err error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/record/calibrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math"
"testing"

"github.com/gui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/pkg/gif"
)

func TestAlignFontSize(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions pkg/record/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"unicode"
"unicode/utf8"

"github.com/gui-cs/tuirec/pkg/gif"
"github.com/gui-cs/tuirec/pkg/keystroke"
"github.com/gui-cs/tuirec/pkg/pointer"
"github.com/gui-cs/tuirec/pkg/pty"
"github.com/gui-cs/tuirec/pkg/recorder"
"github.com/tui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/pkg/keystroke"
"github.com/tui-cs/tuirec/pkg/pointer"
"github.com/tui-cs/tuirec/pkg/pty"
"github.com/tui-cs/tuirec/pkg/recorder"
)

const (
Expand Down Expand Up @@ -89,7 +89,7 @@ type Result struct {
// This is a fallback estimate. When a GIF is rendered, Run replaces it with a
// measured, grid-aligned cell via calibrateGeometry, because the 0.6 column
// ratio is wrong for whatever font agg actually resolves on the host and a
// fractional advance cannot be reported as an integer cell (gui-cs/tuirec#84).
// fractional advance cannot be reported as an integer cell (tui-cs/tuirec#84).
func sixelGeometry(size pty.Size, gifConfig gif.Config) (cols, rows, cellW, cellH int) {
size = pty.NormalizeSize(size)
gifConfig = gif.NormalizeConfig(gifConfig)
Expand Down Expand Up @@ -151,7 +151,7 @@ func Run(parent context.Context, config Config) (Result, error) {

// Compute the sixel cell geometry to report and, when a GIF will be rendered,
// calibrate it against the cell agg actually renders so the integer cell
// report matches it exactly (gui-cs/tuirec#84). This runs BEFORE the
// report matches it exactly (tui-cs/tuirec#84). This runs BEFORE the
// MaxDuration context is created so the agg probe-render time is not charged
// against the recording budget — otherwise a short MaxDuration would
// spuriously trip "recording hit max duration". Falls back to the formula
Expand Down
6 changes: 3 additions & 3 deletions pkg/record/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"testing"
"time"

"github.com/gui-cs/tuirec/pkg/gif"
"github.com/gui-cs/tuirec/pkg/pty"
"github.com/gui-cs/tuirec/pkg/recorder"
"github.com/tui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/pkg/pty"
"github.com/tui-cs/tuirec/pkg/recorder"
)

const floatTolerance = 1e-6
Expand Down
6 changes: 3 additions & 3 deletions pkg/record/sixel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"testing"
"time"

"github.com/gui-cs/tuirec/pkg/gif"
"github.com/gui-cs/tuirec/pkg/pty"
"github.com/gui-cs/tuirec/pkg/recorder"
"github.com/tui-cs/tuirec/pkg/gif"
"github.com/tui-cs/tuirec/pkg/pty"
"github.com/tui-cs/tuirec/pkg/recorder"
)

// A minimal sixel DCS payload: ESC P q <data> ESC \
Expand Down
6 changes: 3 additions & 3 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Rewrite tuirec as a **cross-platform Go CLI** that records any terminal app and
| PTY driver deps | `pkg/pty` may import `github.com/creack/pty` (Unix) + `github.com/UserExistsError/conpty` (Windows) | Resolves the constitution R1 conflict; amended to R1 v1.1. Hand-rolling `forkpty`/ConPTY is out of scope |
| Windows ConPTY library | `github.com/UserExistsError/conpty` | Resolves CLAUDE.md open decision #1. The previously-referenced `iamacarpet/go-conpty` **does not exist** as a module. `UserExistsError/conpty` builds and passes on Windows — proven by the Phase 1 spike (PR #3) |
| Windows in v1 | **In scope — folded back into Phase 1** (not a deferred spike) | PR #3 is the spike evidence: ConPTY works. Cross-platform PTY is a Phase 1 deliverable again. The only Windows item still deferred is agg-on-Windows in CI for full-GIF integration |
| Module path | `github.com/gui-cs/tuirec` (exact case) | Go import paths are case-sensitive; must match `go.mod`, README, and `.goreleaser.yaml` |
| Module path | `github.com/tui-cs/tuirec` (exact case) | Go import paths are case-sensitive; must match `go.mod`, README, and `.goreleaser.yaml` |
| agg distribution | Bundle pinned `agg v1.11.0-sixel` in release archives and support source-build prerequisites | Release archives include a sibling `agg` binary that tuirec auto-detects before PATH. `go install`/local builds still require `agg` on PATH or `--agg-path`. Upstream does not publish a native Windows ARM64 asset for `v1.11.0-sixel`; Windows ARM64 archives include the x64 Windows binary for OS emulation, or users can build `agg` from source and pass `--agg-path` |
| Recording clock | Support a deterministic (scripted) clock in addition to wall-clock | Wall-clock timing makes GIFs non-reproducible and CI flaky; scripted timing enables golden-GIF regression |

Expand Down Expand Up @@ -173,7 +173,7 @@ tuirec record \
| `os/exec` | Invoke agg | |
| (stdlib) | JSON, time, IO | asciinema recorder is ~50 lines |

**Canonical module path:** `github.com/gui-cs/tuirec` (exact case — Go
**Canonical module path:** `github.com/tui-cs/tuirec` (exact case — Go
import paths are case-sensitive). `go.mod` must declare exactly this.

### Module structure:
Expand Down Expand Up @@ -359,7 +359,7 @@ row and no Unix-only fallback.

| Method | Command | Platform |
|--------|---------|----------|
| Go install | `go install github.com/gui-cs/tuirec/cmd/tuirec@latest` | Any (requires Go) |
| Go install | `go install github.com/tui-cs/tuirec/cmd/tuirec@latest` | Any (requires Go) |
| Binary download | GitHub Releases page; archives include `tuirec` + pinned `agg` | Any |
| Homebrew | Planned after tap repo + token setup | macOS, Linux |
| Scoop | Planned after bucket repo + token setup | Windows |
Expand Down
2 changes: 1 addition & 1 deletion specs/constitution.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Version**: 1.2 | **Ratified**: 2026-05-19 | **Last Amended**: 2026-05-19

This constitution governs all contributions to `gui-cs/tuirec`. It is the highest-authority document in the repository — PRs that violate it are rejected with a link to the specific rule.
This constitution governs all contributions to `tui-cs/tuirec`. It is the highest-authority document in the repository — PRs that violate it are rejected with a link to the specific rule.

---

Expand Down
Loading