create-next-pro-cli 0.1.26 → 0.1.28

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.
Files changed (107) hide show
  1. package/README.md +281 -291
  2. package/create-next-pro-completion.sh +8 -38
  3. package/create-next-pro-completion.zsh +13 -0
  4. package/dist/bin.bun.js +2265 -794
  5. package/dist/bin.node.js +2425 -805
  6. package/dist/bin.node.js.map +1 -1
  7. package/package.json +50 -27
  8. package/templates/Projects/default/.env.example +17 -0
  9. package/templates/Projects/default/.github/workflows/quality.yml +24 -0
  10. package/templates/Projects/default/.gitignore.template +47 -0
  11. package/templates/Projects/default/.prettierignore +3 -0
  12. package/templates/Projects/default/README.md +52 -108
  13. package/templates/Projects/default/bun.lock +1152 -0
  14. package/templates/Projects/default/eslint.config.mjs +27 -11
  15. package/templates/Projects/default/messages/en/_global_ui.json +23 -10
  16. package/templates/Projects/default/messages/en.ts +17 -2
  17. package/templates/Projects/default/messages/fr/_global_ui.json +23 -10
  18. package/templates/Projects/default/messages/fr.ts +17 -2
  19. package/templates/Projects/default/next.config.ts +43 -3
  20. package/templates/Projects/default/package.json +42 -24
  21. package/templates/Projects/default/playwright.config.ts +26 -0
  22. package/templates/Projects/default/pnpm-workspace.yaml +5 -0
  23. package/templates/Projects/default/public/{cnp-logo.svg → logo.svg} +1 -1
  24. package/templates/Projects/default/src/app/[locale]/(public)/layout.tsx +8 -1
  25. package/templates/Projects/default/src/app/[locale]/(public)/login/page.tsx +8 -0
  26. package/templates/Projects/default/src/app/[locale]/(public)/register/page.tsx +8 -0
  27. package/templates/Projects/default/src/app/[locale]/(user)/dashboard/error.tsx +25 -0
  28. package/templates/Projects/default/src/app/[locale]/(user)/dashboard/loading.tsx +5 -0
  29. package/templates/Projects/default/src/app/[locale]/(user)/{Dashboard → dashboard}/page.tsx +1 -1
  30. package/templates/Projects/default/src/app/[locale]/(user)/layout.tsx +24 -2
  31. package/templates/Projects/default/src/app/[locale]/(user)/settings/loading.tsx +5 -0
  32. package/templates/Projects/default/src/app/[locale]/(user)/{Settings → settings}/page.tsx +1 -2
  33. package/templates/Projects/default/src/app/[locale]/(user)/userInfo/loading.tsx +5 -0
  34. package/templates/Projects/default/src/app/[locale]/(user)/{UserInfo → userInfo}/page.tsx +1 -2
  35. package/templates/Projects/default/src/app/[locale]/layout.tsx +34 -10
  36. package/templates/Projects/default/src/app/[locale]/loading.tsx +0 -9
  37. package/templates/Projects/default/src/app/[locale]/not-found.tsx +6 -15
  38. package/templates/Projects/default/src/app/[locale]/page.tsx +10 -1
  39. package/templates/Projects/default/src/app/api/auth/[...nextauth]/route.ts +8 -60
  40. package/templates/Projects/default/src/app/not-found.tsx +1 -1
  41. package/templates/Projects/default/src/app/sitemap.ts +2 -2
  42. package/templates/Projects/default/src/app/styles/globals.css +166 -113
  43. package/templates/Projects/default/src/auth.ts +20 -0
  44. package/templates/Projects/default/src/config.ts +3 -3
  45. package/templates/Projects/default/src/env.ts +65 -0
  46. package/templates/Projects/default/src/lib/i18n/messages.ts +8 -0
  47. package/templates/Projects/default/src/lib/i18n/request.ts +2 -16
  48. package/templates/Projects/default/src/lib/security/csp.ts +16 -0
  49. package/templates/Projects/default/src/lib/utils.ts +2 -1
  50. package/templates/Projects/default/src/proxy.ts +13 -0
  51. package/templates/Projects/default/src/ui/_global/BackButton.tsx +4 -2
  52. package/templates/Projects/default/src/ui/_global/Button.tsx +3 -8
  53. package/templates/Projects/default/src/ui/_global/GlobalHeader.tsx +10 -28
  54. package/templates/Projects/default/src/ui/_global/GlobalMain.tsx +1 -1
  55. package/templates/Projects/default/src/ui/_global/LocaleSwitcher.tsx +9 -10
  56. package/templates/Projects/default/src/ui/_global/PublicNav.tsx +51 -17
  57. package/templates/Projects/default/src/ui/_global/ThemeToggle.tsx +45 -39
  58. package/templates/Projects/default/src/ui/_global/UserNav.tsx +6 -6
  59. package/templates/Projects/default/src/ui/_home/page-ui.tsx +5 -7
  60. package/templates/Projects/default/src/ui/{Dashboard → dashboard}/LogoutButton.tsx +9 -7
  61. package/templates/Projects/default/src/ui/{Dashboard → dashboard}/StatsCard.tsx +4 -4
  62. package/templates/Projects/default/src/ui/{Dashboard → dashboard}/page-ui.tsx +7 -8
  63. package/templates/Projects/default/src/ui/login/page-ui.tsx +36 -0
  64. package/templates/Projects/default/src/ui/register/page-ui.tsx +38 -0
  65. package/templates/Projects/default/src/ui/settings/page-ui.tsx +15 -0
  66. package/templates/Projects/default/src/ui/userInfo/page-ui.tsx +15 -0
  67. package/templates/Projects/default/tailwind.config.ts +81 -1
  68. package/templates/Projects/default/tests/consumer/validate-template.ts +66 -0
  69. package/templates/Projects/default/tests/e2e/template-remediation.playwright.ts +106 -0
  70. package/templates/Projects/default/tests/rendering/verify-rendering.ts +56 -0
  71. package/templates/Projects/default/tests/unit/csp.test.ts +19 -0
  72. package/templates/Projects/default/tests/unit/env.test.ts +76 -0
  73. package/templates/Projects/default/tsconfig.json +6 -6
  74. package/templates/Projects/default/example.env +0 -8
  75. package/templates/Projects/default/messages/getMergedMessages.ts +0 -31
  76. package/templates/Projects/default/middleware.ts +0 -11
  77. package/templates/Projects/default/src/app/[locale]/(public)/Login/page.tsx +0 -6
  78. package/templates/Projects/default/src/app/[locale]/(public)/Register/page.tsx +0 -6
  79. package/templates/Projects/default/src/app/[locale]/(user)/Dashboard/error.tsx +0 -38
  80. package/templates/Projects/default/src/app/[locale]/(user)/Dashboard/loading.tsx +0 -10
  81. package/templates/Projects/default/src/app/[locale]/(user)/Settings/loading.tsx +0 -17
  82. package/templates/Projects/default/src/app/[locale]/(user)/UserInfo/loading.tsx +0 -17
  83. package/templates/Projects/default/src/app/api/auth/post-login/route.ts +0 -26
  84. package/templates/Projects/default/src/app/api/hello/route.ts +0 -5
  85. package/templates/Projects/default/src/app/layout.tsx +0 -11
  86. package/templates/Projects/default/src/app/page.tsx +0 -6
  87. package/templates/Projects/default/src/auth.config.ts +0 -0
  88. package/templates/Projects/default/src/lib/auth/disconnect.ts +0 -11
  89. package/templates/Projects/default/src/lib/auth/isConnected.ts +0 -18
  90. package/templates/Projects/default/src/lib/sample/example.ts +0 -3
  91. package/templates/Projects/default/src/lib/sample/index.ts +0 -3
  92. package/templates/Projects/default/src/ui/Login/page-ui.tsx +0 -22
  93. package/templates/Projects/default/src/ui/Register/page-ui.tsx +0 -26
  94. package/templates/Projects/default/src/ui/Settings/page-ui.tsx +0 -17
  95. package/templates/Projects/default/src/ui/UserInfo/page-ui.tsx +0 -17
  96. /package/templates/Projects/default/messages/en/{Dashboard.json → dashboard.json} +0 -0
  97. /package/templates/Projects/default/messages/en/{Login.json → login.json} +0 -0
  98. /package/templates/Projects/default/messages/en/{Register.json → register.json} +0 -0
  99. /package/templates/Projects/default/messages/en/{Settings.json → settings.json} +0 -0
  100. /package/templates/Projects/default/messages/en/{UserInfo.json → userInfo.json} +0 -0
  101. /package/templates/Projects/default/messages/fr/{Dashboard.json → dashboard.json} +0 -0
  102. /package/templates/Projects/default/messages/fr/{Login.json → login.json} +0 -0
  103. /package/templates/Projects/default/messages/fr/{Register.json → register.json} +0 -0
  104. /package/templates/Projects/default/messages/fr/{Settings.json → settings.json} +0 -0
  105. /package/templates/Projects/default/messages/fr/{UserInfo.json → userInfo.json} +0 -0
  106. /package/templates/Projects/default/public/{cnp-logo.png → logo.png} +0 -0
  107. /package/templates/Projects/default/src/ui/{Dashboard → dashboard}/WelcomeCard.tsx +0 -0
