Gen-CLI Logo
Gen-CLI is a Python-based command-line tool for generating boilerplate code and framework templates for multiple programming languages.

PyPI Version CI Python License Code style

What are the key features of Gen-CLI?

  • 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

How do I install Gen-CLI?

How to install using PyPI pip?

1
pip install gen-cli

How to install from source?

1
2
3
4
5
6
7
8
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]

How to install using uv?

1
uv sync

How can I verify my installation?

1
gen --version

How do I quickly start using Gen-CLI?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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

What commands are available?

How to check the version (gen --version)?

Show the installed version of gen-cli.

1
2
gen --version
gen -v

Output: gen-cli version 1.0.0


How to get help (gen --help)?

Show the help message with all available commands and options.

1
2
gen --help
gen -h

How to list available templates (gen list)?

List all available language templates and framework templates.

1
gen list

Output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Available Languages
-------------------
  • .py
  • .c
  • .cpp
  • .go
  • .js
  • .rs
  • .html
  • .java

Available Frameworks
--------------------
  • flask
  • codeforces

How to diagnose my environment (gen doctor)?

Check your environment and configuration for potential issues.

1
gen doctor

Output:

1
2
3
4
5
6
7
8
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

How to visualize my directory (gen tree)?

Display a colorful tree view of your directory structure.

1
2
3
4
5
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

How do I generate language boilerplate?

Generate a boilerplate file for a specific language.

1
2
3
4
5
6
7
8
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:

1
2
3
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:

1
2
3
gen c
main.c already exists
Use --overwrite to replace: gen c --overwrite

How do I generate framework projects?

Generate a full project from a framework template.

1
2
3
4
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:

1
2
3
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:

1
2
3
gen flask myapp
Directory 'myapp' already exists
Use --overwrite to replace: gen flask myapp --overwrite

Which programming languages are supported?

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

Which frameworks are supported?

Command Description
gen flask Flask web application
gen codeforces Codeforces competitive programming setup

How are errors handled?

Gen-CLI provides clear error messages for common issues:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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

How do I set up for development?

How to configure the setup?

1
uv sync --all-extras

How to run tests?

1
2
3
4
5
# Run all tests
uv run pytest tests -v

# Run specific test file
uv run pytest tests/test_cli.py -v

How to run the CLI from source?

1
uv run gen <command>

What does the project structure look like?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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

What is the license?

MIT License


Who is the author?

Prasad Raju G