acadex-cli 1.0.5 → 1.1.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.
Files changed (4) hide show
  1. package/README.md +38 -0
  2. package/acadex +87 -0
  3. package/acadex.ps1 +88 -0
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -10,12 +10,37 @@ A global CLI tool for managing Acadex projects with easy setup and automation.
10
10
  npm install -g acadex-cli
11
11
  ```
12
12
 
13
+ **If you get an error about existing files:**
14
+
15
+ ```bash
16
+ # On macOS/Linux
17
+ sudo rm -f /usr/local/bin/acadex /opt/homebrew/bin/acadex
18
+ npm install -g acadex-cli
19
+
20
+ # On Windows (PowerShell as Admin)
21
+ npm install -g acadex-cli --force
22
+ ```
23
+
13
24
  After installation, you can use the `acadex` command from anywhere:
14
25
 
15
26
  ```bash
16
27
  acadex --help
17
28
  ```
18
29
 
30
+ ### Uninstall
31
+
32
+ To completely remove ACADEX CLI:
33
+
34
+ ```bash
35
+ acadex uninstall
36
+ ```
37
+
38
+ Or manually:
39
+
40
+ ```bash
41
+ npm uninstall -g acadex-cli
42
+ ```
43
+
19
44
  ### Manual Installation
20
45
 
21
46
  Clone the repository and link it globally:
@@ -34,6 +59,19 @@ Run the CLI tool using:
34
59
  acadex <command> [arguments]
35
60
  ```
36
61
 
62
+ ### Interactive Menu (New!)
63
+
64
+ For a modern, interactive experience:
65
+
66
+ ```bash
67
+ acadex menu
68
+ ```
69
+
70
+ This will launch an interactive menu where you can:
71
+ - Browse all available commands by category
72
+ - Select commands by number
73
+ - Execute commands without memorizing syntax
74
+
37
75
  ### Available Commands
38
76
 
39
77
  #### Setup & Installation
