@dawitworku/projectcli 0.2.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,29 @@
1
+ # Changelog
2
+
3
+ This project follows Semantic Versioning.
4
+
5
+ ## 3.0.0 (2026-01-07)
6
+
7
+ - Add `projectcli doctor` with optional `--fix` and `--json` output.
8
+ - Add presets (`projectcli preset list|use`) and preset-aware defaults for common flows.
9
+ - Add safe upgrades (`projectcli upgrade`) with `--preview`, `--dry-run`, and `--only` targeting.
10
+ - Add feature-based add flows (`projectcli add <feature>`) while keeping the interactive library picker.
11
+ - Add a plugin system (`projectcli plugin list|install`) plus plugin contributions (presets, registry additions, doctor checks).
12
+ - Refactor registry internals to support extensions while keeping backwards-compatible imports.
13
+
14
+ ## 0.3.0 (2026-01-06)
15
+
16
+ - Add per-project config via `.projectclirc` / `projectcli.config.json` (CLI > project config > `~/.projectcli.json`).
17
+ - Improve preflight + missing-command errors with actionable install hints.
18
+ - Add generator stability metadata (defaults to `core`) and show in UI + `--list`.
19
+ - README improvements: demo placeholder, “Why ProjectCLI?”, explicit safety guarantees.
20
+
21
+ ## 0.2.2 (2026-01-06)
22
+
23
+ - Interactive wizard for selecting language → framework → project name.
24
+ - `--dry-run` prints planned actions without executing.
25
+ - Remote template cloning via `--template` (strips `.git`).
26
+ - Preflight tool checks for generators that declare `check: [...]`.
27
+ - Extras generation: GitHub Actions CI, Dockerfile, Dev Container, LICENSE.
28
+ - Defaults via `projectcli config` (`~/.projectcli.json`).
29
+ - Basic smoke tests via Node’s built-in test runner.
package/README.md CHANGED
@@ -1,16 +1,36 @@
1
1
  # ProjectCLI 🚀
2
2
 
3
+ **Demo (2 minutes):**
4
+
5
+ - Play locally: `asciinema play docs/demo.cast`
6
+ - Convert to plain text (for quick sharing): `asciinema convert --output-format txt docs/demo.cast -`
7
+
8
+ ![ProjectCLI terminal demo](docs/demo.svg)
9
+
10
+ Asciinema recording file: `docs/demo.cast`
11
+
3
12
  > **The Swiss Army Knife for Project Scaffolding.**
4
13
  > Bootstrapping new projects shouldn't require memorizing 50 different CLI commands.
5
14
 
