Ai Coding Tools

How to Achieve Automated Code Generation in Under 2 Hours

By BTW Team5 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step guide on leveraging AI coding tools to automate code generation for your side project in just two hours.

Automated code generation can feel like a distant dream for many indie hackers and solo founders. You might be thinking, "How can I get my code written for me without spending days on it?" The good news is that with the right AI coding tools, you can set up a robust automated code generation workflow in under two hours. This guide will break down the tools you need, the steps to take, and the limitations you should be aware of.

Prerequisites

Before diving in, here's what you need to have ready:

  1. A Code Editor: Something like VS Code or Atom.
  2. GitHub Account: For hosting your code.
  3. Basic Programming Knowledge: Familiarity with the programming language you’ll be working with (e.g., Python, JavaScript).
  4. An AI Code Generation Tool: Choose from the list below.

Tools for Automated Code Generation

Here’s a list of tools that can help you automate code generation. Each tool includes what it does, pricing, best use cases, limitations, and our take.

| Tool Name | Pricing | Best For | Limitations | Our Take | |------------------|-----------------------------|------------------------------|--------------------------------------|----------------------------------| | OpenAI Codex | $0-20/mo (API usage) | JavaScript and Python tasks | Limited languages, API costs can add up | We use Codex for quick snippets. | | GitHub Copilot| $10/mo per user | IDE integration | Requires subscription, may suggest incorrect code | Great for pair programming. | | Tabnine | Free tier + $12/mo Pro | Multiple languages | Not as robust as Copilot | We don’t use it; prefers Copilot.| | Codeium | Free | Quick code generation | Limited features in free version | Good for basic tasks. | | Replit Ghostwriter | $20/mo for Pro | Collaborative coding | Limited to Replit environment | Useful for team projects. | | Kite | Free + Pro at $19.90/mo | Python and JavaScript | Not as comprehensive as Copilot | We use Kite for Python. | | Sourcery | Free + $12/mo for Pro | Python code improvement | Focused on refactoring, not generation | We skip it; not our primary need.| | DeepCode | Free tier + $12/mo Pro | Code review and suggestions | Limited languages supported | Good for code quality checks. | | Ponic | $29/mo, no free tier | Full-stack code generation | Expensive for solo projects | Haven't tried; pricing is high. | | Codex AI | $0-25/mo based on usage | General coding tasks | May generate verbose code | We prefer Codex for its flexibility.| | AI21 Studio | $0-25/mo, based on usage | Natural language to code | Requires good prompt engineering | Good for experimental projects. | | Jupyter AI | Free | Data science projects | Limited to Jupyter notebooks | Great for quick prototyping. | | ChatGPT | Free + Pro at $20/mo | Conversational coding help | Not specialized for coding | We use it for brainstorming ideas.| | CodeGen | $49/mo, no free tier | High-volume code generation | Pricey for solo founders | Too expensive for our budget. |

What We Actually Use

In our experience, we primarily use OpenAI Codex and GitHub Copilot for automated code generation. Codex excels at generating snippets based on context, while Copilot integrates seamlessly into our development environment.

Step-by-Step Setup

Now that you have your tools, let's get into the nitty-gritty of setting up automated code generation.

Step 1: Choose Your Tool

Select one of the tools from the list above. For this tutorial, let’s assume you chose OpenAI Codex.

Step 2: Set Up Your Environment

  1. Install Visual Studio Code (VS Code) if you haven’t already.
  2. Create a new project folder on your local machine.
  3. Open VS Code and navigate to the Extensions tab.
  4. Search for and install the OpenAI Codex extension.

Step 3: Connect to OpenAI API

  1. Sign up for an OpenAI account and retrieve your API key.
  2. In VS Code, open the settings and input your API key into the Codex extension settings.

Step 4: Generate Code

  1. Start a new file in your project (e.g., app.js).
  2. Write a comment describing the function you want to generate, like // Create a function to fetch user data from an API.
  3. Trigger Codex to generate the code by pressing the designated shortcut (usually Ctrl + Enter).

Expected Output

You should see a fully formed function that fetches user data, complete with error handling.

Troubleshooting Common Issues

  • Code Quality: Sometimes the generated code may not follow best practices. Review and refactor as needed.
  • API Limitations: If you hit API limits, consider optimizing your calls or switching to a different tool.
  • Syntax Errors: Ensure you’ve correctly set up your environment and that the AI understands your request.

What's Next?

Once you’ve successfully generated code, consider integrating it into a larger project. You can also experiment with multiple tools to see which one fits your workflow best.

Conclusion

Automated code generation can save you invaluable time, especially when working on side projects. Start with OpenAI Codex or GitHub Copilot, and you can set up a workflow that allows you to generate functional code in under two hours. Just remember to review and adapt the generated code to fit your specific needs.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read