Metadata-Version: 2.4
Name: forgen-tools
Version: 0.1.0
Summary: Declarative project structure language
Project-URL: Homepage, https://github.com/TheServer-lab/forgen
Project-URL: Repository, https://github.com/TheServer-lab/forgen
Project-URL: Bug Tracker, https://github.com/TheServer-lab/forgen/issues
Author: Sourasish Das
License: Server-Lab Open-Control License (SOCL) 1.0
License-File: LICENSE
Keywords: automation,cli,project-generator,scaffolding
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Forgen

**Forgen** is a declarative project structure language. Write a simple `.fg` script to describe your project layout — folders, files, and their contents — and let Forgen build it for you.

## Installation

```bash
pip install forgen
```

## Quick Start

Create a script `myproject.fg`:

```
project "MyProject"
set build_dir "build"
set resource_dir "resource"

folder "src"
folder "src/utils"

write "README.md" """
# MyProject

Generated by Forgen.
"""

write "src/main.py" """
def main():
    print("Hello, world!")
"""
```

Then build it:

```bash
forgen build myproject.fg ./output
```

## Commands

| Command | Description |
|---|---|
| `forgen build <script\|pkg> <outdir>` | Build a project from a `.fg` script or `.fgp` package |
| `forgen init <dir>` | Initialise a new Forgen project directory |
| `forgen validate <script>` | Check a `.fg` script for errors |
| `forgen pack <projectdir> <out.fgp>` | Bundle a project into a portable `.fgp` package |
| `forgen make <dir> <out.fg>` | Reverse-engineer an existing directory into a `.fg` script |

### `build` flags

| Flag | Description |
|---|---|
| `--clean` | Delete the output directory before building |
| `--dry-run` | Parse and resolve without writing any files |
| `--verbose` | Print each action as it runs |

## `.fg` Script Reference

```
# Comments start with #

project "ProjectName"          # Required — declares the project name
set key "value"                # Set a variable (string, int, bool, or list)

folder "path/to/dir"           # Create a directory

write "file.txt" "content"     # Write a file with inline content
write "file.txt" """           # Or use a triple-quoted multiline string
multi
line
content
"""

copy "src/file" -> "dest/file" # Copy a file from resource_dir

for x in [1, 2, 3] {          # Loop over a list
    folder "module-{x}"
}

if some_var {                  # Conditional block
    write "debug.log" "enabled"
}
```

## `.fgp` Packages

A `.fgp` file is a ZIP archive containing a `script.fg` entry point and an optional `resource/` directory for binary assets. Use `forgen pack` to create one and `forgen build` to extract and run it.

## License

[Server-Lab Open-Control License (SOCL) 1.0](LICENSE) — © 2025 Sourasish Das
