Trying Codex
Part of the Building This Site series.
Until now I've been using the regular web-based free tier of ChatGPT to get me up and running. But I spotted on the OpenAI website that they were offering all free and Go users the chance to try out their specialist coding tool, Codex. I couldn't resist.
After installing Codex I gave it access to the local folder where I store my website and prompted it to review the code. A few seconds later it returned with an accurate summary and some suggested improvements. I was impressed but cautious - I didn't want it making any changes just yet.
Instead I set it a task:
I'd like to add an optional hero image to a post which displays on the post and in the home page grid. The image should always be constrained to a consistent size. Don't make any changes yet, just tell me what you'd do.
Straight away it came back with a simple plan of action involving some new front matter on the post itself, edits to the post and homepage template to render the hero image if it was provided and amendments to CSS to display the image in a similar style as was used elsewhere.
Showing commitment
And then I asked:
Can you implement this in a way that's easy to undo?
To which Codex offered to create and push a commit for the changes and provided me with instructions on how to undo the commit if required. I set it loose and a few seconds later I had exactly what I wanted, first time, no messing about and properly committed and pushed to Github. 🤯
Prompt suggestions
To wrap up my hero image session I decided to ask a different AI for some help with a proper hero image. This time I gave the free tier of Google Gemini the URL for my first blog post and asked it to come up with a prompt for use with Nano Banana to generate a suitable hero image.
It gave me a few promts to try which I fed into the machine then I picked the image you can see now. Again, this is something I would never have been able to create myself. I would probably have tried to find some free stock image instead.
Final thoughts
What I've been doing here is probably old hat to many people by now, but I'm really impressed. In about 2 weeks I've gone from having nothing to a fully working static website put together almost completely by AI. And all for free - I've not paid a single penny to generate anything that makes up this site.
This is the end of this series but I'll be continuing to iterate on the blog, style it up and add new features over time. I'm also looking into AI assisted app development and will post here about my progress with that too.
See you soon!