Tuesday, July 15, 2025

SPExAI GPT: SPE Script Generation, No Module Required

Earlier this year, I built SPExAI Report Builder during the 2025 Sitecore Hackathon, a natural language interface for generating Sitecore PowerShell Extensions (SPE) reports. The concept was simple: use plain English to get real, working scripts. The result? A winning module that turned heads and saved hours. 🙌

But what if your team loves the idea but doesn’t have the time, access, or appetite to install a custom module? Perhaps you just need a script now and then. Or maybe you're working in an environment with limited Sitecore customization privileges.

It would be great if you didn't need to rely on installing a module into your Sitecore instance to benefit from this technology. 


✨ Introducing SPExAI GPT

Introducing a new flavor of SPExAI; not as a Sitecore module, but as a custom GPT. It works entirely outside of Sitecore. No installs. No packages. No patch configs. Just a prompt box and your imagination.

Your prompt:

"Report of all templates (ID, Name, Path) and their usage count."

And SPExAI (the GPT version) responds with a fully working script.  Same quality, same intelligence, now universally accessible.



Simply copy the output, paste it into the Sitecore PowerShell ISE, and run it:


Results!



One benefit you get with the SPExAI GPT over the SPExAI module is that you can continue your chat, which isn't available in v1 of the SPExAI (it's all one-shot), allowing you to prompt beyond your initial prompt.  This is great for getting help with fixing errors you may encounter when using the initially generated script, or even for enhancing an existing script.

🧠 Under the Hood

The GPT version builds on the same core ideas as the Hackathon module:

  • 🔍 A system prompt trained to interpret natural-language Sitecore requests and produce accurate PowerShell reports.

  • 📚 A curated knowledgebase of common SPE scripting patterns tailored to tasks like item audits, rendering usage, field value searches, and more.

  • ⚙️ Designed to speak "Sitecore" fluently, not just ChatGPT syntax, but the nuances of $SitecoreContext, $item.Paths.FullPath, Get-Item, and all the other familiar constructs.

I've adapted the system prompt to better align with ChatGPT’s structure, ensuring cleaner completions, improved formatting, and fewer hallucinations.


🚀 Try It Yourself

If you're looking to generate SPE scripts without touching your Sitecore instance, this GPT-based version might be the way to go. Whether you're prototyping, documenting, or training a team, it removes friction and delivers fast results.

You can find the SPExAI GPT on the Chat GPT store by selecting GPTs in the left-hand panel of ChatGPT, then searching for `spexai`:



You can also access SPExAI GPT directly using this link:

If you use it, please take a moment to leave a rating. 
If you have suggestions for improving the GPT, I'm open to them! 😀

0 comments:

Post a Comment