package/acadex CHANGED
@@ -70,9 +70,11 @@ show_help() {
70
70
  echo -e " ${GREEN}phpmyadmin:stop${NC} Stop Apache"
71
71
  echo -e " ${GREEN}docs${NC} Open ACADEX documentation"
72
72
  echo -e " ${GREEN}uninstall${NC} Uninstall ACADEX CLI globally"
73
+ echo -e " ${GREEN}menu${NC} Launch interactive menu"
73
74
  echo ""
74
75
  echo -e "${YELLOW}Examples:${NC}"
75
76
  echo -e " acadex setup # First-time installation"
77
+ echo -e " acadex menu # Interactive command menu"
76
78
  echo -e " acadex services # Start services for Herd (recommended)"
77
79
  echo -e " acadex serve # Start full stack (without Herd)"
78
80
  echo -e " acadex dev # Start development"
@@ -81,8 +83,93 @@ show_help() {
81
83
  echo ""
82
84
  }
83
85
 
86
+ # Interactive Menu
87
+ show_menu() {
88
+ while true; do
89
+ clear
90
+ echo -e "${BLUE}╔══════════════════════════════════════════════════════════╗${NC}"
91
+ echo -e "${BLUE}║${NC} ${GREEN}ACADEX${NC} - Interactive Command Menu ${BLUE}║${NC}"
92
+ echo -e "${BLUE}╚══════════════════════════════════════════════════════════╝${NC}"
93
+ echo ""
94
+ echo -e "${YELLOW}Setup & Installation:${NC}"
95
+ echo -e " ${GREEN}1)${NC} setup - First-time full installation"
96
+ echo -e " ${GREEN}2)${NC} install:2fa - Install 2FA packages"
97
+ echo -e " ${GREEN}3)${NC} install:notif - Install notification packages"
98
+ echo -e " ${GREEN}4)${NC} check - Check system requirements"
99
+ echo ""
100
+ echo -e "${YELLOW}Development:${NC}"
101
+ echo -e " ${GREEN}5)${NC} serve - Start production servers"
102
+ echo -e " ${GREEN}6)${NC} services - Start background services (Herd)"
103
+ echo -e " ${GREEN}7)${NC} dev - Start development servers"
104
+ echo -e " ${GREEN}8)${NC} build - Build assets for production"
105
+ echo -e " ${GREEN}9)${NC} ui - Rebuild UI and clear caches"
106
+ echo -e " ${GREEN}10)${NC} start - Start Laravel server only"
107
+ echo ""
108
+ echo -e "${YELLOW}Testing:${NC}"
109
+ echo -e " ${GREEN}11)${NC} test - Run PHPUnit tests"
110
+ echo -e " ${GREEN}12)${NC} test:coverage - Run tests with coverage"
111
+ echo ""
112
+ echo -e "${YELLOW}Database:${NC}"
113
+ echo -e " ${GREEN}13)${NC} migrate - Run database migrations"
114
+ echo -e " ${GREEN}14)${NC} migrate:fresh - Fresh migration with seeders"
115
+ echo -e " ${GREEN}15)${NC} seed - Run database seeders"
116
+ echo -e " ${GREEN}16)${NC} tinker - Start Laravel Tinker"
117
+ echo ""
118
+ echo -e "${YELLOW}Maintenance:${NC}"
119
+ echo -e " ${GREEN}17)${NC} cache:clear - Clear all caches"
120
+ echo -e " ${GREEN}18)${NC} optimize - Optimize the application"
121
+ echo -e " ${GREEN}19)${NC} logs - Tail Laravel logs"
122
+ echo ""
123
+ echo -e "${YELLOW}Code Quality:${NC}"
124
+ echo -e " ${GREEN}20)${NC} analyze - Run PHPStan static analysis"
125
+ echo -e " ${GREEN}21)${NC} format - Format code with Pint"
126
+ echo ""
127
+ echo -e "${YELLOW}Other:${NC}"
128
+ echo -e " ${GREEN}22)${NC} routes - List all routes"
129
+ echo -e " ${GREEN}23)${NC} queue - Start queue worker"
130
+ echo -e " ${GREEN}24)${NC} docs - Open ACADEX documentation"
131
+ echo ""
132
+ echo -e " ${RED}0)${NC} Exit"
133
+ echo ""
134
+ echo -e -n "${YELLOW}Select an option [0-24]:${NC} "
135
+ read choice
136
+
137
+ case $choice in
138
+ 1) "$0" setup ;;
139
+ 2) "$0" install:2fa ;;
140
+ 3) "$0" install:notif ;;
141
+ 4) "$0" check; read -p "Press Enter to continue..." ;;
142
+ 5) "$0" serve ;;
143
+ 6) "$0" services ;;
144
+ 7) "$0" dev ;;
145
+ 8) "$0" build; read -p "Press Enter to continue..." ;;
146
+ 9) "$0" ui; read -p "Press Enter to continue..." ;;
147
+ 10) "$0" start ;;
148
+ 11) "$0" test; read -p "Press Enter to continue..." ;;
149
+ 12) "$0" test:coverage; read -p "Press Enter to continue..." ;;
150
+ 13) "$0" migrate; read -p "Press Enter to continue..." ;;
151
+ 14) "$0" migrate:fresh; read -p "Press Enter to continue..." ;;
152
+ 15) "$0" seed; read -p "Press Enter to continue..." ;;
153
+ 16) "$0" tinker ;;
154
+ 17) "$0" cache:clear; read -p "Press Enter to continue..." ;;
155
+ 18) "$0" optimize; read -p "Press Enter to continue..." ;;
156
+ 19) "$0" logs ;;
157
+ 20) "$0" analyze; read -p "Press Enter to continue..." ;;
158
+ 21) "$0" format; read -p "Press Enter to continue..." ;;
159
+ 22) "$0" routes; read -p "Press Enter to continue..." ;;
160
+ 23) "$0" queue ;;
161
+ 24) "$0" docs; read -p "Press Enter to continue..." ;;
162
+ 0) echo -e "${GREEN}Goodbye!${NC}"; exit 0 ;;
163
+ *) echo -e "${RED}Invalid option. Please try again.${NC}"; sleep 2 ;;
164
+ esac
165
+ done
166
+ }
167
+
84
168
  # Command handlers