6
15
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
16
  [![npm version](https://badge.fury.io/js/@dawitworku%2Fprojectcli.svg)](https://badge.fury.io/js/@dawitworku%2Fprojectcli)
17
+ [![npm downloads](https://img.shields.io/npm/dm/@dawitworku/projectcli)](https://www.npmjs.com/package/@dawitworku/projectcli)
18
+ [![CI](https://github.com/dawitworku/projectcli/actions/workflows/ci.yml/badge.svg)](https://github.com/dawitworku/projectcli/actions/workflows/ci.yml)
8
19
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
9
20
 
10
21
  **ProjectCLI** is an interactive, cross-language project generator. Instead of remembering usage for `create-react-app`, `cargo new`, `poetry new`, `laravel new`, `rails new`, etc., just run `projectcli`.
11
22
 
12
23
  We handle the complexity of calling the official CLIs for you.
13
24
 
25
+ ## 🤔 Why ProjectCLI?
26
+
27
+ | Tool | Problem |
28
+ | ---------------- | --------------------------- |
29
+ | create-react-app | JS-only |
30
+ | cargo new | Rust-only |
31
+ | yeoman | heavy & old |
32
+ | projectcli | **unified + context-aware** |
33
+
14
34
  ## ✨ Features
15
35
 
16
36
  - **Multi-Language Support**: Rust, Go, Python, JavaScript, TypeScript, PHP, Java, C#, Ruby, Swift, Dart.
@@ -22,6 +42,12 @@ We handle the complexity of calling the official CLIs for you.
22
42
  - **Dev Containers**: Generate `.devcontainer/devcontainer.json` for VS Code / Codespaces.
23
43
  - **License Generator**: Add a standard `LICENSE` file (configurable default).
24
44
 
45
+ ## ✅ Safety Guarantees
46
+
47
+ - ❌ Never writes outside the project folder it creates (guards against path traversal).
48
+ - ❌ Never deletes files without an explicit, targeted operation (template clone only removes the cloned `.git`).
49
+ - ✔ Supports `--dry-run` to preview planned actions without executing them.
50
+
25
51
  ## 🚀 Quick Start
26
52
 
27
53
  Run instantly with `npx`:
@@ -48,6 +74,16 @@ Just run `projectcli` and follow the prompts:
48
74
 
49
75
  ## 🛠 Advanced Usage
50
76
 
77
+ ### V3 Commands
78
+
79
+ ProjectCLI v3 adds a few focused subcommands:
80
+
81
+ - `projectcli doctor` check a repo and optionally apply safe fixes
82
+ - `projectcli preset list` / `projectcli preset use <name>` manage presets
83
+ - `projectcli upgrade` upgrade generated configs safely (supports `--preview`)
84
+ - `projectcli add <feature>` add focused features like `ci`, `docker`, `devcontainer`, `license`, `lint`, `test`
85
+ - `projectcli plugin list` / `projectcli plugin install <id>` enable plugins (and their contributions)
86
+
51
87
  ### Context Awareness
52
88
 
53
89
  Run it inside a project to detect the language and offer relevant tools:
@@ -67,6 +103,12 @@ Clone a starter kit from GitHub and make it your own instantly:
67
103
  projectcli --template https://github.com/example/starter-repo --name my-app
68
104
  ```
69
105
 
106
+ You can also apply extras non-interactively:
107
+
108
+ ```bash
109
+ projectcli --template https://github.com/example/starter-repo --name my-app --yes --ci --docker --devcontainer --license
110
+ ```
111
+
70
112
  ### Automation / CI Use
71
113
 
72
114
  Skip the interactive prompts for scripts or specialized workflows:
@@ -75,6 +117,18 @@ Skip the interactive prompts for scripts or specialized workflows:
75
117
  projectcli --language Rust --framework Actix --name my-api --ci --docker --yes
76
118
  ```
77
119
 
120
+ Preview what would happen (no execution):
121
+
122
+ ```bash
123
+ projectcli --language Rust --framework Actix --name my-api --dry-run
124
+ ```
125
+
126
+ Extras flags:
127
+
128
+ - `--devcontainer` add a VS Code Dev Container
129
+ - `--license` force-add LICENSE (uses config defaults)
130
+ - `--no-license` never add LICENSE
131
+
78
132
  ### Configuration
79
133
 
80
134
  Save your preferences (like default package manager):
@@ -89,6 +143,32 @@ You can set defaults like:
89
143
  - Author name (for LICENSE)
90
144
  - Default license type (MIT/Apache2/ISC)
91
145
 
146
+ ### Project Config File (teams / automation)
147
+
148
+ ProjectCLI can also read a config file from the current directory:
149
+
150
+ - `.projectclirc`
151
+ - `projectcli.config.json`
152
+
153
+ Example:
154
+
155
+ ```json
156
+ {
157
+ "packageManager": "pnpm",
158
+ "author": "The Team",
159
+ "license": "MIT",
160
+ "ci": true,
161
+ "docker": false,
162
+ "devcontainer": true
163
+ }
164
+ ```
165
+
166
+ Precedence:
167
+
168
+ 1. CLI flags
169
+ 2. Project config file
170
+ 3. Global config (`projectcli config` → `~/.projectcli.json`)
171
+
92
172
  ## 📦 Supported Generators (Partial List)
93
173
 
94
174
  | Language | Frameworks / Tools |
@@ -101,6 +181,24 @@ You can set defaults like:
101
181
  | **Java/Kotlin** | Spring Boot, Gradle/Maven... |
102
182
  | **...and more** | C#, Ruby, Swift, Dart |
103
183
 
184
+ ## 🧱 Architecture (for contributors)
185
+
186
+ ProjectCLI is intentionally simple: most “features” are data-driven.
187
+
188
+ - **Registry entrypoint**: `src/registry.js` (backwards-compatible import path for callers/tests).
189
+ - **Built-in generators**: `src/registry_legacy.js`.
190
+ - **V3 registry wrapper** (plugins/extensions): `src/registry/index.js`.
191
+ - **Generators produce steps**: each generator returns a list of steps (commands / mkdir / writeFile).
192
+ - **Executor**: steps are executed by `src/run.js` (it also prevents writing outside the project folder).
193
+ - **Preflight**: generators can declare required tools with `check: ["cargo", "go", ...]` and the wizard warns early.
194
+ - **Remote templates**: `--template` clones via `src/remote.js`, strips `.git`, then can apply Extras (CI/Docker/Devcontainer/License).
195
+
196
+ Adding a framework usually means:
197
+
198
+ 1. Add an entry in `src/registry.js` with `id`, optional `notes`, optional `check`, and a `commands()` function.
199
+ 2. Prefer non-interactive CLI args where possible (better for `--yes`/automation).
200
+ 3. Run `npm run lint` and `npm test`.
201
+
104
202
  ## 🤝 Contributing
105
203
 
106
204
  We love contributions! Whether it's adding a new framework to the registry or fixing a bug.
package/ROADMAP.md ADDED
@@ -0,0 +1,23 @@
1
+ # Roadmap
2
+
3
+ This is a lightweight, intention-revealing roadmap (not a promise). PRs welcome.
4
+
5
+ ## v0.3
6
+
7
+ - Improve `--dry-run` output (include file diffs / more structured output).
8
+ - Add `--no-ci`, `--no-docker`, `--no-devcontainer` to override config defaults.
9
+ - More actionable errors (install hints for more tools; better command failure summaries).
10
+
11
+ ## v0.4
12
+
13
+ - Generator snapshot tests (golden files) for core templates.
14
+ - More built-in templates for CI/Docker/Dev Container across languages.
15
+
16
+ ## v0.5
17
+
18
+ - Performance polish: cache tool availability, parallel preflight, reduce prompt startup cost.
19
+
20
+ ## v1.0
21
+
22
+ - Lock in stability guarantees and backwards-compat for core generators.
23
+ - Document long-term support expectations for generator metadata.