vite-plugin-agent-tail
v0.3.5
Published
Vite plugin for agent-tail — pipes browser console logs to files on disk during development.
Maintainers
Readme
vite-plugin-agent-tail
Vite plugin for agent-tail — captures browser console.log, console.warn, console.error, unhandled errors, and unhandled promise rejections to log files on disk during development.
Tip: Install the umbrella
agent-tailpackage to get the CLI, Vite plugin, and Next.js plugin in one install:npm install -D agent-tail
Install
npm install -D agent-tailSetup
// vite.config.ts
import { defineConfig } from "vite"
import { agentTail } from "agent-tail/vite"
export default defineConfig({
plugins: [agentTail()],
})Then in another terminal:
tail -f tmp/logs/latest/browser.logHow it works
The plugin injects a small script into your HTML that intercepts console methods, batches the output, and sends it to the dev server via sendBeacon. Logs are written to a timestamped session directory with a latest symlink for easy access.
Pair with the CLI
Use both the plugin and the CLI to get browser console logs and server output in one place:
agent-tail run 'fe: npm run dev' 'api: uvicorn main:app'Docs
Full documentation and configuration options at agent-tail.vercel.app
License
MIT
