Visual editing for Astro, with no second source of truth A developer has released @sudodevstudio/astro-ai, an open-source Astro integration that enables visual editing directly on source files, eliminating the need for a separate CMS or editor-specific format. The tool uses deterministic source-range edits for simple changes and optionally integrates AI agents like Codex or Claude for complex requests, ensuring visual edits appear in the same diffs as manual ones. Most visual editors for static sites ask for the same trade. Content moves into a CMS, layout moves into an editor-specific format, and your .astro files become a rendering target instead of the thing you edit. I built @sudodevstudio/astro-ai https://github.com/SudoDevStudio/astro-ai to avoid that trade. It is a development-only Astro integration. You select an element on the rendered page, and the edit is written to the source file that produced it. A separate authoring system is a reasonable choice for some projects. Editorial workflows and non-technical authors need an architecture built for them. For a site already maintained through code, a second representation adds a standing question: does a manual edit survive the next visual one, and which representation wins when they disagree? I wanted visual edits and manual edits to operate on the same source files, with no separate representation to reconcile. A visual edit is an ordinary source change. It shows up in the same diff and the same pull request as an edit you typed. That constraint works in both directions. Before the editor offers an operation on the rendered page, it has to establish that the source can express it. A good part of this post is about the operations it declines. npm install --save-dev @sudodevstudio/astro-ai python // astro.config.mjs import { defineConfig } from 'astro/config'; import buildWithAI from '@sudodevstudio/astro-ai'; export default defineConfig { integrations: buildWithAI { agent: 'codex' } , // or 'claude' } ; Start the dev server, open Build with AI in Astro's dev toolbar, and select an element. The AI provider is optional. Call buildWithAI with no agent to get deterministic editing alone. For AI requests, authenticate the CLI first with codex login , or launch claude and complete its login flow. Editing a heading produces this: --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1 +1 @@ -