ndev-stack 0.1.0__tar.gz → 0.2.0__tar.gz

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 (90) hide show
  1. ndev_stack-0.2.0/PKG-INFO +522 -0
  2. ndev_stack-0.2.0/README.md +501 -0
  3. ndev_stack-0.2.0/ndev/__init__.py +10 -0
  4. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/cli.py +1 -2
  5. ndev_stack-0.2.0/ndev/common/__init__.py +5 -0
  6. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/common/config.py +0 -2
  7. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/common/manifest.py +0 -1
  8. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/chroot/manager.py +0 -3
  9. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/chroot/packages.py +1 -1
  10. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/ctl.py +0 -1
  11. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/current.py +0 -1
  12. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/doctor.py +0 -2
  13. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/grok.py +0 -1
  14. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/list.py +0 -2
  15. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/logs.py +1 -1
  16. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/reload.py +0 -1
  17. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/restart.py +0 -1
  18. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/start.py +0 -1
  19. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/status.py +0 -1
  20. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/stop.py +0 -1
  21. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/update.py +0 -1
  22. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/vhost.py +2 -2
  23. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/php/extensions.py +0 -1
  24. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/php/installer.py +0 -1
  25. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/php/resolver.py +0 -1
  26. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/php/templates.py +0 -1
  27. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/runtime/mailpit.py +1 -3
  28. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/runtime/pma.py +3 -2
  29. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/runtime/upgrade.py +3 -3
  30. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/tui.py +180 -14
  31. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/main.py +2 -2
  32. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/cli.py +112 -5
  33. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/db.py +0 -1
  34. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/elevate.py +0 -1
  35. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/ext.py +0 -1
  36. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/grok.py +0 -1
  37. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/logs.py +6 -1
  38. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/mailpit.py +22 -12
  39. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/paths.py +3 -1
  40. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/php.py +104 -30
  41. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/pma.py +16 -6
  42. ndev_stack-0.2.0/ndev/win/core/redis_core.py +209 -0
  43. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/services.py +0 -2
  44. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/setup.py +10 -10
  45. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/upgrade.py +88 -16
  46. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/vhost.py +0 -1
  47. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/tui.py +213 -17
  48. ndev_stack-0.2.0/ndev_stack.egg-info/PKG-INFO +522 -0
  49. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev_stack.egg-info/SOURCES.txt +1 -0
  50. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/pyproject.toml +2 -2
  51. ndev_stack-0.1.0/PKG-INFO +0 -553
  52. ndev_stack-0.1.0/README.md +0 -532
  53. ndev_stack-0.1.0/ndev/__init__.py +0 -8
  54. ndev_stack-0.1.0/ndev/common/__init__.py +0 -3
  55. ndev_stack-0.1.0/ndev_stack.egg-info/PKG-INFO +0 -553
  56. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/__main__.py +0 -0
  57. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/common/constants.py +0 -0
  58. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/common/github.py +0 -0
  59. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/common/logger.py +0 -0
  60. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/common/utils.py +0 -0
  61. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/__init__.py +0 -0
  62. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/chroot/shell.py +0 -0
  63. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/cli.py +0 -0
  64. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/available.py +0 -0
  65. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/clean.py +0 -0
  66. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/db.py +0 -0
  67. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/install.py +0 -0
  68. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/mailpit.py +0 -0
  69. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/setup.py +0 -0
  70. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/uninstall.py +0 -0
  71. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/upgrade.py +0 -0
  72. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/commands/use.py +0 -0
  73. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/php/builder.py +0 -0
  74. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/php/downloader.py +0 -0
  75. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/runtime/fpm.py +0 -0
  76. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/runtime/process.py +0 -0
  77. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/linux/runtime/sockets.py +0 -0
  78. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/tui.py +0 -0
  79. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/__init__.py +0 -0
  80. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/commands/__init__.py +0 -0
  81. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/__init__.py +0 -0
  82. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/fcgi.py +0 -0
  83. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/core/mkcert.py +0 -0
  84. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/templates/vhost.conf.tmpl +0 -0
  85. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev/win/templates/vhost_ssl.conf.tmpl +0 -0
  86. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev_stack.egg-info/dependency_links.txt +0 -0
  87. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev_stack.egg-info/entry_points.txt +0 -0
  88. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev_stack.egg-info/requires.txt +0 -0
  89. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/ndev_stack.egg-info/top_level.txt +0 -0
  90. {ndev_stack-0.1.0 → ndev_stack-0.2.0}/setup.cfg +0 -0
