Metadata-Version: 2.4
Name: gen-cli
Version: 0.1.7
Summary: Gen-CLI is a Python-based tool to generate boilerplate code and framework templates for multiple programming languages.
Author: Prasad Raju G
License: MIT License
        
        Copyright (c) 2026 Prasad Raju G
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jinja2
Dynamic: license-file

# Gen-CLI

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

## Features

- Generate single-file boilerplates from file extensions
- Scaffold complete projects using language and framework templates
- Visualize directory structures with the tree command
- Diagnose environment issues with the doctor command

---

## Installation

### Using pip (Recommended)

```bash
pip install gen-cli
```

Or with pip3:

```bash
pip3 install gen-cli
```

### Using uv (Faster alternative)

```bash
uv pip install gen-cli
```

### Using pipx (Isolated CLI tools)

```bash
pipx install gen-cli
```

### From Source

```bash
git clone https://github.com/yourname/gen-cli.git
cd gen-cli
pip install -e .
```

### Verify Installation

```bash
gen --help
```

---

## Quick Start

```bash
# Generate a Python file
gen main.py

# Generate a FastAPI project
gen new myapp --lang python --template fastapi

# List available templates
gen list

# Check your environment
gen doctor
```

---

## Commands

### `gen help`

Show the help message.

```bash
gen help
gen --help
gen -h
```

---

### `gen list`

List all available language and framework templates.

```bash
gen list
```

---

### `gen doctor`

Check your environment and configuration for potential issues.

```bash
gen doctor
```

---

### `gen tree`

Display a tree view of your directory structure.

```bash
gen tree                    # current directory
gen tree -r                 # recursive (all levels)
gen tree -d 3               # depth of 3 levels
gen tree path/to/dir        # specific directory
```

---

### `gen new`

Generate a new project from a language and framework template.

```bash
gen new <project_name> --lang <language> --template <template>
```

**Options:**

| Flag | Description | Required |
|------|-------------|----------|
| `--lang` | Programming language | Yes |
| `--template` | Framework or template name | Yes |
| `--dryrun` | Preview without creating files | No |

**Examples:**

```bash
# Python projects
gen new myapp --lang python --template fastapi
gen new api --lang python --template flask
gen new web --lang python --template django

# Go projects
gen new mytool --lang go --template cli
gen new service --lang go --template web

# Other languages
gen new server --lang rust --template actix
gen new mylib --lang rust --template rocket
gen new app --lang javascript --template react
```

> **Note:** Both `--lang` and `--template` flags are required.

---

### Single File Generation

Generate a boilerplate file directly by specifying its extension.

```bash
gen main.py          # Python file
gen app.go           # Go file
gen index.js         # JavaScript file
gen main.rs          # Rust file
gen main.c           # C file
gen main.cpp         # C++ file
gen main.java        # Java file
gen index.html       # HTML file
```

The tool automatically detects the appropriate template based on the file extension.

---

## Supported Languages & Templates

| Language | Templates |
|----------|-----------|
| Python | flask, fastapi, django |
| Go | cli, web |
| Rust | actix, rocket |
| C | standard |
| C++ | standard |
| Java | spring, standard |
| JavaScript | node, react, vue |
| HTML | standard |

---

## Error Handling

Gen-CLI provides clear error messages for common issues:

- **Invalid commands** → Displays help message
- **Unsupported file extensions** → Lists available templates
- **Invalid template combinations** → Shows valid options
- **Tree errors** → Falls back to current directory

---

## Project Structure

```
gen-cli/
├── src/
│   └── gen/
│       ├── cli.py              # Main CLI entry point
│       ├── commands/
│       │   ├── doctor.py       # Environment diagnostics
│       │   ├── helper.py       # Help messages
│       │   ├── list_.py        # Template listing
│       │   └── template.py     # Template generation
│       ├── config.py           # Configuration & extension maps
│       ├── core/
│       │   └── render.py       # Jinja2 template rendering
│       └── templates/          # Built-in templates
├── tests/
│   └── test_cli.py             # Unit tests
├── pyproject.toml
└── README.md
```

---

## Development

### Running Tests

```bash
python -m unittest tests.test_cli -v
```

### Running from Source

```bash
python -m gen.cli <command>
```

---

## License

MIT License
