Sign inBlogSupportContact
AI

Describe what you need. AI writes the WordPress command.

Plain-English intent in, a working custom command out — PHP handler plus JavaScript renderer, saved to disk, runnable from the navigator. No hiring a developer for a three-line script.

4 min read May 2026 ai generate command

Every site has a dozen one-off commands nobody wants to write

"Export all orders from last week as CSV." "List every user who hasn't logged in for 90 days." "Toggle this one option on and off." Each is a five-minute PHP snippet — if you know WordPress well enough to write it. If you don't, it's a ticket to a developer, a cost estimate, a round-trip review, and three weeks of waiting for a task the site owner could have done in a minute given the right interface.

What most people do instead

Hire a developer for every micro-taskEvery little query becomes a ticket. Over a year, you pay four-figure invoices for commands that are thirty lines of code.
Paste prompts into external AI toolsYou get code, then spend an hour wiring it into a plugin, setting up an AJAX endpoint, building the UI to run it. All overhead.
Shop for a plugin that almost fitsInstall three plugins hoping one does your thing. None does exactly. Now you're debugging plugin conflicts instead of running your task.

A better way: name it, describe it, ship it

Run ai generate command -name="export orders" -context="Create a command that exports last 30 days of orders as CSV with customer name, total, and status". AI returns exactly two code blocks — PHP for the handle($data) body and JavaScript for the response renderer. TrueCommander saves both to uploads/trc/commands/, registers the new command, and it's immediately runnable from the navigator.

TrueCommander
Command generated
Saved to disk, registered in navigator
Name: export orders
PHP handler: 28 lines
JS renderer: 9 lines
Try it: tp export ordersready

Admin-only, by design. The command writes executable PHP to your uploads folder, so the guard is stricter than other AI commands — manage_options required even if you've granted AI access to other roles. The generated file also gets an ABSPATH exit guard prepended and .htaccess protection on its parent directory.

How it works

Your name and context are sanitized, interpolated into a strict prompt template that tells the AI the exact wrapper class/method structure, the output format (two fenced code blocks), and the WordPress-function conventions to follow. The response is parsed, each block is written to the appropriate file (PHP to command_{id}.php, JS to the matching renderer), and the custom command is registered under the name you provided.

1
Name and describe the commandKeep the name short (it becomes the navigator invocation). Describe the intent in a sentence or two.
2
AI returns PHP + JS code blocksPHP goes into the handle body. JS renders the response. Strict format — no wrapper boilerplate.
3
Command is immediately runnableFile saved, registered in the custom commands table, show up in the navigator search on the next open.
ParameterValue
-name(required)Command name — how you'll invoke it (tp your-name)
-context(required)Plain-English description of what the command should do
OutputPHP handler + JS renderer, saved to uploads/trc/commands/
Permissionsmanage_options required — stricter than other AI commands because executable PHP gets written to disk
AI providerTrueCommander's server-side proxy — no API key required, no provider choice
Can be used in

Real example

You manage a WooCommerce store and want a weekly view of which customers haven't reordered in 60 days — for a reactivation campaign. You open the navigator and run ai generate command -name="stale customers" -context="List customers whose last order is older than 60 days. Return email, full name, and days since last order. Sort by days descending. Show the first 50."

AI writes 35 lines of PHP (WP_User_Query + meta filtering on _last_order_date) and 12 lines of JS (table output with email and days-since columns). The command is now called stale customers. Next time you want the list, you type tp stale customers — no prompt, no AI call, just your stored command running against your live data.

Goes further with TrueCommander

Ready?

Describe it. AI ships it.

This is one of 91 commands. All included with every license.

Cookies. The short version.

Essential cookies keep the cart and theme working. Analytics only fire if you say yes. Read our policy.