Developer Tools / CASE STUDY
PyCLI.
Python Project Structure Generator
01 — THE CHALLENGE
The problem.
Developers often create the same folders and basic files again and again when starting a new Python, AI/ML, RAG, backend, or data science project. They also have to manually create a .gitignore and remember which files should not be added to Git. This makes project setup repetitive and can lead to inconsistent project structures.
02 — THE APPROACH
A thoughtful solution.
Built PyCLI, a Python command-line tool that creates a ready-to-use project structure from a selected template. It supports default, AI/ML, RAG, backend, and data science projects. The CLI can work interactively or through command-line options, safely skips existing files that already contain data, and automatically creates a project-specific .gitignore. A separate generate-gitignore command can also create or update .gitignore files in existing projects.
03 — BEHIND THE BUILD
How it came together.
The main idea behind PyCLI was to remove repetitive setup work when starting a new project. Instead of manually creating folders such as src, data, docs, tests, notebooks, and configuration files, a developer can run a command such as `mkproject my_rag_app -t rag_based`. The CLI reads the selected template from a central registry, creates the required folders and files, and then generates a suitable .gitignore. The project uses a common base structure and extends it for AI/ML, RAG, backend, and data science work. A safety check prevents existing non-empty files from being replaced during scaffolding. The Gitignore module can also detect the likely project type and generate matching rules for environments, secrets, caches, model files, datasets, vector stores, databases, logs, and other generated files. The package exposes `mkproject`, `cpyps`, and `generate-gitignore` commands through pyproject.toml. The repository also includes documentation for installation, CLI usage, architecture, templates, and contribution guidelines.
04 — THE RESULT
Python Project Scaffolding CLI
Created a reusable CLI that turns repeated project setup into a single command and gives developers a consistent starting structure for different types of Python projects.
Screens, systems,
and the details.
06 — DEVELOPMENT MILESTONES
The build, step by step.
- 01
Built the first Python project scaffolding structure and command-line workflow
- 02
Added separate templates for AI/ML, RAG, Backend, and Data Science projects
- 03
Added interactive project type selection and command-line template options
- 04
Added safe file creation so existing non-empty files are skipped instead of replaced
- 05
Built an automatic Gitignore generator with project-type detection and rule merging
- 06
Packaged the tool with pyproject.toml and exposed mkproject, cpyps, and generate-gitignore commands
- 07
Added architecture, CLI reference, quickstart, template, and contribution documentation
07 — LESSONS & CONSTRAINTS
What made it interesting.
Designing one CLI that can support different project types without putting all template logic inside the main command file.
Creating reusable templates by extending a shared common project structure.
Preventing existing project files from being accidentally overwritten.
Generating useful .gitignore rules for different project types while preserving existing rules.
Making the command usable both interactively and through normal command-line arguments.
Handling filesystem writes safely, including atomic file replacement.
Keeping the package easy to extend when a new project template is added.