85
169
  case "$1" in
170
+ menu)
171
+ show_menu
172
+ ;;
86
173
  setup)
87
174
  echo -e "${BLUE}╔══════════════════════════════════════════════════════════╗${NC}"
88
175
  echo -e "${BLUE}║${NC} ${GREEN}ACADEX${NC} - First Time Installation ${BLUE}║${NC}"
package/acadex.ps1 CHANGED
@@ -102,9 +102,12 @@ function Show-Help {
102
102
  Write-Host "Open ACADEX documentation"
103
103
  Write-Host " uninstall " -ForegroundColor Green -NoNewline
104
104
  Write-Host "Uninstall ACADEX CLI globally"
105
+ Write-Host " menu " -ForegroundColor Green -NoNewline
106
+ Write-Host "Launch interactive menu"
105
107
  Write-Host ""
106
108
  Write-Host "Examples:" -ForegroundColor Yellow
107
109
  Write-Host " acadex setup # First-time installation"
110
+ Write-Host " acadex menu # Interactive command menu"
108
111
  Write-Host " acadex services # Start services for Herd/Laragon (recommended)"
109
112
  Write-Host " acadex serve # Start full stack (without Herd/Laragon)"
110
113
  Write-Host " acadex dev # Start development"
@@ -113,6 +116,87 @@ function Show-Help {
113
116
  Write-Host ""
114
117
  }
115
118
 
119
+ # Interactive Menu
120
+ function Show-Menu {
121
+ while ($true) {
122
+ Clear-Host
123
+ Write-Host "===========================================================" -ForegroundColor Cyan
124
+ Write-Host " ACADEX - Interactive Command Menu " -ForegroundColor Green
125
+ Write-Host "===========================================================" -ForegroundColor Cyan
126
+ Write-Host ""
127
+ Write-Host "Setup & Installation:" -ForegroundColor Yellow
128
+ Write-Host " 1) setup - First-time full installation" -ForegroundColor Green
129
+ Write-Host " 2) install:2fa - Install 2FA packages" -ForegroundColor Green
130
+ Write-Host " 3) install:notif - Install notification packages" -ForegroundColor Green
131
+ Write-Host " 4) check - Check system requirements" -ForegroundColor Green
132
+ Write-Host ""
133
+ Write-Host "Development:" -ForegroundColor Yellow
134
+ Write-Host " 5) serve - Start production servers" -ForegroundColor Green
135
+ Write-Host " 6) services - Start background services (Herd)" -ForegroundColor Green
136
+ Write-Host " 7) dev - Start development servers" -ForegroundColor Green
137
+ Write-Host " 8) build - Build assets for production" -ForegroundColor Green
138
+ Write-Host " 9) ui - Rebuild UI and clear caches" -ForegroundColor Green
139
+ Write-Host " 10) start - Start Laravel server only" -ForegroundColor Green
140
+ Write-Host ""
141
+ Write-Host "Testing:" -ForegroundColor Yellow
142
+ Write-Host " 11) test - Run PHPUnit tests" -ForegroundColor Green
143
+ Write-Host " 12) test:coverage - Run tests with coverage" -ForegroundColor Green
144
+ Write-Host ""
145
+ Write-Host "Database:" -ForegroundColor Yellow
146
+ Write-Host " 13) migrate - Run database migrations" -ForegroundColor Green
147
+ Write-Host " 14) migrate:fresh - Fresh migration with seeders" -ForegroundColor Green
148
+ Write-Host " 15) seed - Run database seeders" -ForegroundColor Green
149
+ Write-Host " 16) tinker - Start Laravel Tinker" -ForegroundColor Green
150
+ Write-Host ""
151
+ Write-Host "Maintenance:" -ForegroundColor Yellow
152
+ Write-Host " 17) cache:clear - Clear all caches" -ForegroundColor Green
153
+ Write-Host " 18) optimize - Optimize the application" -ForegroundColor Green
154
+ Write-Host " 19) logs - Tail Laravel logs" -ForegroundColor Green
155
+ Write-Host ""
156
+ Write-Host "Code Quality:" -ForegroundColor Yellow
157
+ Write-Host " 20) analyze - Run PHPStan static analysis" -ForegroundColor Green
158
+ Write-Host " 21) format - Format code with Pint" -ForegroundColor Green
159
+ Write-Host ""
160
+ Write-Host "Other:" -ForegroundColor Yellow
161
+ Write-Host " 22) routes - List all routes" -ForegroundColor Green
162
+ Write-Host " 23) queue - Start queue worker" -ForegroundColor Green
163
+ Write-Host " 24) docs - Open ACADEX documentation" -ForegroundColor Green
164
+ Write-Host ""
165
+ Write-Host " 0) Exit" -ForegroundColor Red
166
+ Write-Host ""
167
+ $choice = Read-Host "Select an option [0-24]"
168
+
169
+ switch ($choice) {
170
+ "1" { & $MyInvocation.MyCommand.Path setup }
171
+ "2" { & $MyInvocation.MyCommand.Path install:2fa }
172
+ "3" { & $MyInvocation.MyCommand.Path install:notif }
173
+ "4" { & $MyInvocation.MyCommand.Path check; Read-Host "Press Enter to continue" }
174
+ "5" { & $MyInvocation.MyCommand.Path serve }
175
+ "6" { & $MyInvocation.MyCommand.Path services }
176
+ "7" { & $MyInvocation.MyCommand.Path dev }
177
+ "8" { & $MyInvocation.MyCommand.Path build; Read-Host "Press Enter to continue" }
178
+ "9" { & $MyInvocation.MyCommand.Path ui; Read-Host "Press Enter to continue" }
179
+ "10" { & $MyInvocation.MyCommand.Path start }
180
+ "11" { & $MyInvocation.MyCommand.Path test; Read-Host "Press Enter to continue" }
181
+ "12" { & $MyInvocation.MyCommand.Path test:coverage; Read-Host "Press Enter to continue" }
182
+ "13" { & $MyInvocation.MyCommand.Path migrate; Read-Host "Press Enter to continue" }
183
+ "14" { & $MyInvocation.MyCommand.Path migrate:fresh; Read-Host "Press Enter to continue" }
184
+ "15" { & $MyInvocation.MyCommand.Path seed; Read-Host "Press Enter to continue" }
185
+ "16" { & $MyInvocation.MyCommand.Path tinker }
186
+ "17" { & $MyInvocation.MyCommand.Path cache:clear; Read-Host "Press Enter to continue" }
187
+ "18" { & $MyInvocation.MyCommand.Path optimize; Read-Host "Press Enter to continue" }
188
+ "19" { & $MyInvocation.MyCommand.Path logs }
189
+ "20" { & $MyInvocation.MyCommand.Path analyze; Read-Host "Press Enter to continue" }
190
+ "21" { & $MyInvocation.MyCommand.Path format; Read-Host "Press Enter to continue" }
191
+ "22" { & $MyInvocation.MyCommand.Path routes; Read-Host "Press Enter to continue" }
192
+ "23" { & $MyInvocation.MyCommand.Path queue }
193
+ "24" { & $MyInvocation.MyCommand.Path docs; Read-Host "Press Enter to continue" }
194
+ "0" { Write-Host "Goodbye!" -ForegroundColor Green; exit 0 }
195
+ default { Write-Host "Invalid option. Please try again." -ForegroundColor Red; Start-Sleep -Seconds 2 }
196
+ }
197
+ }
198
+ }
199
+
116
200
  # Check if a command exists
117
201
  function Test-CommandExists {
118
202
  param([string]$Cmd)
@@ -121,6 +205,10 @@ function Test-CommandExists {
121
205
 
122
206
  # Command handlers
123
207
  switch ($Command) {
208
+ "menu" {
209
+ Show-Menu
210
+ }
211
+
124
212
  "setup" {
125
213
  Write-Host "===========================================================" -ForegroundColor Cyan
126
214
  Write-Host " ACADEX - First Time Installation " -ForegroundColor Green
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acadex-cli",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
4
  "description": "A global CLI tool for managing Acadex projects with easy setup and automation",
5
5
  "main": "bin/acadex.js",
6
6
  "bin": {