Developer releases 'onwrite' to auto-format files written by scripts and AI agents
A developer has released onwrite, an open-source tool that brings format-on-save functionality to code generators, shell scripts, and AI coding agents — environments where editors like VS Code cannot intervene. The tool detects existing formatter configurations already present in a repository, such as Prettier, Ruff, or gofmt, and runs them automatically on files the moment they are written. For safety, onwrite never modifies source files directly; it pipes content through formatters via stdin/stdout and only replaces the file atomically if the full formatter chain succeeds. It also includes a watcher mode for processes that cannot be wrapped, a diagnostic command for transparency, and a hook for AI agents like Claude Code to re-read files after formatting changes them. Released as v0.1.0 under the MIT license, onwrite is available for macOS, Linux, and Windows, with install scripts and binaries hosted on GitHub.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in