Metadata-Version: 2.4
Name: projectme-lib
Version: 0.1.0
Summary: CLI tool for generating projects from templates using customizable .projectme configuration files.
License-Expression: MPL-2.0
Project-URL: Homepage, https://github.com/tutu-firmino/ProjectME-lib
Project-URL: Source, https://github.com/tutu-firmino/ProjectME-lib
Project-URL: Tracker, https://github.com/tutu-firmino/ProjectME-lib/issues
Keywords: template,generator,utility
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: click>=8.1.0
Requires-Dist: pathutilx>=1.3.7

# ProjectME Lib

[![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/)
[![CLI](https://img.shields.io/badge/interface-Click-green.svg)](https://click.palletsprojects.com/)
[![GitHub license](https://img.shields.io/github/license/tutu-firmino/pathutilx)](https://github.com/tutu-firmino/pathutilx/blob/main/LICENSE)
[![PyPI version](https://badge.fury.io/py/pathutilx.svg)](https://badge.fury.io/py/pathutilx)
[![Downloads](https://img.shields.io/pypi/dm/pathutilx.svg)](https://pypistats.org/packages/pathutilx)
[![Windows](https://img.shields.io/badge/windows-unstable-red)](https://github.com/tutu-firmino/pathutilx)

ProjectME Lib is a small CLI for generating starter projects from reusable templates and a `.projectme` configuration file.

It currently supports:

- `react`
- `nodejs`
- `pyproject`
- `fullstack`

## Why use it?

- Generate projects from a simple config file or CLI flags
- Keep template choices centralized in one tool
- Support optional flags like Tailwind, TypeScript, ESLint, Prettier, and Storybook
- Inspect and validate `.projectme` files before generation

## Installation

```bash
pip install projectme-lib
```

After installation, the CLI is available as:

```bash
projectme --help
```

## Commands

### `create`

Generates a project from a `.projectme` file, CLI flags, or both.

```bash
projectme create --name my-app --template react
```

Example with extra options:

```bash
projectme create \
  --name my-app \
  --template react \
  --toolchain vite \
  --package-manager pnpm \
  --tailwind \
  --typescript \
  --eslint
```

Useful flags:

- `--config` path to a `.projectme` file
- `--name` project name
- `--template` one of `react`, `nodejs`, `pyproject`, `fullstack`
- `--toolchain` one of `vite`, `cra`
- `--package-manager` one of `npm`, `yarn`, `pnpm`
- `--output-dir` destination directory
- `--description` project description
- `--tailwind`
- `--cra`
- `--typescript`
- `--eslint`
- `--prettier`
- `--storybook`
- `--force` overwrite an existing destination

### `load`

Loads and interprets a `.projectme` file without generating a project.

```bash
projectme load
```

Or with an explicit config path:

```bash
projectme load --config .projectme
```

## `.projectme` format

ProjectME uses TOML.

Minimal example:

```toml
name = "my-app"
template = "react"
```

More complete example:

```toml
name = "my-app"
template = "react"
toolchain = "vite"
package_manager = "pnpm"
description = "My ProjectME app"

[options]
tailwind = true
typescript = true
eslint = true
prettier = true
storybook = false
```

## Supported fields

Top-level fields:

- `name` required string
- `template` required string
- `toolchain` optional enum: `vite`, `cra`
- `package_manager` optional enum: `npm`, `yarn`, `pnpm`
- `output_dir` optional string
- `description` optional string

Options inside `[options]`:

- `tailwind`
- `cra`
- `typescript`
- `eslint`
- `prettier`
- `storybook`

## Templates

### `react`

Creates a basic React-style template folder.

### `nodejs`

Creates a small Node.js project layout.

### `pyproject`

Creates a minimal Python project-style structure.

### `fullstack`

Creates a split client/server starter structure.

## Example workflow

1. Create a `.projectme` file
2. Run `projectme load` to inspect the interpreted config
3. Run `projectme create` to generate the project

Example:

```bash
projectme load --config .projectme
projectme create --config .projectme
```

## Development

Run the current tests with:

```bash
python -m pytest -q -p no:cacheprovider test.py
```

Run the CLI locally with:

```bash
python -m src.main --help
```

## License

This project is licensed under the [MPL 2.0](https://github.com/tutu-firmino/pathutilx/blob/main/LICENSE).
