Sign inDocsBlogAboutSupportContact
AI

Describe what you need. AI writes the WordPress command.

Describe the task in plain English. AI drafts a PHP handler and JavaScript renderer, then saves a disabled Custom Command for administrator review.

4 min read May 2026 ai generate command

Interface examples use sample data. Results, counts, and timing vary by site and configuration.

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, review it

Run tp 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 a disabled Custom Command for an administrator to inspect, edit and enable.

TrueCommander
Command generated
Saved as a disabled draft
Name: export orders
PHP handler: 28 lines
JS renderer: 9 lines
Review it in Custom Commandsdisabled

Shown in advanced mode, where commands start with tp. In easy mode you type the same command without the tp prefix.

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
Review and enable the draftFiles and a disabled record are saved. An administrator reviews and enables the command before it can run.
ParameterValue
-name (required)What to call the new command (e.g. "export orders")
-context (required)Describe what the command should do, in plain language
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 tp 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 returns draft PHP and JS. Check the generated query, permissions and output before enabling the command. The result is a disabled Custom Command named stale customers. Review the generated PHP and JS, enable it, then run it from the navigator.

Goes further with TrueCommander

Frequently asked questions

Ready?

Describe it. AI ships it.

This is one of 100 command variants. Part of the TrueCommander package.

Cookies. The short version.

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