workspace-watch

command
v0.6.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

workspace-watch

workspace-watch demonstrates github.com/tmc/apple/x/fswatch, a zero-cgo Darwin FSEvents wrapper with event coalescing, debouncing, typed event flags, and gitignore-style path filtering for live RAG re-indexing, coding-agent workspace triggers, and Metal shader hot-reload.

Running

Self-contained demo (default when no directories are passed):

CGO_ENABLED=0 go run ./examples/coreservices/workspace-watch -demo

Watch one or more directories live:

CGO_ENABLED=0 go run ./examples/coreservices/workspace-watch -latency 15ms -debounce 150ms .

Measured output

Measured on Apple M4 Max, macOS 26.6.2 (CGO_ENABLED=0 go run ./examples/coreservices/workspace-watch -demo):

workspace-watch demo
workspace: /private/var/folders/.../T/workspace-watch-demo-...
options:   latency=15ms debounce=150ms ignoreDotGit=true ignore=[build/ node_modules/ *.tmp]

  [burst] Created|IsDir            kernels
  [burst] Created|Modified|Renamed|IsFile src/agent.go
  [burst] Removed|Renamed|IsFile   src/agent_v2.go
  [coalesce] Created|Modified|IsFile kernels/attention.metal

summary:
  ignored writes filtered: 4/4 (leaked=0)
  rapid edits coalesced:   10 writes -> 1 delivered event(s)
  delivery latency (12 samples): min=2.98ms p50=12.81ms p95=84.40ms max=84.40ms

Verification

CGO_ENABLED=0 go vet ./x/fswatch ./examples/coreservices/workspace-watch
CGO_ENABLED=0 go test -v -count=1 ./x/fswatch ./examples/coreservices/workspace-watch
go test -race -v -count=1 ./x/fswatch ./examples/coreservices/workspace-watch

Documentation

Rendered for darwin/amd64

Overview

Command workspace-watch demonstrates github.com/tmc/apple/x/fswatch for live workspace triggers (RAG re-indexing, coding-agent watches, Metal shader hot-reload).

In -demo mode (the default when no directories are passed), it creates a temporary workspace, exercises create/modify/rename/delete events alongside ignored .git and build writes, verifies coalescing of rapid edits, and reports FSEvents delivery latency (p50/p95 in ms).

Passing one or more directory arguments watches those directories live until interrupted or -duration elapses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL