@vitest-agent/sidecar
v1.0.2
Published
Fast-path native binary for vitest-agent. Ships a Node SEA executable that handles the per-Bash-call inject-env hot path.
Maintainers
Readme
@vitest-agent/sidecar
Part of the vitest-agent ecosystem. Most users want @vitest-agent/plugin, which pulls this package in automatically (it installs automatically with the CLI; you rarely add it directly).
A Node Single Executable Application (SEA) binary for the per-Bash-call inject-env hot path. Every Bash tool call from a Claude Code agent fires the plugin's pre-tool-use/bash.sh hook, which detects Vitest invocations and prepends the canonical VITEST_AGENT_* env prefix. Running that through the full vitest-agent CLI pays Node cold-start latency on every call; this binary runs the same logic with a fraction of the startup cost.
Features
- Native binary — Node SEA wrapping the same
inject-envTypeScript that ships in@vitest-agent/cli; JS fallback and binary stay byte-identical - Per-platform sub-packages —
@vitest-agent/sidecar-darwin-arm64,@vitest-agent/sidecar-linux-arm64,@vitest-agent/sidecar-linux-x64,@vitest-agent/sidecar-win32-x64asoptionalDependencies; only the matching one installs resolveSidecarBinaryPath()— exported function that returns the absolute path of the installed binary, ornullon unsupported platforms
Install
npm install --save-dev @vitest-agent/plugin
# @vitest-agent/sidecar arrives transitively through @vitest-agent/cliThe plugin's SessionStart hook resolves the binary path once per session via vitest-agent agent sidecar-path and exports VITEST_AGENT_SIDECAR_BIN. The PreToolUse Bash hook reads that env var and execs the binary directly — no PATH lookup, no Node startup. On unsupported platforms the hook falls back to the vitest-agent JS CLI automatically.
Documentation
Package reference at vitest-agent.dev/sidecar.
