Project Scaffolding and Code Generation
Learn how to use the Gemini CLI to build a complete Flask application skeleton, from creating the project structure with natural language to generating the initial Python code and running the app.
With our environment fully configured, it is time to start building. In this lesson, we will construct the entire foundation of our Flask “Bug Tracker” application using only the Gemini CLI. We will begin with an empty folder and, through a series of natural language prompts, instruct the agent to scaffold the project structure, define our data model, generate the core application logic, and create the user interface. By the end of this session, we will have a running web application that can report new bugs, all driven by our interaction with the AI agent in the terminal.
Warning: One thing to remember with any LLM-powered tool is that its output isn’t deterministic. The Gemini CLI will generate a solid plan, but file names or descriptions may differ slightly from what you see in the screenshots. The overall structure and intent will stay the same.
Planning the application
Before we write a single line of code, we need a plan. Instead of creating one ourselves, let’s collaborate with our AI agent. We will provide it with the high-level requirements for our bug tracker and ask it to propose a file structure and action plan. This is a solid first step in any project to ensure we and the agent are aligned on the goal.
In an empty directory, start the Gemini CLI and execute the following prompt:
Prompt: I want to build a simple bug tracker application using Python and Flask. The requirements are:
- It must have full CRUD (Create, Read, Update, Delete) functionality for bugs.
- Each bug needs a title, a status (“To Do”, “In Progress”, “Done”, “Not Needed”), a report date, and a completion date.
- The default status for a new bug should be “To Do”. ...