npm package: @kayro25/autob
Description: Universal project generator CLI for developers
Author: Kayro25
Latest version: 1.0.0

# 🛠️ autoB

A **modern, human-friendly CLI** for creating and managing reusable **project templates** using YAML.  
Define folder structures, variables, and post-install commands — then generate new projects from those blueprints.

---

## 🚀 Features

- Interactive CLI with visual file navigation  
- Template-based project creation using `.yaml` / `.yml` blueprints  
- Custom variables that prompt users during setup  
- Multi-file templates with nested directories  
- Post-creation automation (e.g. `npm install`, `git init`)  
- Cross-platform: Linux, macOS, Windows

---

## 📦 Installation

Clone the repo and install dependencies:

```bash
git clone https://github.com/Kayro25/autoB.git
cd autoB
npm install
```

Link globally for convenient usage:

```bash
npm link
# run it anywhere with:
autoB
```

Or install globally from npm:

```bash
npm install -g autoB
```

---

## 🧭 Quick Start

Run `autoB` and pick an action from the main menu:

```
✨ Project Builder - Let's build something cool! ✨

? What do you want to do?
  ▸ 🎯 Start new project
    📝 Create template
```

### Start a New Project

1. Choose **Start new project**  
2. Pick the destination folder (file-tree selector)  
3. Choose a saved template (YAML)  
4. Answer template prompts (variables)  
5. The CLI creates files, replaces `{{VARIABLES}}`, and runs post-creation commands

### Create a Template

1. Choose **Create template**  
2. Enter template name & description  
3. Add variables (e.g. `PROJECT_NAME`, `AUTHOR`)  
4. Add files (paths + content, support for multi-line content)  
5. Add post-creation commands (optional)  
6. Template is saved to `./templates/<name>.yaml`

---

## 🧩 Template Example

```yaml
name: node-api
description: Base Node API
variables:
  - name: PROJECT_NAME
    message: Enter the project name
  - name: AUTHOR
    message: Author name
files:
  - path: server.js
    content: |
      import express from 'express';
      const app = express();
      const PORT = 3000;

      app.get('/', (req, res) => res.send('Hello from {{PROJECT_NAME}}!'));
      app.listen(PORT, () => console.log('Running on port ' + PORT));
commands:
  - npm install express
  - git init
```

Save this file as `templates/node-api.yaml` and run `autoB` → Start new project → choose `node-api`.

---

## 📂 Project Layout

```
project-builder-cli/
├── index.js
├── package.json
└── templates/
    ├── node-api.yaml
    └── python-kivy.yaml
```

All templates live in the `templates/` folder (next to `index.js`).

---

## ⚙️ Implementation Notes

- Uses `inquirer` for prompts, `inquirer-file-tree-selection-prompt` for directory browsing  
- Templates are YAML files parsed with `js-yaml`  
- Files are created with `fs-extra` (ensures directories exist)  
- Post-creation commands run via `child_process.execSync` (silenced by default)

---

## 🧑‍💻 Contributing

Contributions are welcome. Suggestions:

- Add template categories (frontend/backend/mobile)  
- Support remote templates (download from a URL)  
- Add template versioning and metadata

To contribute: fork → branch → PR. Please include tests or a short demo template.

---

## 📜 License

MIT License — feel free to use, modify, and redistribute.

---

## ✅ Tips

- Keep templates small and composable (split large projects into sub-templates).  
- Use clear variable names (`PROJECT_NAME`, `PORT`, `DB_URI`).  
- Include a README snippet in templates to help users get started.