Metadata-Version: 2.4
Name: genxcode
Version: 0.1.1
Summary: Generates boilerplate code from templates.
Description-Content-Type: text/markdown
Requires-Dist: jinja2>=3.1
Requires-Dist: pyyaml>=6.0

# genxcode

genxcode generates boilerplate code from templates.

Use it to create starter code for templates like PyTorch, CUDA, and Hugging Face, then customize the generated project for your use case.

## Install

```bash
pip install genxcode
```

## CLI Workflow

Run:

```bash
genxcode init
```

It prompts in the terminal:

```text
Enter the name of template:
```

Accepted inputs include canonical names and aliases:

- `pytorch`
- `cuda`
- `huggingface`
- `hf`
- `llm`

`hf` resolves to the Hugging Face template.

If you enter `pytorch`, `genxcode` writes `genxcode.yaml` like this:

```yaml
# Generated by `genxcode init pytorch`
template: pytorch
name: pytorch
arch: mlp
input_dim: 784
output_dim: 10
hidden:
  - 256
  - 128
activation: relu
metrics:
  - accuracy
  - loss
prod: false
lr: 0.001
epochs: 10
batch_size: 32
device: cpu
```

Edit the values you want, then generate the project:

```bash
genxcode apply
```

This creates a folder named after `name` and writes the boilerplate inside it. With the default config above, the output lands in `./pytorch/`.

Output:

```
pytorch/
    src/
        __init__.py
        config.py
        models.py
        data.py
        train.py
        predict.py
    main.py
    requirements.txt
```

Available templates:

- `pytorch`: PyTorch training scaffold
- `cuda`: CUDA kernel scaffold
- `huggingface`: Hugging Face LLM scaffold

Then run the generated boilerplate:

```bash
python main.py
```
