Gen-CLI is a Python-based command-line tool for generating boilerplate code and framework templates for multiple programming languages.
Features
- Single-file boilerplate generation for multiple languages
- Project scaffolding using framework templates
- Colorful directory tree visualization
- Environment diagnostics with
gen doctor - Dry-run mode for previewing outputs
- Overwrite support for existing files/directories
Installation
From Source
git clone https://github.com/iamprasadraju/gen-cli.git
cd gen-cli
# Install for usage
pip install -e .
# Install for development (includes tests, linting tools)
pip install -e .[dev]
Using uv
uv sync
Verify Installation
gen --version
Quick Start
# Generate a C boilerplate file
gen c
# Generate a Python boilerplate file
gen py
# Generate a Flask project
gen flask
# List available languages and frameworks
gen list
# Show directory tree
gen tree
# Check your environment
gen doctor
Commands
gen --version / gen -v
Show the installed version of gen-cli.
gen --version
gen -v
Output: gen-cli version 1.0.0
gen --help / gen -h
Show the help message with all available commands and options.
gen --help
gen -h
gen list
List all available language templates and framework templates.
gen list
Output:
Available Languages
-------------------
• .py
• .c
• .cpp
• .go
• .js
• .rs
• .html
• .java
Available Frameworks
--------------------
• flask
• codeforces
gen doctor
Check your environment and configuration for potential issues.
gen doctor
Output:
Gen CLI Doctor
----------------------------------------
✓ Python Version: 3.13.12
✓ Platform: Darwin 24.0.0
✓ Working Directory: /Users/user/project
✓ PATH directories: 17 found
All checks passed
gen tree
Display a colorful tree view of your directory structure.
gen tree # current directory, depth 2, no hidden
gen tree -a # include hidden files/dirs
gen tree -3 # depth of 3 levels
gen tree -3 src # depth 3 of specific directory
gen tree -2 -a . # depth 2, include hidden, current dir
Tree options:
| Flag | Description |
|---|---|
-N |
Set depth (e.g., -2, -3) |
-a, --all |
Include hidden files/dirs |
Colors:
- Bold blue — directories
- Green — regular files
- Dim/gray — hidden files and connectors
Language Generation
Generate a boilerplate file for a specific language.
gen c # creates main.c
gen py # creates main.py
gen js # creates main.js
gen go # creates main.go
gen rs # creates main.rs
gen cpp # creates main.cpp
gen java # creates main.java
gen html # creates main.html
Options:
| Flag | Description |
|---|---|
--dryrun |
Preview the file content without creating it |
--overwrite |
Overwrite existing file |
Examples:
gen c --dryrun # preview main.c content
gen py --overwrite # overwrite main.py if exists
gen js --dryrun --overwrite # dry run (overwrite ignored)
When file already exists:
gen c
main.c already exists
Use --overwrite to replace: gen c --overwrite
Framework Generation
Generate a full project from a framework template.
gen flask # prompts for project name
gen flask myapp # creates myapp/ directly
gen codeforces # prompts for project name
gen codeforces solutions # creates solutions/ directly
Options:
| Flag | Description |
|---|---|
--dryrun |
Preview project structure without creating |
--overwrite |
Remove existing directory and regenerate |
Examples:
gen flask --dryrun # preview flask project tree
gen flask myapp --dryrun # preview tree for 'myapp'
gen flask myapp --overwrite # overwrite myapp/ if exists
When directory already exists:
gen flask myapp
Directory 'myapp' already exists
Use --overwrite to replace: gen flask myapp --overwrite
Supported Languages
| Command | Output File |
|---|---|
gen c |
main.c |
gen py |
main.py |
gen js |
main.js |
gen go |
main.go |
gen rs |
main.rs |
gen cpp |
main.cpp |
gen java |
main.java |
gen html |
main.html |
Supported Frameworks
| Command | Description |
|---|---|
gen flask |
Flask web application |
gen codeforces |
Codeforces competitive programming setup |
Error Handling
Gen-CLI provides clear error messages for common issues:
# Unknown command
gen xyz
→ Unknown command: xyz
Usage: gen [list|doctor|tree|<lang>|<framework>] [-v|--version] [-h|--help]
# Unknown flag
gen c --invalid
→ Unknown flag: --invalid
Usage: gen [list|doctor|<lang>|<framework>] [-v|--version] [-h|--help]
# Invalid tree depth format
gen tree 3
→ Invalid depth format: '3'
Use '-' prefix for depth, e.g., 'gen tree -3' or 'gen tree -3 src'
# Path not found
gen tree nonexistent
→ Path not found: nonexistent
Development
Setup
uv sync --all-extras
Running Tests
# Run all tests
uv run pytest tests -v
# Run specific test file
uv run pytest tests/test_cli.py -v
Running from Source
uv run gen <command>
Project Structure
gen-cli/
├── src/
│ └── gen/
│ ├── __init__.py
│ ├── cli.py # Main CLI entry point
│ ├── paths.py # Template path resolution
│ ├── commands/
│ │ ├── __init__.py
│ │ ├── doctor.py # Environment diagnostics
│ │ ├── helper.py # Help messages
│ │ ├── list_.py # Template listing & tree view
│ │ └── template.py # Template generation helpers
│ ├── core/
│ │ ├── __init__.py
│ │ └── render.py # Jinja2 template rendering
│ └── templates/ # Built-in templates
│ ├── lang/ # Language boilerplate files
│ └── frameworks/ # Framework project templates
├── tests/
│ └── test_*.py # Unit tests
├── pyproject.toml
└── README.md
License
MIT License
Author
Prasad Raju G
Metadata
Release files for gen-cli 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gen_cli-1.1.0.tar.gz | 16.5 kB | Without provenance | Details for gen_cli-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gen_cli-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for gen_cli-1.1.0-py3-none-any.whl |
Total release size: 33.3 kB
Release files / gen_cli-1.1.0.tar.gz
| Download URL | gen_cli-1.1.0.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
084ee83a144d23354c7c80f348cb2c8bbeabc95c1fef505b66e50d8f7a6caeec
|
|
BLAKE2b-256 checksum How to use checksums |
4a90f96b23a1c4756fd2c0cf1f83b3cda51c40ea88e6995481bba569ad3d128b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / gen_cli-1.1.0-py3-none-any.whl
| Download URL | gen_cli-1.1.0-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
140fc62faddd916056215421565f5c118692ad4b53232797e07c932a58c8909b
|
|
BLAKE2b-256 checksum How to use checksums |
ed13dd4dbcfa32764339c93086ea1d72732332c85cce66f4ba0186e6d1b3f429
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for gen-cli 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.