Skip to content
← Oleksii Turovskyi
ReleasedUtilityv1.0.1GPL-2.0-or-later

AI Dev Assistant

A chat panel in wp-admin that reads your code, queries the database and edits files - with every change it makes kept in a git history you can revert.

  • Chat with Anthropic, OpenAI, Gemini or a local Ollama model without leaving wp-admin
  • 20 tools from one registry - files, read-only SQL, PHP, plugins, Abilities API, navigation
  • Every file the AI touches gets a git commit you can diff, revert, reapply or export as a .patch
  • Your API keys stay in your browser, not in the WordPress database
Install instructions ↓
WordPress
6.0+
PHP
7.4+
Dependencies
None

The problem

Asking an AI model about a WordPress site usually means copying files into a chat window, pasting the answer back over FTP or SSH, and hoping you remember what you changed. The model never sees the real wp-config.php, the real plugin list or the real database, so half of its answer is a guess about a site it cannot look at.

AI Dev Assistant puts the chat inside wp-admin, next to Help and Screen Options, and gives the model tools to look at the site itself: read a file, list the installed plugins, run a SELECT, open a page and read its HTML. When it changes something, the change goes into a git history, so "what did the AI do to my theme" always has an answer.

What it does today

Four providers, one chat. Anthropic, OpenAI (through the Responses API, so reasoning models can call tools), Gemini, and a local model through Ollama. You bring your own API key; the model is chosen per provider.

The model is called from your browser, not from PHP. This is the decision the rest of the plugin is built around. Because the request leaves your browser, a model running in Ollama on your own localhost works even when WordPress is hosted somewhere else - a server-side call would look for localhost:11434 on the server. It also means your API keys live in your browser's localStorage, not in wp_options. The browser runs the tool loop too: it asks you to confirm an action, executes it through an AJAX call, and sends the result back to the model.

20 tools from one registry. Every tool is declared once in PHP, with its schema, its permission level and its confirmation policy, and both the settings page and the chat read that list:

  • File reading: read_file, list_directory, search_files, search_content
  • File writing: write_file, edit_file, delete_file
  • Database: db_query, which accepts SELECT only
  • WordPress: get_plugins, get_themes, install_plugin, run_php
  • Abilities API: list_abilities, get_ability, execute_ability
  • Navigation and the page: navigate, get_page_html
  • Conversation: summarize_conversation, list_skills, get_skill

Seven of them are marked dangerous: the three file-writing tools, install_plugin, run_php and execute_ability. Each asks for confirmation before it runs, unless you tick YOLO mode.

Every change is tracked in git. When the AI creates or edits a file in a plugin or theme, that plugin or theme gets its own .git directory, written by the plugin in plain PHP - no git binary on the server. The original file is the main branch; each AI edit is a commit on ai-changes with a message saying why it was made. Tools → AI Changes shows the diffs and lets you revert a file or a commit, reapply what you reverted, export changes as a .patch file and import a patch from elsewhere. A modified plugin also gets a "Download ZIP" link on the Plugins screen.

PHP is checked before it is written. write_file and edit_file parse a PHP file first and refuse to write one with a syntax error, so the most common way an AI edit takes a site down never reaches the disk.

Conversations are kept. Each conversation is stored as a custom post type and gets an AI-generated title; you find them under Tools → AI Conversations. A summary is generated on request and saved with the conversation, and the model can pull up the summary of an earlier conversation itself through summarize_conversation, so a new chat can start from what an old one found.

What the chat may do on a live site

On a regular WordPress install the chat starts read-only. The seven dangerous tools are switched off until an administrator enables them in Settings → AI Assistant → Tool Permissions, so a fresh install can read files and query the database but cannot write a file or run PHP.

Access is set per role through three capabilities: ai_assistant_full (every enabled tool), ai_assistant_read_only (only the reading tools) and ai_assistant_chat_only (the chat with no tools at all).

Inside WordPress Playground the plugin detects the in-browser environment and enables all 20 tools at once. Playground is the comfortable place to let the AI write code: nothing there is a production site, and when you download the Playground as a zip, each touched plugin and theme carries its git history, so git log ai-changes works on your own machine.

Where it stands

Released at v1.0.1 (2026-11-14). That release moved the chat onto four provider adapters behind one interface and one canonical transcript format, so a conversation saved with one provider still loads after the internals changed, and it added self-hosted updates.

Install

  1. Download the zip from the button at the top of this page.
  2. In wp-admin → Plugins → Add New → Upload Plugin, choose the zip and click Install Now, then activate.
  3. Open Settings → AI Assistant, choose a provider and a model, and enter your API key - or the address of your Ollama server, http://localhost:11434 by default.
  4. On a live site, decide which of the dangerous tools to enable under Tool Permissions on the same page.
  5. Open the AI Assistant tab at the top of any admin screen, next to Help and Screen Options, and start chatting.

Once installed, the plugin checks for updates on my own update server and shows them in the usual wp-admin → Plugins screen.

Stack

  • WordPress 6.0+, PHP 7.4+
  • Plain JavaScript, no framework and no npm dependencies; the provider adapters, the transcript format and the tool loop are separate modules
  • Tool registry in PHP (Tools::registry()) as the single source of truth for schemas and confirmation policy
  • Git objects and index written by PHP (sha1 + gzcompress), one repository per plugin or theme
  • Conversations in a custom post type, summaries in post_excerpt
  • yahnis-elsts/plugin-update-checker v5 for self-hosted updates
  • Tests: PHPUnit for the PHP side, node:test for the JavaScript modules

FAQ

Does it work outside WordPress Playground?

Yes. It runs on any WordPress 6.0+ site with PHP 7.4+. Outside Playground the tools that write files, run PHP or install plugins start switched off, and an administrator enables the ones they want in Settings → AI Assistant → Tool Permissions.

Where are my API keys stored?

In your browser's localStorage, not in the WordPress database. The chat calls the provider directly from the browser, so the keys never pass through the WordPress server. The flip side is that each browser you use needs the key entered once.

Can I use a local model instead of a paid API?

Yes, through Ollama. Because the model is called from your browser, the Ollama server on your own machine is reachable even when WordPress runs on a remote host. The default endpoint is http://localhost:11434 and can be changed in the settings.

How do I undo something the AI changed?

Open Tools → AI Changes. Every file the AI created or edited is listed with its diff, and you can revert one file or a whole commit. Reverted changes stay on the ai-changes branch, so you can reapply them later.

Can the AI change the database?

Not through SQL. db_query accepts SELECT statements only and refuses anything else. run_php can do whatever PHP can, which is why it is marked dangerous, asks for confirmation and is off by default on a regular site.

What happens if the AI breaks the site?

A PHP file with a syntax error is refused before it is written. If a change still breaks WordPress, the chat notices several failed requests in a row and warns you while the current page still works; revert the change in Tools → AI Changes. In Playground, its Recovery Mode boots a broken site far enough to open AI Changes and revert the culprit.

View as Markdown · for AI agents and offline reading

Other plugins

Other tools

Not a WordPress site? I also ship Chrome extensions — small browser utilities for SEO, AI workflows, and research.