Back to News
RSS feedgithub.com

Texio Brings Structure-Aware Markdown Editing to Shell Scripts and AI Agents

Summary

Texio is an early-preview Rust command-line tool for shell scripts and AI agents that extracts and edits Markdown by document structure instead of relying on regular expressions or rewriting an entire file. It can list headings in JSON, extract a named section, and replace that section either from supplied text or another file. Changes can be previewed with `--dry-run` and applied explicitly with `--write`; content outside the target is preserved, while missing or duplicate headings cause an error rather than an ambiguous selection. The tool currently uses pulldown-cmark, supports ATX and Setext headings, and ignores heading-like text inside fenced code blocks. Replacements are atomic and preserve the target file's permissions. Texio is installable from crates.io with a stable Rust toolchain, while platform-specific binaries are available for Linux x86-64, Windows x86-64, Intel macOS, and Apple Silicon macOS. Its CommonMark and GitHub Flavored Markdown compatibility remains in progress. In a four-fixture benchmark, Texio passed all four cases and used 45 context-proxy tokens, compared with 261 for an idealized whole-file rewrite and 45 for the regex approach; the reported 82.8% saving is explicitly not a model-token or billing measurement. The repository presents the benchmark as reproducible and describes the project as an early preview with additional CLI and Markdown limitations documented.