package/README.md CHANGED
@@ -1,373 +1,363 @@
1
- <img src="./public/cnp-banner.svg" alt="create-next-pro logo" style="width:100%;" />
2
-
3
- ## Runtime Support
4
-
5
- [![Bun](https://img.shields.io/badge/Bun-%23000000?logo=bun&logoColor=white&style=for-the-badge)](https://bun.sh)
6
- [![Node.js](https://img.shields.io/badge/Node.js-%23339933?logo=node.js&logoColor=white&style=for-the-badge)](https://nodejs.org)
7
-
8
- <!-- [![Deno](https://img.shields.io/badge/Deno-%23000000?logo=deno&logoColor=white&style=for-the-badge)](https://deno.land) -->
9
-
10
- ![npm](https://img.shields.io/npm/v/create-next-pro-cli?logo=npm&color=orange)
11
- ![npm dependencies](https://img.shields.io/librariesio/release/npm/create-next-pro-cli?logo=npm)
12
- ![npm downloads](https://img.shields.io/npm/dw/create-next-pro-cli?logo=npm)
13
-
14
- ![GitHub](https://img.shields.io/github/stars/Rising-Corporation/create-next-pro-cli?style=social&logo=github)
15
- ![GitHub forks](https://img.shields.io/github/forks/Rising-Corporation/create-next-pro-cli?style=social&logo=github)
16
- ![GitHub issues](https://img.shields.io/github/issues/Rising-Corporation/create-next-pro-cli?logo=github)
17
- ![CI](https://github.com/Rising-Corporation/typed-sse/actions/workflows/ci.yml/badge.svg)
18
-
19
- ![status](https://img.shields.io/badge/status-beta-orange)
20
- ![license](https://img.shields.io/github/license/Rising-Corporation/create-next-pro-cli?logo=open-source-initiative&logoColor=white)
21
- [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-blue.svg?logo=conventionalcommits)](https://www.conventionalcommits.org/en/v1.0.0/)
22
-
23
- > ⚠️ This project is under active development and currently in beta testing. You may encounter bugs or crashes until the first release. Not all features are implemented yet, and contributions are welcome!
24
-
25
- Initially, changes will be accepted or rejected by the creator, but in a few weeks, contributions will be submitted to a community vote.
1
+ <img src="./public/cnp-banner.svg" alt="create-next-pro" width="100%" />
26
2
 
27
3
  # create-next-pro-cli
28
4
 
29
- > 🚀 An advanced CLI scaffolder to create professional Next.js projects instantly.
5
+ [![Bun](https://img.shields.io/badge/Bun-1.3%2B-000000?logo=bun&logoColor=white)](https://bun.sh)
6
+ [![Node.js](https://img.shields.io/badge/Node.js-24%2B-339933?logo=node.js&logoColor=white)](https://nodejs.org)
7
+ [![npm](https://img.shields.io/npm/v/create-next-pro-cli?logo=npm&color=CB3837)](https://www.npmjs.com/package/create-next-pro-cli)
8
+ [![npm downloads](https://img.shields.io/npm/dw/create-next-pro-cli?logo=npm)](https://www.npmjs.com/package/create-next-pro-cli)
9
+ [![CI](https://github.com/Rising-Corporation/create-next-pro-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/Rising-Corporation/create-next-pro-cli/actions/workflows/ci.yml)
10
+ [![GitHub stars](https://img.shields.io/github/stars/Rising-Corporation/create-next-pro-cli?style=social)](https://github.com/Rising-Corporation/create-next-pro-cli)
11
+ [![GitHub issues](https://img.shields.io/github/issues/Rising-Corporation/create-next-pro-cli?logo=github)](https://github.com/Rising-Corporation/create-next-pro-cli/issues)
12
+ [![License](https://img.shields.io/github/license/Rising-Corporation/create-next-pro-cli?logo=open-source-initiative&logoColor=white)](./LICENSE)
13
+ [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-FE5196?logo=conventionalcommits&logoColor=white)](https://www.conventionalcommits.org/en/v1.0.0/)
30
14
 
31
- ---
15
+ `create-next-pro` generates and evolves Next.js 16 projects with TypeScript, App Router, React 19, Tailwind CSS 4, `next-intl`, and Auth.js.
32
16
 
33
- > 🤩 Can't wait and too excited to read more? Just want to try it now?
34
- >
35
- > ℹ️ To enable autocompletion automatically, add the `--trust` option when installing globally with Bun:
36
- >
37
- > ```bash
38
- > bun install -g create-next-pro-cli --trust
39
- > ```
17
+ The launcher uses Bun when available and automatically falls back to Node.js. No runtime selection is persisted. Generated projects are validated with Bun, npm, and pnpm.
40
18
 
41
- ---
19
+ ## Purpose
42
20
 
43
- ## 🎯 Purpose
21
+ `create-next-pro` provides a reproducible, production-oriented Next.js foundation and commands to evolve it without manually relocating files. The scaffolder separates App Router routes, interfaces under `src/ui`, translated messages, and application libraries to keep the structure clear as the application grows.
44
22
 
45
- Create an enhanced alternative to `bun create next-app` with an interactive interface to generate Next.js projects tailored to real-world professional needs.
23
+ The CLI is built around a runtime-independent core, injectable terminal and file-system adapters, and generators confined to the project root. The distributed template includes internationalization, authentication, a CSP policy, environment validation, and automated quality checks.
46
24
 
47
- This open-source, community-driven project aims to gather and share best practices to help standardize Next.js project structures. It includes many other features to facilitate modern development workflows and encourage collaboration.
25
+ ## Main features
48
26
 
49
- The CLI also enables you to instantly create pages and components, automatically placing them in the correct location within your project’s architecture for seamless organization and scalability.
27
+ - direct or interactive Next.js 16 project creation;
28
+ - Bun-first CLI execution with an automatic Node.js fallback;
29
+ - generated projects compatible with Bun, npm, and pnpm;
30
+ - generation of pages, components, libraries, and API routes;
31
+ - addition of `next-intl` locales and messages;
32
+ - direct or interactive page removal with a tree-based selector;
33
+ - nested routes and interfaces using `Parent.Child` notation;
34
+ - customizable import aliases such as `@/*` or `@core/*`;
35
+ - dedicated Bash and Zsh completion;
36
+ - confined file operations and allowlist-based template copying;
37
+ - Auth.js, CSP, environment validation, Vitest, and Playwright in the template.
50
38
 
51
- You can also customize the templates used for pages and components to fit your own needs.
39
+ ## Requirements
52
40
 
53
- ---
41
+ - Node.js 24 or later, or Bun 1.3 or later, to run the CLI.
42
+ - Bun 1.3+, the npm version bundled with Node.js 24+, or pnpm 11+ for generated projects.
54
43
 
55
- ## 🛠️ Commands & Examples
56
-
57
- ### Create a new project
44
+ ## Installation
58
45
 
59
46
  ```bash
60
- create-next-pro MyProjectName
47
+ bun install --global create-next-pro-cli
48
+ # or
49
+ npm install --global create-next-pro-cli
50
+ # or
51
+ pnpm add --global create-next-pro-cli
61
52
  ```
62
53
 
63
- > ⚠️ The interactive prompt for features and customization is not yet implemented, but will be available very soon!
64
-
65
- ### Create a page
54
+ Without a global installation:
66
55
 
67
56
  ```bash
68
- create-next-pro addpage MyPage
57
+ bunx create-next-pro-cli my-app
58
+ npx create-next-pro-cli my-app
59
+ pnpm dlx create-next-pro-cli my-app
69
60
  ```
70
61
 
71
- ### Create a nested page
62
+ On first launch, the onboarding assistant offers to install Bash or Zsh completion. Run `create-next-pro --reconfigure` to start the assistant again without duplicating the shell configuration.
63
+
64
+ ## Create a project
72
65
 
73
66
  ```bash
74
- create-next-pro addpage ParentPage.ChildPage
67
+ create-next-pro my-app
68
+ cd my-app
75
69
  ```
76
70
 
77
- ### Create a component (global)
71
+ Then install dependencies with your preferred package manager:
78
72
 
79
73
  ```bash
80
- create-next-pro addcomponent MyComponent
74
+ bun install && bun run dev
75
+ # or
76
+ npm install && npm run dev
77
+ # or
78
+ pnpm install && pnpm run dev
81
79
  ```
82
80
 
83
- ### Create a component in a page
81
+ An existing destination is rejected by default. `--force` only permits replacement of the requested child destination:
84
82
 
85
83
  ```bash
86
- create-next-pro addcomponent MyComponent -P MyPage
84
+ create-next-pro my-app --force
87
85
  ```
88
86
 
89
- ### Create a component in a nested page
87
+ Without a project name, the CLI opens the interactive assistant. The import alias must follow the `<prefix>/*` form, such as `@/*` or `@core/*`. It is written to `tsconfig.json` and `cnp.config.json`, then reused by the generators.
90
88
 
91
- ```bash
92
- create-next-pro addcomponent MyComponent -P ParentPage.ChildPage
93
- ```
89
+ ## Project evolution commands
94
90
 
95
- ### Create a library
91
+ Run the following commands from the root of a generated project.
96
92
 
97
93
  ```bash
98
- create-next-pro addlib mylib
99
- ```
94
+ # Simple or nested pages
95
+ create-next-pro addpage profile
96
+ create-next-pro addpage account.security
100
97
 
101
- ### Add a file to a library
98
+ # Global components or components attached to a page
99
+ create-next-pro addcomponent Alert
100
+ create-next-pro addcomponent PasswordForm --page account.security
102
101
 
103
- ```bash
104
- create-next-pro addlib mylib.foo
105
- ```
102
+ # Libraries and modules
103
+ create-next-pro addlib analytics
104
+ create-next-pro addlib analytics.trackEvent
106
105
 
107
- ### Create an API route
106
+ # Routes API
107
+ create-next-pro addapi health
108
108
 
109
- ```bash
110
- create-next-pro addapi hello
111
- ```
109
+ # Locales and translations
110
+ create-next-pro addlanguage de
111
+ create-next-pro addtext dashboard.welcome "Welcome"
112
112
 
113
- ### Remove a page
113
+ # Direct removal
114
+ create-next-pro rmpage account.security
114
115
 
115
- ```bash
116
- create-next-pro rmpage MyPage
116
+ # Tree-based autocomplete menu with confirmation
117
+ create-next-pro rmpage
117
118
  ```
118
119
 
119
- ### Remove a nested page
120
+ `addlanguage` copies every message file from the configured default locale. The command reports each copied path and emits a required `translate` next step: the copied source-language text must be translated before the locale is ready to ship.
120
121
 
121
- ```bash
122
- create-next-pro rmpage ParentPage.ChildPage
123
- ```
122
+ `addpage` creates `layout`, `page`, and `loading` files by default. Available long options are `--layout`, `--page`, `--loading`, `--not-found`, `--error`, `--global-error`, `--route`, `--template`, and `--default`. The historical short forms remain available.
123
+
124
+ `rmpage` only lists routes that contain an actual `page.tsx`. Next.js route groups and technical directories are hidden. Removal is confined to the project and preserves shared parent directories and unrelated files.
124
125
 
125
- ---
126
+ ## Generated project architecture
126
127
 
127
- ## 📁 Expected Structure of a Generated Project
128
+ The Next.js route and its interface are separate: `src/app` owns routing while `src/ui` owns page components. Translations remain organized by locale and domain.
128
129
 
129
- ```plaintext
130
- my-next-app/
131
- .
132
- ├── eslint.config.mjs
133
- ├── messages
134
- │ ├── en
135
- │ │ ├── Dashboard.json
130
+ ```text
131
+ my-app/
132
+ ├── .env.example
133
+ ├── cnp.config.json
134
+ ├── messages/
135
+ │ ├── en/
136
136
  │ │ ├── _global_ui.json
137
137
  │ │ ├── _home.json
138
- │ │ ├── Login.json
139
- │ │ ├── Register.json
140
- │ │ ├── Settings.json
141
- │ │ └── UserInfo.json
138
+ │ │ ├── dashboard.json
139
+ │ │ ├── login.json
140
+ │ │ ├── register.json
141
+ │ │ ├── settings.json
142
+ │ │ └── userInfo.json
142
143
  │ ├── en.ts
143
- │ ├── fr
144
- │ │ ├── Dashboard.json
145
- │ ├── _global_ui.json
146
- │ │ ├── _home.json
147
- ├── Login.json
148
- │ ├── Register.json
149
- │ │ ├── Settings.json
150
- │ └── UserInfo.json
151
- │ ├── fr.ts
152
- └── getMergedMessages.ts
153
- ├── middleware.ts
154
- ├── next.config.ts
155
- ├── next-env.d.ts
156
- ├── package.json
157
- ├── postcss.config.mjs
158
- ├── public
159
- ├── cnp-logo.png
160
- │ └── cnp-logo.svg
161
- ├── README.md
162
- ├── src
163
- │ ├── app
164
- │ │ ├── api
165
- │ │ │ └── auth
166
- │ │ │ ├── [...nextauth]
167
- │ │ │ │ └── route.ts
168
- │ │ │ └── post-login
169
- │ │ │ └── route.ts
170
- │ │ ├── favicon.ico
171
- │ │ ├── layout.tsx
172
- │ │ ├── [locale]
144
+ │ ├── fr/
145
+ │ │ └── ...
146
+ └── fr.ts
147
+ ├── public/
148
+ │ ├── logo.png
149
+ └── logo.svg
150
+ ├── src/
151
+ ├── app/
152
+ ├── [locale]/
153
+ │ │ ├── (public)/
154
+ │ │ │ │ ├── _home/
155
+ │ │ │ │ ├── login/
156
+ │ │ │ │ └── register/
157
+ │ │ │ ├── (user)/
158
+ │ │ │ │ ├── dashboard/
159
+ │ │ │ │ ├── settings/
160
+ │ │ │ └── userInfo/
173
161
  │ │ │ ├── layout.tsx
174
- │ │ │ ├── loading.tsx
175
- │ │ ├── not-found.tsx
176
- │ │ │ ├── page.tsx
177
- │ │ ├── (public)
178
- │ │ │ │ ├── _home
179
- │ │ │ │ │ ├── loading.tsx
180
- │ │ │ │ │ └── page.tsx
181
- │ │ │ │ ├── layout.tsx
182
- │ │ │ │ ├── Login
183
- │ │ │ │ │ └── page.tsx
184
- │ │ │ │ └── Register
185
- │ │ │ │ └── page.tsx
186
- │ │ │ └── (user)
187
- │ │ │ ├── Dashboard
188
- │ │ │ │ ├── error.tsx
189
- │ │ │ │ ├── loading.tsx
190
- │ │ │ │ └── page.tsx
191
- │ │ │ ├── layout.tsx
192
- │ │ │ ├── Settings
193
- │ │ │ │ ├── loading.tsx
194
- │ │ │ │ └── page.tsx
195
- │ │ │ └── UserInfo
196
- │ │ │ ├── loading.tsx
197
- │ │ │ └── page.tsx
198
- │ │ ├── not-found.tsx
199
- │ │ ├── page.tsx
200
- │ │ ├── sitemap.ts
201
- │ │ └── styles
202
- │ │ └── globals.css
203
- │ ├── auth.config.ts
204
- │ ├── config.ts
205
- │ ├── lib
206
- │ │ ├── auth
207
- │ │ │ ├── disconnect.ts
208
- │ │ │ └── isConnected.ts
209
- │ │ ├── i18n
210
- │ │ │ ├── navigation.ts
211
- │ │ │ ├── request.ts
212
- │ │ │ └── routing.ts
162
+ │ │ │ └── page.tsx
163
+ │ │ ├── api/auth/[...nextauth]/route.ts
164
+ │ │ └── styles/globals.css
165
+ │ ├── lib/
166
+ │ │ ├── i18n/
167
+ │ │ ├── security/csp.ts
213
168
  │ │ └── utils.ts
214
- └── ui
215
- ├── Dashboard
216
- │ ├── LogoutButton.tsx
217
- │ ├── page-ui.tsx
218
- │ ├── StatsCard.tsx
219
- └── WelcomeCard.tsx
220
- ├── _global
221
- ├── BackButton.tsx
222
- ├── Button.tsx
223
- ├── GlobalHeader.tsx
224
- ├── GlobalMain.tsx
225
- ├── Loading.tsx
226
- │ │ ├── LocaleSwitcher.tsx
227
- ├── PublicNav.tsx
228
- ├── ThemeToggle.tsx
229
- └── UserNav.tsx
230
- ├── _home
231
- │ │ └── page-ui.tsx
232
- ├── Login
233
- │ │ └── page-ui.tsx
234
- ├── Register
235
- │ │ └── page-ui.tsx
236
- │ ├── Settings
237
- │ │ └── page-ui.tsx
238
- │ └── UserInfo
239
- │ └── page-ui.tsx
240
- ├── tailwind.config.ts
169
+ ├── ui/
170
+ ├── _global/
171
+ │ ├── _home/
172
+ │ ├── dashboard/
173
+ │ ├── login/
174
+ ├── register/
175
+ ├── settings/
176
+ └── userInfo/
177
+ │ ├── auth.ts
178
+ │ ├── config.ts
179
+ │ ├── env.ts
180
+ └── proxy.ts
181
+ ├── tests/
182
+ │ ├── consumer/
183
+ │ ├── e2e/
184
+ ├── rendering/
185
+ └── unit/
186
+ ├── next.config.ts
187
+ ├── package.json
188
+ ├── playwright.config.ts
189
+ ├── pnpm-workspace.yaml
241
190
  └── tsconfig.json
242
191
  ```
243
192
 
244
- ---
245
-
246
- ## Main Features
247
-
248
- - Interactive CLI available for Bun, Node.js, or Deno
249
- - Multi-runtime support: Bun, Node.js, Deno
250
- - Features:
251
- - TypeScript integration
252
- - ESLint configuration
253
- - Tailwind CSS setup
254
- - App Router support (with or without `src/` directory)
255
- - Internationalization using `next-intl`
256
- - Turbopack or Webpack support
257
- - Custom path aliases (e.g., `@/*`, `@core/*`)
258
- - Next-auth with custom cookies
259
- - Automatic generation of pages and components
260
- - Clean i18n structure: `/messages/en/*.json`, `/lib/i18n/`
261
- - Add or remove pages and components via CLI
262
- - Bash and Zsh autocompletion
263
- - Interactive installation and runtime detection
264
-
265
- ---
266
-
267
- ## 📁 CLI Structure
268
-
269
- ```plaintext
270
- create-next-pro/
271
- .
272
- ├── bin.ts
273
- ├── create-next-pro-completion.sh
274
- ├── install.sh
275
- ├── package.json
276
- ├── public
277
- │ ├── cnp-banner.svg
278
- │ └── logo.svg
279
- ├── src
280
- │ ├── index.ts
281
- │ ├── lib
193
+ Template working files (`.env`, the nested Git repository, caches, screenshots, and test results) are not copied into generated projects. The CLI creates `cnp.config.json` with the project name and selected alias.
194
+
195
+ ## CLI architecture
196
+
197
+ ```text
198
+ create-next-pro-cli/
199
+ ├── bin.bun.ts
200
+ ├── bin.node.ts
201
+ ├── src/
202
+ │ ├── cli/
203
+ │ │ ├── completion.ts
204
+ │ │ ├── onboarding.ts
205
+ │ │ ├── output.ts
206
+ │ │ └── registry.ts
207
+ │ ├── core/
208
+ │ │ ├── contracts.ts
209
+ │ │ ├── operations.ts
210
+ │ │ ├── page-catalog.ts
211
+ │ │ ├── project-paths.ts
212
+ │ │ └── template-manifest.ts
213
+ │ ├── lib/
214
+ │ │ ├── addApi.ts
282
215
  │ │ ├── addComponent.ts
216
+ │ │ ├── addLanguage.ts
217
+ │ │ ├── addLib.ts
283
218
  │ │ ├── addPage.ts
219
+ │ │ ├── addText.ts
284
220
  │ │ ├── createProject.ts
285
- │ │ ├── createProjectWithPrompt.ts
286
- ├── rmPage.ts
287
- │ │ ├── utils.test.ts
288
- │ └── utils.ts
289
- ├── scaffold-dev.ts
221
+ │ │ └── rmPage.ts
222
+ │ ├── release/
223
+ │ │ └── model.ts
224
+ ├── runtime/
225
+ │ └── node-context.ts
226
+ │ ├── index.ts
290
227
  │ └── scaffold.ts
291
- └── tsconfig.json
228
+ ├── templates/
229
+ │ ├── Component/
230
+ │ ├── Page/
231
+ │ ├── Projects/default/
232
+ │ ├── Api/
233
+ │ └── Lib/
234
+ ├── create-next-pro-completion.sh
235
+ ├── create-next-pro-completion.zsh
236
+ ├── package.json
237
+ └── tsup.config.ts
238
+ ```
239
+
240
+ The CLI registry resolves commands to a shared asynchronous interface. The core defines contracts, the page catalog, and path boundaries; runtime adapters provide prompts, console access, and file-system operations. Bun and Node.js bundles are built separately and selected by the `dist/create-next-pro` launcher.
241
+
242
+ ## Global options
243
+
244
+ ```text
245
+ --help Show help
246
+ --version, -v Show the version
247
+ --json Emit one deterministic JSON document
248
+ --reconfigure Run CLI configuration again
249
+ --force Replace an existing project destination
250
+ ```
251
+
252
+ `--json` can appear before or after a command. It disables prompts, colors, banners, and incidental logs. Standard output contains exactly one JSON document followed by a newline, while standard error remains empty even when the command fails. Internal shell completion continues to use its separate line-based protocol.
292
253
 
254
+ ## Human and agent output
255
+
256
+ Human output names every created, copied, updated, deleted, unchanged, or skipped resource with an absolute path. It ends with a summary and only the next steps that are still required. For example, adding a locale clearly reports that its messages were copied from the source locale:
257
+
258
+ ```text
259
+ COPIED translation-messages: /workspace/my-app/messages/de/dashboard.json from /workspace/my-app/messages/en/dashboard.json (locale="de", sourceLocale="en")
260
+ UPDATED messages-registry: /workspace/my-app/src/lib/i18n/messages.ts
261
+ SUCCESS: Added locale "de" by copying 7 files from "en".
262
+ NEXT [translate]: Translate every copied message from en to de; the copied text is not ready for delivery.
263
+ /workspace/my-app/messages/de/dashboard.json
264
+ ```
265
+
266
+ Agentic usage adds `--json`:
267
+
268
+ ```bash
269
+ create-next-pro addapi health --json
270
+ ```
271
+
272
+ The versioned document has stable status, event, next-step, and error fields:
273
+
274
+ ```json
275
+ {
276
+ "schemaVersion": 1,
277
+ "command": "addapi",
278
+ "status": "success",
279
+ "exitCode": 0,
280
+ "summary": "Added API route \"health\".",
281
+ "projectRoot": "/workspace/my-app",
282
+ "events": [
283
+ {
284
+ "sequence": 1,
285
+ "action": "created",
286
+ "resource": "directory",
287
+ "role": "api-directory",
288
+ "scope": "project",
289
+ "path": "src/app/api/health"
290
+ },
291
+ {
292
+ "sequence": 2,
293
+ "action": "created",
294
+ "resource": "file",
295
+ "role": "api-route",
296
+ "scope": "project",
297
+ "path": "src/app/api/health/route.ts"
298
+ }
299
+ ],
300
+ "nextSteps": [
301
+ {
302
+ "kind": "review",
303
+ "required": true,
304
+ "message": "Replace the example response and review validation and authentication.",
305
+ "paths": [
306
+ {
307
+ "scope": "project",
308
+ "path": "src/app/api/health/route.ts"
309
+ }
310
+ ]
311
+ }
312
+ ],
313
+ "error": null
314
+ }
293
315
  ```
294
316
 
295
- ---
317
+ Paths inside events and next steps are relative to their named scope. Applicable absolute roots are exposed as `projectRoot`, `configRoot`, and `homeRoot`. Events never contain file contents, environment values, credentials, or secrets.
296
318
 
297
- ## 🚀 Install & Usage
319
+ Command statuses are `success`, `unchanged`, `cancelled`, and `failed`. Successful mutations, idempotent no-op results, and user cancellations exit with code `0`; only `failed` exits with code `1`. Stable error codes include `INVALID_ARGUMENT`, `CONFIG_NOT_FOUND`, `I18N_DISABLED`, `TARGET_EXISTS`, `TARGET_NOT_FOUND`, `TEMPLATE_MISSING`, `UNSAFE_PATH`, `INCONSISTENT_LOCALE`, `FILESYSTEM_ERROR`, `INTERACTIVE_INPUT_REQUIRED`, and `ONBOARDING_REQUIRED`.
298
320
 
299
- ### Local from git ( dev & bun only )
321
+ Interactive input is never attempted in JSON mode. Pass every required argument explicitly. On a new machine, run the CLI once without `--json` to complete onboarding; `--reconfigure --json` is intentionally rejected.
322
+
323
+ ## Environment and security
324
+
325
+ Generated projects contain `.env.example`, never the template's local `.env`. Copy it before configuring Auth.js:
300
326
 
301
327
  ```bash
302
- git clone https://github.com/Rising-Corporation/create-next-pro-cli.git
303
- bun install
304
- bun dev
328
+ cp .env.example .env.local
305
329
  ```
306
330
 
307
- - then Global ( on your machine )
331
+ OAuth credentials, nested Git repositories, caches, installed dependencies, Playwright artifacts, and agent context are excluded from generated projects and the npm package. For deployments without authentication, use `AUTH_DISABLED=true`.
332
+
333
+ ## Quality
334
+
335
+ In the CLI repository:
308
336
 
309
337
  ```bash
310
- bun link create-next-pro-cli
311
- create-next-pro my-next-project
338
+ bun install --frozen-lockfile
339
+ bun run check
312
340
  ```
313
341
 
314
- ### From npm (via bunx , npx ... or global install)
342
+ In a generated project, the same scripts work with all three package managers:
315
343
 
316
344
  ```bash
317
- bunx create-next-pro-cli # to try without install
345
+ bun run check
346
+ npm run check
347
+ pnpm run check
318
348
  ```
319
349
 
320
- - or
350
+ Validation covers formatting, linting, TypeScript, Vitest, the Next.js build, and the rendering contract. Use `npm pack --dry-run --json` to inspect the CLI's distributable contents.
351
+
352
+ ## Development
321
353
 
322
354
  ```bash
323
- bun install -g create-next-pro-cli #ℹ️
355
+ git clone https://github.com/Rising-Corporation/create-next-pro-cli.git
356
+ cd create-next-pro-cli
357
+ bun install --frozen-lockfile
358
+ bun run build
359
+ bun link
360
+ create-next-pro --help
324
361
  ```
325
362
 
326
- > ℹ️ To enable autocompletion automatically, add the `--trust` option when installing globally with Bun:
327
- >
328
- > ```bash
329
- > bun install -g create-next-pro-cli --trust
330
- > ```
331
-
332
- > Otherwise, run the autocompletion install script from binary manually:
333
- >
334
- > ```bash
335
- > bash install.sh
336
- > ```
337
-
338
- > Or add the autocompletion line to your `.bashrc`/`.zshrc` :
339
- >
340
- > ```bash
341
- > source ~/.bun/install/global/node_modules/create-next-pro-cli/create-next-pro-completion.sh
342
- > ```
343
- >
344
- > Then restart your terminal or run
345
- >
346
- > ```bash
347
- > source ~/.bashrc
348
- > ```
349
- >
350
- > ||
351
- >
352
- > ```bash
353
- > source ~/.zshrc
354
- > ```
355
-
356
- ---
357
-
358
- ## 🛣️ Roadmap in coming for beta v0.2.0
359
-
360
- - [ ] Implementation of interactive prompts
361
- - [ ] Create library features
362
- - [ ] Create API features
363
- - [ ] Generation of `.env.*`
364
- - [ ] Multi-platform testing (`bunx`, `link`, `npm`, etc.)
365
- - [ ] Additional Components templates (admin panel, landing page, etc.)
366
- - [ ] Auto deployment to Vercel
367
-
368
- ---
369
-
370
- ## 👨‍💻 Author
371
-
372
- MrRise@RisingCorporation
373
- Made with ❤️ and Bun 🐇
363
+ MIT licensed. Contribution guidelines are available in [CONTRIBUTING.md](./CONTRIBUTING.md).