acadex-cli 1.0.4 → 1.0.5

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 (3) hide show
  1. package/acadex +56 -0
  2. package/acadex.ps1 +52 -0
  3. package/package.json +1 -1
package/acadex CHANGED
@@ -69,6 +69,7 @@ show_help() {
69
69
  echo -e " ${GREEN}phpmyadmin${NC} Start Apache & open phpMyAdmin (port 8080)"
70
70
  echo -e " ${GREEN}phpmyadmin:stop${NC} Stop Apache"
71
71
  echo -e " ${GREEN}docs${NC} Open ACADEX documentation"
72
+ echo -e " ${GREEN}uninstall${NC} Uninstall ACADEX CLI globally"
72
73
  echo ""
73
74
  echo -e "${YELLOW}Examples:${NC}"
74
75
  echo -e " acadex setup # First-time installation"
@@ -495,6 +496,61 @@ case "$1" in
495
496
  echo -e "${GREEN}Opening ACADEX documentation...${NC}"
496
497
  open "https://xaviworks.github.io/AcadexV3/"
497
498
  ;;
499
+ uninstall)
500
+ echo -e "${BLUE}╔══════════════════════════════════════════════════════════╗${NC}"
501
+ echo -e "${BLUE}║${NC} ${YELLOW}Uninstalling ACADEX CLI${NC} ${BLUE}║${NC}"
502
+ echo -e "${BLUE}╚══════════════════════════════════════════════════════════╝${NC}"
503
+ echo ""
504
+ echo -e "${YELLOW}This will remove ACADEX CLI from your system.${NC}"
505
+ echo ""
506
+ read -p "Are you sure you want to uninstall? (y/n): " -n 1 -r
507
+ echo ""
508
+
509
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
510
+ echo ""
511
+ echo -e "${BLUE}→${NC} Uninstalling npm package..."
512
+ npm uninstall -g acadex-cli
513
+
514
+ # Remove from /usr/local/bin if exists
515
+ if [ -f /usr/local/bin/acadex ]; then
516
+ echo -e "${BLUE}→${NC} Removing from /usr/local/bin..."
517
+ sudo rm -f /usr/local/bin/acadex
518
+ fi
519
+
520
+ # Remove from /opt/homebrew/bin if exists
521
+ if [ -f /opt/homebrew/bin/acadex ]; then
522
+ echo -e "${BLUE}→${NC} Removing from /opt/homebrew/bin..."
523
+ sudo rm -f /opt/homebrew/bin/acadex
524
+ fi
525
+
526
+ # Remove shell aliases
527
+ if [ -n "$ZSH_VERSION" ]; then
528
+ CONFIG_FILE="$HOME/.zshrc"
529
+ else
530
+ CONFIG_FILE="$HOME/.bashrc"
531
+ fi
532
+
533
+ if grep -q "alias acadex=" "$CONFIG_FILE" 2>/dev/null; then
534
+ echo -e "${BLUE}→${NC} Removing shell alias from $CONFIG_FILE..."
535
+ if [[ "$OSTYPE" == "darwin"* ]]; then
536
+ sed -i '' '/alias acadex=/d' "$CONFIG_FILE"
537
+ sed -i '' '/# ACADEX CLI/d' "$CONFIG_FILE"
538
+ else
539
+ sed -i '/alias acadex=/d' "$CONFIG_FILE"
540
+ sed -i '/# ACADEX CLI/d' "$CONFIG_FILE"
541
+ fi
542
+ fi
543
+
544
+ echo ""
545
+ echo -e "${GREEN}✓ ACADEX CLI has been uninstalled successfully!${NC}"
546
+ echo ""
547
+ echo -e "${YELLOW}Note: You may need to restart your terminal or run:${NC}"
548
+ echo -e " source ~/.zshrc ${YELLOW}(or ~/.bashrc)${NC}"
549
+ else
550
+ echo ""
551
+ echo -e "${YELLOW}Uninstall cancelled.${NC}"
552
+ fi
553
+ ;;
498
554
  help|--help|-h|"")
499
555
  show_help
500
556
  ;;
package/acadex.ps1 CHANGED
@@ -100,6 +100,8 @@ function Show-Help {
100
100
  Write-Host "Stop Apache (Windows)"
101
101
  Write-Host " docs " -ForegroundColor Green -NoNewline
102
102
  Write-Host "Open ACADEX documentation"
103
+ Write-Host " uninstall " -ForegroundColor Green -NoNewline
104
+ Write-Host "Uninstall ACADEX CLI globally"
103
105
  Write-Host ""
104
106
  Write-Host "Examples:" -ForegroundColor Yellow
105
107
  Write-Host " acadex setup # First-time installation"
@@ -587,6 +589,56 @@ switch ($Command) {
587
589
  Start-Process "https://xaviworks.github.io/AcadexV3/"
588
590
  }
589
591
 
592
+ "uninstall" {
593
+ Write-Host "===========================================================" -ForegroundColor Cyan
594
+ Write-Host " Uninstalling ACADEX CLI " -ForegroundColor Yellow
595
+ Write-Host "===========================================================" -ForegroundColor Cyan
596
+ Write-Host ""
597
+ Write-Host "This will remove ACADEX CLI from your system." -ForegroundColor Yellow
598
+ Write-Host ""
599
+
600
+ $confirmation = Read-Host "Are you sure you want to uninstall? (y/n)"
601
+
602
+ if ($confirmation -eq "y" -or $confirmation -eq "Y") {
603
+ Write-Host ""
604
+ Write-Host " -> Uninstalling npm package..." -ForegroundColor Cyan
605
+ npm uninstall -g acadex-cli
606
+
607
+ # Remove PowerShell profile function if exists
608
+ if (Test-Path $PROFILE) {
609
+ $profileContent = Get-Content $PROFILE -Raw
610
+ if ($profileContent -match "function acadex") {
611
+ Write-Host " -> Removing from PowerShell profile..." -ForegroundColor Cyan
612
+ $newContent = $profileContent -replace "(?ms)# ACADEX CLI.*?^}", ""
613
+ $newContent = $newContent -replace "(?ms)function acadex.*?^}", ""
614
+ $newContent = $newContent.Trim()
615
+ Set-Content -Path $PROFILE -Value $newContent
616
+ }
617
+ }
618
+
619
+ # Remove from common Windows paths
620
+ $commonPaths = @(
621
+ "$env:ProgramFiles\acadex",
622
+ "$env:LOCALAPPDATA\Programs\acadex"
623
+ )
624
+
625
+ foreach ($path in $commonPaths) {
626
+ if (Test-Path $path) {
627
+ Write-Host " -> Removing from $path..." -ForegroundColor Cyan
628
+ Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue
629
+ }
630
+ }
631
+
632
+ Write-Host ""
633
+ Write-Host "[OK] ACADEX CLI has been uninstalled successfully!" -ForegroundColor Green
634
+ Write-Host ""
635
+ Write-Host "Note: You may need to restart PowerShell for changes to take effect." -ForegroundColor Yellow
636
+ } else {
637
+ Write-Host ""
638
+ Write-Host "Uninstall cancelled." -ForegroundColor Yellow
639
+ }
640
+ }
641
+
590
642
  { $_ -in @("help", "--help", "-h", "", $null) } {
591
643
  Show-Help
592
644
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acadex-cli",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
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": {