@@ -0,0 +1,522 @@
1
+ Metadata-Version: 2.4
2
+ Name: ndev-stack
3
+ Version: 0.2.0
4
+ Summary: Cross-platform developer stack manager for PHP, FastCGI/PHP-FPM, MariaDB, Redis, Nginx, SSL, and Mailpit on Linux and Windows
5
+ Author-email: Ankit Karan <ankit.karan99@gmail.com>
6
+ Project-URL: Homepage, https://github.com/ankitkaran99/ndev
7
+ Project-URL: Repository, https://github.com/ankitkaran99/ndev
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: POSIX :: Linux
10
+ Classifier: Operating System :: Microsoft :: Windows
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: click>=8.1.0
14
+ Requires-Dist: typer>=0.9.0
15
+ Requires-Dist: rich>=13.0.0
16
+ Requires-Dist: textual>=0.40.0
17
+ Requires-Dist: httpx>=0.24.0
18
+ Requires-Dist: filelock>=3.12.0
19
+ Requires-Dist: packaging>=23.0
20
+ Requires-Dist: jinja2>=3.1.0
21
+
22
+ # ndev
23
+
24
+ <p align="center">
25
+ <h1 align="center">ndev</h1>
26
+ <p align="center"><strong>Universal, Zero-Config Local PHP & Web Development Stack for Windows and Linux.</strong></p>
27
+ </p>
28
+
29
+ <p align="center">
30
+ <a href="https://pypi.org/project/ndev-stack/"><img src="https://img.shields.io/pypi/v/ndev-stack.svg?color=blue" alt="PyPI Version"></a>
31
+ <a href="https://pypi.org/project/ndev-stack/"><img src="https://img.shields.io/pypi/pyversions/ndev-stack.svg" alt="Python Versions"></a>
32
+ <a href="https://github.com/ankitkaran99/ndev/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
33
+ </p>
34
+
35
+ <p align="center">
36
+ <img src="ui.PNG" alt="ndev Interactive Terminal UI Dashboard" width="90%">
37
+ </p>
38
+
39
+ ---
40
+
41
+ `ndev` is an all-in-one developer environment manager that isolates, orchestrates, and runs multi-version **PHP** runtimes, **Nginx** web server, **MariaDB / MySQL**, **Redis** in-memory store, **phpMyAdmin**, **Mailpit** email sandbox, local **SSL** certificates (`mkcert`), and public HTTP tunnels (`ngrok`) on **Windows 10/11** and **Linux** (Debian/Ubuntu).
42
+
43
+ ---
44
+
45
+ ## Key Features
46
+
47
+ - **Multi-Version PHP Environment**:
48
+ - **Windows**: Zero-compilation prebuilt official binaries from `windows.php.net` (PHP 5.6 – 8.5, Thread-Safe & Non-Thread-Safe, x64/x86).
49
+ - **Linux**: Sandboxed, unprivileged source compilation with `bubblewrap` and self-healing multiarch library paths.
50
+ - **Process Orchestration & FastCGI / FPM**:
51
+ - **Windows**: Multi-process `php-cgi.exe` FastCGI worker pools load-balanced through Nginx `upstream` blocks.
52
+ - **Linux**: Native `php-fpm` worker daemons over isolated Unix sockets (`~/.ndev/run/php<ver>.sock`).
53
+ - **Interactive Asynchronous TUI Dashboard (`ndev ui`)**:
54
+ - Full-screen real-time terminal UI built with Textual for live monitoring, batch start/stop/restart, on-the-fly CLI PHP version switching, folder-picker virtual host creator, and live log tailing.
55
+ - **Automated Nginx Virtual Hosts (`ndev vhost`)**:
56
+ - Generates Nginx server blocks with custom FastCGI upstreams, HTTP $\rightarrow$ HTTPS redirects, trusted local SSL certificates, and hosts file mappings.
57
+ - **In-Memory Store (`ndev redis`)**:
58
+ - Native background Redis server management (`6379`) with interactive `redis-cli` terminal integration.
59
+ - **Local Email Sandbox (`ndev mailpit`)**:
60
+ - Embedded zero-dependency SMTP email catcher (`127.0.0.1:1025`) and web inbox (`http://127.0.0.1:8025`).
61
+ - **Database & Web Administration (`ndev db` & `ndev pma`)**:
62
+ - Portable MariaDB server (`3306`) with user/database management CLI tools and local phpMyAdmin (`http://127.0.0.1:8080`).
63
+ - **Single-Command Stack Upgrader (`ndev upgrade`)**:
64
+ - Automated version scanning and non-destructive upgrading for Nginx, MariaDB, Redis, Mailpit, phpMyAdmin, mkcert, and Composer.
65
+
66
+ ---
67
+
68
+ ## Architecture & Platform Mapping
69
+
70
+ ```text
71
+ ndev/
72
+ ├── main.py # Cross-platform dispatcher & runtime detector
73
+ ├── common/ # Shared utilities, configs, logger, GitHub API
74
+ ├── win/ # Windows native subsystem (FastCGI, Shims, Click CLI, TUI)
75
+ │ ├── core/ # php, services, fcgi, vhost, db, redis_core, mailpit, pma, upgrade
76
+ │ └── templates/ # Nginx virtual host configuration templates
77
+ └── linux/ # Linux native subsystem (PHP-FPM, Typer CLI, TUI, Chroot)
78
+ ├── php/ # Source resolver, downloader, extensions, builder
79
+ ├── chroot/ # Bubblewrap sandbox manager
80
+ └── runtime/ # FPM, PMA, Mailpit, and systemd daemons
81
+ ```
82
+
83
+ | Subsystem | Windows 10/11 (`ndev-win`) | Linux Debian/Ubuntu (`ndev-linux`) |
84
+ | :--- | :--- | :--- |
85
+ | **PHP Distribution** | Precompiled binaries from `windows.php.net` | Compiles from official source via `bubblewrap` sandbox |
86
+ | **Process Model** | Multi-worker `php-cgi.exe` pools via Nginx `upstream` | Native `php-fpm` daemons over Unix domain sockets |
87
+ | **CLI & PATH** | Global batch shims in `%USERPROFILE%\.ndev\shims\` | Symlinks in `~/.local/bin/` |
88
+ | **Privilege Elevation**| Win32 `ShellExecuteExW` (`runas`) only for `hosts` | `sudo` for Nginx and `/etc/hosts` |
89
+ | **Web Server** | Portable Nginx in `%USERPROFILE%\.ndev\nginx\` | System Nginx via `apt install nginx` |
90
+ | **Database** | Portable MariaDB in `%USERPROFILE%\.ndev\mariadb\` | System MariaDB via `apt install mariadb-server` |
91
+ | **In-Memory Cache** | Portable Redis in `%USERPROFILE%\.ndev\redis\` | System Redis via `apt install redis-server` |
92
+ | **Email Sandbox** | Standalone prebuilt Mailpit binary | Standalone prebuilt Mailpit binary |
93
+ | **phpMyAdmin** | Served via PHP CLI server (`http://127.0.0.1:8080`) | Served via PHP CLI server (`http://127.0.0.1:8080`) |
94
+ | **Local SSL** | Standalone `mkcert.exe` in `shims\` | System `mkcert` package via `apt` |
95
+ | **TUI Dashboard** | Asynchronous Textual TUI (`ndev ui`) | Asynchronous Textual TUI (`ndev ui`) |
96
+
97
+ ---
98
+
99
+ ## Directory Structure & Layout
100
+
101
+ ### Windows Layout (`%USERPROFILE%\.ndev`)
102
+ ```text
103
+ %USERPROFILE%\.ndev\
104
+ ├── certs\ # Local SSL certificates and cacert.pem CA bundle
105
+ ├── downloads\ # Cached zip downloads
106
+ ├── mariadb\ # Portable MariaDB installation & data directory
107
+ │ ├── bin\ # mysqld.exe, mysql.exe, mysqldump.exe
108
+ │ └── data\ # Database storage
109
+ ├── nginx\ # Portable Nginx installation
110
+ │ ├── conf\
111
+ │ │ ├── nginx.conf # Main Nginx config (includes ndev-vhosts/*.conf)
112
+ │ │ └── ndev-vhosts\ # Virtual host configurations (*.conf)
113
+ │ ├── logs\ # Nginx access/error logs per virtual host
114
+ │ └── temp\ # FastCGI and proxy client temporary body storage
115
+ ├── php\
116
+ │ └── <version>\ # Extracted PHP binaries (php.exe, php-cgi.exe, php.ini, ext/)
117
+ ├── pma\ # Standalone phpMyAdmin installation & config.inc.php
118
+ ├── redis\ # Portable Redis server and redis-cli binaries
119
+ ├── run\ # Active PID and FastCGI worker state files (JSON)
120
+ ├── shims\ # Global batch shims for PATH (php, composer, mysql, redis-cli, mailpit, ndev, etc.)
121
+ ├── mailpit.db # Persistent message database for Mailpit
122
+ └── config.json # Global configuration (ports, worker counts)
123
+ ```
124
+
125
+ ### Linux Layout (`~/.ndev`)
126
+ ```text
127
+ ~/.ndev/
128
+ ├── bin/ # Standalone binaries (mailpit)
129
+ ├── builds/ # Source tarballs and compilation build directories
130
+ ├── cache/ # Download and build cache
131
+ ├── certs/ # Local SSL certificates and mkcert root CA
132
+ ├── chroot/ # Sandboxed development packages and build root
133
+ ├── downloads/ # Downloaded source archives
134
+ ├── logs/ # Service and daemon logs (pma.log, mailpit.log, etc.)
135
+ ├── php/
136
+ │ └── <version>/ # Compiled PHP installations (bin/, sbin/, etc/php.ini, etc/php-fpm.d/)
137
+ ├── phpmyadmin/ # Standalone phpMyAdmin installation & config.inc.php
138
+ ├── run/ # Active PID and Unix domain socket files (*.sock, *.pid)
139
+ ├── current # Symlink pointing to the currently active PHP version directory
140
+ ├── mailpit.db # Persistent message database for Mailpit
141
+ └── config.toml # Global build and runtime configuration
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Installation
147
+
148
+ ### Standard Installation via PyPI
149
+
150
+ Install `ndev-stack` using `pip` or `pipx`:
151
+
152
+ ```bash
153
+ # Using pip
154
+ pip install ndev-stack
155
+
156
+ # Or using pipx (isolated application environment)
157
+ pipx install ndev-stack
158
+ ```
159
+
160
+ > **Note**: The package is published on PyPI as `ndev-stack`, which provides the global commands `ndev`, `ndev-win`, and `ndev-linux`.
161
+
162
+ ### Development / Source Installation
163
+
164
+ ```bash
165
+ git clone https://github.com/ankitkaran99/ndev.git
166
+ cd ndev
167
+ pip install -e .
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Quick Start Guide
173
+
174
+ ### Windows 10 / 11
175
+
176
+ ```powershell
177
+ # 1. Install ndev-stack
178
+ pip install ndev-stack
179
+
180
+ # 2. Download and configure portable stack (Nginx, MariaDB, Redis, mkcert, Mailpit, Composer)
181
+ ndev setup
182
+
183
+ # 3. Add shims to user PATH (one-time setup for global CLI access)
184
+ [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\.ndev\shims", "User")
185
+ $env:Path += ";$env:USERPROFILE\.ndev\shims"
186
+
187
+ # 4. Verify installation & launch interactive dashboard
188
+ ndev doctor
189
+ ndev ui
190
+ ```
191
+
192
+ ### Linux (Debian / Ubuntu)
193
+
194
+ ```bash
195
+ # 1. Install system build dependencies
196
+ sudo apt update
197
+ sudo apt install -y bubblewrap build-essential pkg-config nginx mkcert redis-server default-mysql-client
198
+ mkcert -install
199
+
200
+ # 2. Install ndev-stack
201
+ pip install ndev-stack
202
+
203
+ # 3. Bootstrap runtime environment and shims
204
+ ndev setup
205
+ export PATH="$HOME/.local/bin:$PATH"
206
+
207
+ # 4. Verify installation & launch interactive dashboard
208
+ ndev doctor
209
+ ndev ui
210
+ ```
211
+
212
+ ---
213
+
214
+ ## Quick Command Reference
215
+
216
+ | Command | Action |
217
+ |---|---|
218
+ | `ndev ui` | Launch real-time Textual TUI dashboard (*aliases: `tui`, `dashboard`*) |
219
+ | `ndev available` | List available PHP releases (`--archives` for legacy versions) |
220
+ | `ndev install <ver>` | Install / compile a PHP version (`8.4`, `8.3`, `7.4`, etc.) |
221
+ | `ndev use <ver>` | Switch active CLI PHP version on PATH |
222
+ | `ndev current` | Show active CLI PHP version |
223
+ | `ndev list` | List installed PHP versions and daemon / worker pool status |
224
+ | `ndev start <target>` | Start service or pool (`all`, `nginx`, `mariadb`, `redis`, `pma`, `mailpit`, `<ver>`) |
225
+ | `ndev stop <target>` | Stop service or pool (`all`, `nginx`, `mariadb`, `redis`, `pma`, `mailpit`, `<ver>`) |
226
+ | `ndev restart <target>`| Restart service or pool (`all`, `nginx`, `mariadb`, `redis`, `pma`, `mailpit`, `<ver>`) |
227
+ | `ndev reload nginx` | Reload Nginx configuration without downtime |
228
+ | `ndev status` | View real-time service status dashboard |
229
+ | `ndev ctl` | Interactive terminal service control menu |
230
+ | `ndev vhost` | Interactive virtual host creation wizard with local SSL |
231
+ | `ndev vhost-list` | List all configured virtual hosts |
232
+ | `ndev vhost-remove` | Remove virtual host and clean up hosts file |
233
+ | `ndev db` | Interactive SQL database management wizard |
234
+ | `ndev redis` | Manage Redis server or launch interactive `redis-cli` |
235
+ | `ndev mailpit` | Manage local email sandbox (`install`, `start`, `stop`, `launch`, `open`) |
236
+ | `ndev pma` | Manage phpMyAdmin background service (`http://127.0.0.1:8080`) |
237
+ | `ndev ext` | Manage PECL extensions (`list`, `install`, `enable`, `disable`) |
238
+ | `ndev grok` | Public HTTP tunneling for local virtual hosts via ngrok |
239
+ | `ndev upgrade` | Check for and upgrade stack components (Nginx, MariaDB, Redis, PMA, Mailpit, mkcert, Composer) |
240
+ | `ndev upgrade --check` | Check component versions against upstream releases without upgrading |
241
+ | `ndev shell` | Interactive developer subshell pre-loaded with PHP/Composer/MySQL/Redis on PATH |
242
+ | `ndev doctor` | Run environment diagnostics and health checks |
243
+ | `ndev logs` | View and tail service and virtual host logs |
244
+ | `ndev clean` | Clean up downloads cache and stale runtime state |
245
+
246
+ ---
247
+
248
+ ## Detailed Usage Guide
249
+
250
+ ### 1. Interactive Terminal UI Dashboard (`ndev ui`)
251
+
252
+ Launch the modern, responsive Textual TUI dashboard for real-time monitoring and process control:
253
+
254
+ ```bash
255
+ ndev ui
256
+ # Aliases: ndev tui, ndev dashboard
257
+ ```
258
+
259
+ <p align="center">
260
+ <img src="ui.png" alt="ndev TUI Dashboard" width="90%">
261
+ </p>
262
+
263
+ - **Live Status Grid**: Monitor real-time status, PIDs, and active ports for Nginx, MariaDB, Redis, PMA, Mailpit, and PHP worker pools.
264
+ - **One-Click Component Setup & Upgrades**: Install uninstalled services (**Redis**, **PMA**, **Mailpit**, **Nginx**, **MariaDB**, **mkcert**, **Composer**) or upgrade existing components with single-click UI actions.
265
+ - **Interactive Virtual Host Manager**: Create new virtual hosts (`+ Create VHost`) with automatic local SSL (`mkcert`) and an integrated folder-picker dialog.
266
+ - **PHP Runtime Management**: Install any PHP version (`+ Install PHP`), uninstall versions (`✖ Uninstall Selected`), or change the active CLI PHP version via dropdown.
267
+ - **Batch Actions**: One-click **Start All**, **Stop All**, **Restart All**, and **Reload Nginx** from the persistent sidebar.
268
+ - **Integrated Log Tail Viewer**: Select and inspect live logs for Nginx, MariaDB, Redis, PHP, and Virtual Hosts.
269
+
270
+ ---
271
+
272
+ ### 2. PHP Version Management
273
+
274
+ ```bash
275
+ # List available PHP releases (from php.net / windows.php.net)
276
+ ndev available
277
+ ndev available --archives # include legacy releases (5.6 - 7.3)
278
+
279
+ # Install a PHP version (prebuilt on Windows, source-compiled on Linux)
280
+ ndev install 8.4
281
+
282
+ # List locally installed PHP versions and daemon/pool status
283
+ ndev list
284
+
285
+ # Switch globally active CLI PHP version
286
+ ndev use 8.4
287
+
288
+ # Show current active CLI PHP version
289
+ ndev current
290
+
291
+ # Uninstall a PHP version
292
+ ndev uninstall 7.4
293
+ ```
294
+
295
+ ---
296
+
297
+ ### 3. Service & Process Management
298
+
299
+ ```bash
300
+ # Start / Stop / Restart a PHP pool or individual service
301
+ ndev start 8.4
302
+ ndev stop 8.4
303
+ ndev restart 8.4
304
+
305
+ # Control core services
306
+ ndev start nginx
307
+ ndev start mariadb
308
+ ndev start redis
309
+ ndev start pma
310
+ ndev start mailpit
311
+
312
+ # Batch operations
313
+ ndev start all
314
+ ndev stop all
315
+ ndev restart all
316
+
317
+ # Reload Nginx configuration without downtime
318
+ ndev reload nginx
319
+
320
+ # View service status
321
+ ndev status
322
+ ```
323
+
324
+ ---
325
+
326
+ ### 4. Virtual Host Management (`vhost`)
327
+
328
+ Create and manage local Nginx sites mapped to `127.0.0.1`:
329
+
330
+ ```bash
331
+ # Interactive wizard (auto-prompts for domain, document root, PHP version, and SSL)
332
+ ndev vhost
333
+
334
+ # Create a standard HTTP virtual host
335
+ ndev vhost --domain project.local --root /path/to/project --php 8.4
336
+
337
+ # Create an HTTPS virtual host with trusted local SSL certificates (mkcert)
338
+ ndev vhost --domain project.local --root /path/to/project --php 8.4 --ssl
339
+
340
+ # List all configured virtual hosts
341
+ ndev vhost-list
342
+
343
+ # Remove a virtual host (removes Nginx conf and cleans hosts file)
344
+ ndev vhost-remove --domain project.local
345
+ ```
346
+
347
+ ---
348
+
349
+ ### 5. Redis In-Memory Store (`redis`)
350
+
351
+ Manage the local Redis server and launch the interactive `redis-cli`:
352
+
353
+ > [!TIP]
354
+ > **Redis Connection Defaults**:
355
+ > * **Host**: `127.0.0.1` or `localhost`
356
+ > * **Port**: `6379`
357
+ > * **Password**: None (default)
358
+
359
+ ```bash
360
+ # Start Redis server
361
+ ndev redis start
362
+ ndev start redis
363
+
364
+ # Check Redis status
365
+ ndev redis status
366
+ ndev status redis
367
+
368
+ # Open interactive redis-cli terminal
369
+ ndev redis cli
370
+
371
+ # Stop or restart Redis server
372
+ ndev redis stop
373
+ ndev redis restart
374
+ ```
375
+
376
+ #### Laravel / Symfony / WordPress Configuration:
377
+ ```env
378
+ REDIS_HOST=127.0.0.1
379
+ REDIS_PASSWORD=null
380
+ REDIS_PORT=6379
381
+ ```
382
+
383
+ ---
384
+
385
+ ### 6. SQL Database Manager (`db`) & phpMyAdmin (`pma`)
386
+
387
+ Manage MySQL/MariaDB databases, users, and web administration:
388
+
389
+ > [!TIP]
390
+ > **Default MariaDB / MySQL Credentials**:
391
+ > * **Host**: `127.0.0.1` or `localhost`
392
+ > * **Port**: `3306`
393
+ > * **Username**: `root`
394
+ > * **Password**: `root` (Windows) / system auth (Linux)
395
+ > * **phpMyAdmin URL**: [http://127.0.0.1:8080](http://127.0.0.1:8080)
396
+
397
+ ```bash
398
+ # Launch interactive database management wizard
399
+ ndev db
400
+
401
+ # Create database and user
402
+ ndev db create-db mydb --owner myuser
403
+ ndev db create-user myuser --new-password secret --grant-db mydb
404
+
405
+ # Export & import database dumps
406
+ ndev db export-db mydb -o backup.sql
407
+ ndev db import-db mydb backup.sql
408
+
409
+ # Start phpMyAdmin web UI
410
+ ndev start pma
411
+ ndev pma
412
+ ```
413
+
414
+ ---
415
+
416
+ ### 7. Local Email Sandbox (`mailpit`)
417
+
418
+ Catch every outgoing e-mail your local applications send using [Mailpit](https://github.com/axllent/mailpit):
419
+
420
+ > [!TIP]
421
+ > **SMTP & Web UI Defaults**:
422
+ > * **SMTP Server**: `127.0.0.1:1025`
423
+ > * **Web Inbox**: [http://127.0.0.1:8025](http://127.0.0.1:8025)
424
+ > * No authentication required — all emails are safely intercepted locally.
425
+
426
+ ```bash
427
+ # Start Mailpit (auto-installs if not present)
428
+ ndev mailpit start
429
+ ndev start mailpit
430
+
431
+ # Open Web UI in default browser
432
+ ndev mailpit launch
433
+ ndev mailpit open
434
+
435
+ # Stop or restart Mailpit
436
+ ndev mailpit stop
437
+ ndev mailpit restart
438
+ ```
439
+
440
+ #### Configuring Mailpit in your Project:
441
+
442
+ **Laravel (`.env`):**
443
+ ```env
444
+ MAIL_MAILER=smtp
445
+ MAIL_HOST=127.0.0.1
446
+ MAIL_PORT=1025
447
+ MAIL_USERNAME=null
448
+ MAIL_PASSWORD=null
449
+ MAIL_ENCRYPTION=null
450
+ ```
451
+
452
+ **PHP (`php.ini`):**
453
+ ```ini
454
+ [mail function]
455
+ SMTP = 127.0.0.1
456
+ smtp_port = 1025
457
+ ```
458
+
459
+ ---
460
+
461
+ ### 8. Stack Upgrade Engine (`upgrade`)
462
+
463
+ Scan for and upgrade stack components (Nginx, MariaDB, Redis, PMA, Mailpit, mkcert, Composer) safely against latest upstream releases:
464
+
465
+ ```bash
466
+ # Check for available updates across all stack components
467
+ ndev upgrade --check
468
+
469
+ # Upgrade all components to latest stable releases
470
+ ndev upgrade
471
+
472
+ # Upgrade a specific component
473
+ ndev upgrade redis
474
+ ndev upgrade mailpit
475
+ ndev upgrade pma
476
+ ```
477
+
478
+ ---
479
+
480
+ ### 9. Diagnostics & Developer Tools
481
+
482
+ ```bash
483
+ # Run full environment health check
484
+ ndev doctor
485
+
486
+ # Launch pre-configured developer subshell
487
+ ndev shell
488
+
489
+ # Tail live logs for services or virtual hosts
490
+ ndev logs
491
+ ndev logs 8.4
492
+ ndev logs nginx
493
+
494
+ # Tunnel local virtual host to public web via ngrok
495
+ ndev grok
496
+
497
+ # Clean download cache and temporary files
498
+ ndev clean
499
+ ```
500
+
501
+ ---
502
+
503
+ ## Configuration Files
504
+
505
+ ### Windows
506
+ * **Global Settings**: `%USERPROFILE%\.ndev\config.json`
507
+ * **PHP Configuration**: `%USERPROFILE%\.ndev\php\<version>\php.ini`
508
+ * **Nginx Main Config**: `%USERPROFILE%\.ndev\nginx\conf\nginx.conf`
509
+ * **Virtual Host Configs**: `%USERPROFILE%\.ndev\nginx\conf\ndev-vhosts\*.conf`
510
+ * **FastCGI Worker Pools**: Base port `13000` with 4 workers per PHP version (customizable in `config.json`).
511
+
512
+ ### Linux
513
+ * **Global Settings**: `~/.ndev/config.toml`
514
+ * **PHP Configuration**: `~/.ndev/php/<version>/etc/php.ini`
515
+ * **PHP Extensions**: `~/.ndev/php/<version>/etc/conf.d/<ext>.ini`
516
+ * **PHP-FPM Pool Config**: `~/.ndev/php/<version>/etc/php-fpm.d/www.conf`
517
+
518
+ ---
519
+
520
+ ## License
521
+
522
+ MIT License. See [LICENSE](LICENSE) for more details.