stackhelx 1.0.0__py3-none-any.whl

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.
@@ -0,0 +1,323 @@
1
+ Metadata-Version: 2.5
2
+ Name: stackhelx
3
+ Version: 1.0.0
4
+ Summary: Orquestador de entornos de desarrollo locales: puertos, Docker, backend y frontend con un solo comando
5
+ Project-URL: Homepage, https://github.com/TicoraX/StackHelx
6
+ Project-URL: Repository, https://github.com/TicoraX/StackHelx
7
+ Project-URL: Issues, https://github.com/TicoraX/StackHelx/issues
8
+ Author: TicoraX
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 TicoraX
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: cli,devtools,docker,dx,orchestration,ports,stackhelx
32
+ Classifier: Development Status :: 5 - Production/Stable
33
+ Classifier: Environment :: Console
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Programming Language :: Python :: 3.13
42
+ Classifier: Topic :: Software Development
43
+ Classifier: Topic :: System :: Systems Administration
44
+ Classifier: Topic :: Utilities
45
+ Requires-Python: >=3.10
46
+ Requires-Dist: fastapi>=0.115
47
+ Requires-Dist: psutil>=6.0
48
+ Requires-Dist: pyyaml>=6.0
49
+ Requires-Dist: rich>=13
50
+ Requires-Dist: tomli>=2.0; python_version < '3.11'
51
+ Requires-Dist: typer>=0.12
52
+ Requires-Dist: uvicorn>=0.30
53
+ Provides-Extra: dev
54
+ Requires-Dist: httpx>=0.27; extra == 'dev'
55
+ Requires-Dist: pytest-xdist>=3; extra == 'dev'
56
+ Requires-Dist: pytest>=8; extra == 'dev'
57
+ Requires-Dist: ruff>=0.6; extra == 'dev'
58
+ Description-Content-Type: text/markdown
59
+
60
+ # StackHelx
61
+
62
+ [![pypi](https://img.shields.io/pypi/v/stackhelx)](https://pypi.org/project/stackhelx/)
63
+ [![tests](https://github.com/TicoraX/StackHelx/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/TicoraX/StackHelx/actions/workflows/ci.yml)
64
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
65
+ [![python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](pyproject.toml)
66
+
67
+ Orquestador de entornos de desarrollo locales. Un archivo en la raíz del
68
+ proyecto, un comando, y el stack entero arriba: puertos libres, Docker,
69
+ backend y frontend, sin cuatro terminales abiertas.
70
+
71
+ ## Instalación
72
+
73
+ ```bash
74
+ uv tool install stackhelx
75
+ # o
76
+ pipx install stackhelx
77
+ ```
78
+
79
+ Requiere Python 3.10 o superior. Funciona en Windows, macOS y Linux.
80
+
81
+ ## Comandos
82
+
83
+ | Comando | Qué hace |
84
+ |---|---|
85
+ | `stackhelx up` | Levanta el stack entero: libera puertos, arranca en orden y sigue los logs |
86
+ | `stackhelx down` | Baja lo que sobrevive a la terminal, o sea contenedores |
87
+ | `stackhelx serve` | Abre la interfaz web en `http://127.0.0.1:7666` |
88
+ | `stackhelx doctor` | Revisa qué puede impedir el arranque, sin arrancar nada |
89
+ | `stackhelx ports` | Estado de los puertos declarados |
90
+ | `stackhelx free 3000` | Cierra el proceso que ocupa un puerto, preguntando antes |
91
+ | `stackhelx free --all` | Lo mismo para todos los puertos de todos los proyectos registrados |
92
+ | `stackhelx switch fitness` | Baja los proyectos que le pisan los puertos a este, y lo levanta |
93
+ | `stackhelx open` | Abre en el navegador el primer servicio que conteste HTTP |
94
+ | `stackhelx init` | Congela lo detectado en un `stack.yaml` editable |
95
+ | `stackhelx add .` | Registra el proyecto para que aparezca en la interfaz |
96
+ | `stackhelx list` | Lista los proyectos registrados (alias: `ls`) |
97
+ | `stackhelx remove .` | Des-registra un proyecto (alias: `rm`) |
98
+ | `stackhelx run [tarea]` | Ejecuta scripts o pipelines de tareas del proyecto |
99
+ | `stackhelx share [target]` | Expone un servicio local a internet mediante un túnel seguro |
100
+ | `stackhelx clean` | Limpia Docker por categorías: contenedores parados, imágenes sin tag, redes sin usar y caché de build. Los volúmenes van aparte, con `--volumes`. Pregunta antes |
101
+ | `stackhelx mcp` | Inicia el servidor Model Context Protocol (MCP) sobre stdio para IA |
102
+ | `stackhelx test-stack` | Valida el `stack.yaml` sin arrancar nada: orden, dependencias y puertos |
103
+ | `stackhelx history` | Últimos arranques del proyecto, con duración y resultado |
104
+ | `stackhelx logs` | Logs del proyecto que corre en `serve`, con `--follow` para seguirlos |
105
+ | `stackhelx stats` | CPU y memoria de los servicios que corren en `serve` (alias: `top`) |
106
+ | `stackhelx version` | Versión instalada (también `--version`) |
107
+
108
+ `logs` y `stats` consultan al `stackhelx serve` que ya tengas abierto, así que
109
+ necesitan que esté corriendo. `history` y `test-stack` leen del disco y no.
110
+
111
+ Cada uno con `--help`.
112
+
113
+ ## Arrancar un stack
114
+
115
+ ```bash
116
+ stackhelx up
117
+ stackhelx up --profile backend # solo un subconjunto
118
+ stackhelx up --no-free # no tocar los puertos ocupados
119
+ stackhelx up --env-file .env.qa # carga ese .env antes de arrancar
120
+ ```
121
+
122
+ `--env-file` no reemplaza al `env_file:` de `stack.yaml`, se suma: carga el
123
+ archivo en el entorno del proceso antes de resolver el stack, así que lo ven
124
+ todos los servicios. Es para la corrida puntual contra otro entorno, sin editar
125
+ el archivo. A diferencia de `env_file:`, acepta rutas fuera de la raíz del
126
+ proyecto, porque acá la ruta la escribiste vos en la terminal y no viene de un
127
+ archivo de un repo ajeno.
128
+
129
+ Antes de arrancar libera los puertos declarados que tenga otro proceso, y
130
+ pregunta antes de cerrar cada uno. Los que ya publica Docker los saltea: ahí
131
+ no hay nada que liberar, el contenedor ya está arriba.
132
+
133
+ ```
134
+ demo stack.yaml
135
+ db | $ docker compose up -d postgres
136
+ db | listo (5432)
137
+ api | $ npm run dev
138
+ api | escuchando en 8080
139
+ api | listo (8080)
140
+ web | $ npm run dev
141
+ web | listo (3000)
142
+ Todo listo. Ctrl-C para apagar.
143
+ api | GET /health 200
144
+ web | ready in 412 ms
145
+ ```
146
+
147
+ Antes de arrancar nada revisa los puertos declarados. Si alguno está tomado
148
+ por un proceso huérfano, muestra cuál es y pregunta si cerrarlo. `Ctrl-C`
149
+ apaga los servicios en orden inverso, árbol de procesos incluido.
150
+
151
+ ## Sin stack.yaml
152
+
153
+ `stack.yaml` es opcional. Si no hay uno, StackHelx mira la raíz del proyecto:
154
+
155
+ | Encuentra | Arranca |
156
+ |---|---|
157
+ | `compose.yaml`, `compose.yml`, `docker-compose.yml`, `docker-compose.yaml` | un servicio por contenedor: `docker compose up -d <nombre>` |
158
+ | `manage.py` | `python manage.py runserver` |
159
+ | `fastapi` o `uvicorn` declarados, con un módulo que defina `app` | `uvicorn <módulo>:app --reload` |
160
+ | `package.json` con un script que sirva (`dev`, `start:dev`, `serve`, `start`) | `npm run dev`, con `pnpm`/`yarn`/`bun` según el lockfile o el campo `packageManager` |
161
+
162
+ ```
163
+ mi-app A:\Proyectos\mi-app
164
+ Sin stack.yaml. Detectado:
165
+ docker docker compose up -d 5433
166
+ web pnpm run dev al arrancar
167
+ Para congelarlo en un archivo editable: stackhelx init
168
+ Arrancar? [Y/n]
169
+ ```
170
+
171
+ Arranca en ese orden y encadena las dependencias: el frontend espera al
172
+ backend, el backend a los contenedores.
173
+
174
+ `stackhelx init` escribe lo detectado como `stack.yaml` para editarlo a mano.
175
+ No sobreescribe uno existente.
176
+
177
+ Dónde busca cada lenguaje y por qué reconoce eso y no otra cosa, en
178
+ [`docs/deteccion.md`](docs/deteccion.md).
179
+
180
+ ## stack.yaml
181
+
182
+ En la raíz del proyecto. StackHelx lo busca hacia arriba, así que podés correr
183
+ los comandos desde cualquier subdirectorio.
184
+
185
+ ```yaml
186
+ name: mi-proyecto
187
+
188
+ services:
189
+ db:
190
+ command: docker compose up -d postgres
191
+ port: 5432
192
+ detached: true # el comando termina, el servicio sigue vivo
193
+
194
+ api:
195
+ command: npm run dev
196
+ cwd: backend
197
+ port: 8080
198
+ needs: [db]
199
+ env:
200
+ DATABASE_URL: postgres://localhost:5432/app
201
+
202
+ web:
203
+ command: npm run dev
204
+ cwd: frontend
205
+ port: 3000
206
+ needs: [api]
207
+
208
+ profiles:
209
+ backend: [api] # arrastra db, que es su dependencia
210
+ ```
211
+
212
+ `command` es el único obligatorio. La referencia de todos los campos, los
213
+ healthchecks de `ready` y los perfiles heredados de un compose están en
214
+ [`docs/stack-yaml.md`](docs/stack-yaml.md).
215
+
216
+ ## Interfaz web
217
+
218
+ Cuando tenés varios proyectos, el CLI se queda corto: trabaja sobre el
219
+ directorio actual. La interfaz los muestra todos a la vez.
220
+
221
+ ```bash
222
+ stackhelx serve # abre http://127.0.0.1:7666
223
+ ```
224
+
225
+ Viene con la instalación, no hace falta nada más. Registrar proyectos se puede
226
+ desde la propia interfaz con `Explorar…`, o desde la terminal con
227
+ `stackhelx add .`.
228
+
229
+ Estado de cada servicio, arrancar y apagar stacks, liberar puertos tomados por
230
+ procesos ajenos, y logs en vivo por proyecto.
231
+
232
+ El detalle de cada control, y el modelo de seguridad del servidor local, en
233
+ [`docs/interfaz.md`](docs/interfaz.md).
234
+
235
+ ## Puertos
236
+
237
+ Revisar el estado de los puertos sin arrancar nada:
238
+
239
+ ```bash
240
+ stackhelx ports # los declarados en stack.yaml
241
+ stackhelx ports 3000 8080 # o los que le pases
242
+ ```
243
+
244
+ ```
245
+ PUERTO ESTADO PID PROCESO COMANDO
246
+ 3000 ocupado 24188 node.exe node C:\proj\frontend\node_modules\.bin\vite
247
+ 8080 libre - - -
248
+ 5432 ocupado 9012 com.docker.backend.exe
249
+ ```
250
+
251
+ Liberar un puerto tomado por un proceso zombie:
252
+
253
+ ```bash
254
+ stackhelx free 3000
255
+ ```
256
+
257
+ Muestra qué proceso lo ocupa y pide confirmación antes de cerrarlo. Si decís
258
+ que no, sugiere el siguiente puerto disponible.
259
+
260
+ Opciones: `--yes` salta la confirmación (para scripts), `--force` aplica
261
+ `kill()` cuando el proceso ignora la señal de terminación.
262
+
263
+ Después de un crash o un cambio de rama suele quedar más de uno colgado:
264
+
265
+ ```bash
266
+ stackhelx free --all
267
+ ```
268
+
269
+ Recorre los puertos declarados por todos los proyectos registrados, lista lo
270
+ que encuentre ocupado y pide una sola confirmación. Sale con código 1 si no
271
+ pudo cerrar alguno.
272
+
273
+ El CLI no sabe qué arrancaste vos: si tenés un stack levantado en otra
274
+ terminal, sus servicios aparecen en esa lista y también se cierran. Por eso la
275
+ muestra entera antes de tocar nada, y por eso la confirmación viene con "no"
276
+ por defecto. La interfaz web sí lo sabe, y ahí el botón "Liberar todos"
277
+ descarta lo que arrancó ella.
278
+
279
+ ## Qué no hace el kill switch
280
+
281
+ Estas reglas están en el código, no en la documentación:
282
+
283
+ - Nunca cierra PID 0, PID 4, el propio StackHelx ni un proceso padre suyo.
284
+ Matar tu propia terminal no es una función.
285
+ - Revalida la hora de creación del proceso entre el escaneo y el cierre. Los
286
+ PID se reciclan; sin ese chequeo terminás matando algo al azar.
287
+ - Manda `terminate()` y espera 5 segundos. `kill()` solo con `--force`
288
+ explícito, porque un `npm run dev` matado a lo bruto deja hijos huérfanos.
289
+ - Sin permisos, lo dice y corta. No reintenta escalando privilegios.
290
+ - Nunca cierra el proxy de Docker o de WSL. Un puerto publicado por un
291
+ contenedor no lo escucha el contenedor: lo escucha un proceso compartido por
292
+ todos, y cerrarlo apaga el motor entero. En vez de eso te dice qué contenedor
293
+ parar.
294
+
295
+ ## Otros comandos
296
+
297
+ `down`, `switch`, `doctor` y `open`, con qué revisa cada uno y por qué, en
298
+ [`docs/comandos.md`](docs/comandos.md).
299
+
300
+ ## Modelo de confianza
301
+
302
+ `stack.yaml` ejecuta comandos arbitrarios, igual que `package.json` o un
303
+ `Makefile`. StackHelx no lo sandboxea: sería teatro. Tratá un `stack.yaml`
304
+ de un repo ajeno con el mismo cuidado que sus scripts de build.
305
+
306
+ Sin `stack.yaml`, los comandos salen de la detección, y `scripts.dev` de un
307
+ `package.json` ajeno es igual de arbitrario. Por eso `up` muestra qué va a
308
+ ejecutar y pregunta antes, y `-y` es tuyo para saltarlo cuando ya lo leíste.
309
+
310
+ ## Desarrollo
311
+
312
+ ```bash
313
+ python -m venv .venv
314
+ .venv/bin/pip install -e ".[dev]" # .venv\Scripts\pip en Windows
315
+ pytest
316
+ ```
317
+
318
+ Los tests levantan sockets y procesos reales, sin mocks. Es lo único que
319
+ prueba de verdad un módulo cuyo trabajo es hablar con el sistema operativo.
320
+
321
+ ## Licencia
322
+
323
+ MIT
@@ -0,0 +1,26 @@
1
+ stackhelx/__init__.py,sha256=uyfGiipFnhOCQlqywx7wsgp6d-SYnqPqsPQd_xePZl8,23
2
+ stackhelx/__main__.py,sha256=Qd-f8z2Q2vpiEP2x6PBFsJrpACWDVxFKQk820MhFmHo,59
3
+ stackhelx/browse.py,sha256=y3vhu8HOofme4tCkh-NU-qgpTjX_YWnvalwBgYpM8iE,5796
4
+ stackhelx/cli.py,sha256=A7FujJGcFqux2aDix5wTdj_MI025lTKhhqCpF8MK4us,41525
5
+ stackhelx/config.py,sha256=tMN1prZVux3A7qZHw0K29yHxrZJbZvxMr-dol1DhND4,17012
6
+ stackhelx/detect.py,sha256=5-DJfO5MM1T37hDD3_x8GU14fMOGjKCfl9EebQHsOnU,39132
7
+ stackhelx/docker.py,sha256=mEbKU2pUhDoYwk9NeuZ7bvEWjyEdeQV7VE4wk4JdsRg,7743
8
+ stackhelx/doctor.py,sha256=qr3qQuDeHJIiGNkKbkGniCJxjkvPtt1XkNeqX5ynz0g,11673
9
+ stackhelx/guardrails.py,sha256=gwJKMzFEw5jsCtp9uF4MXZEokEbB6NMt5rb1-Yqo1Y0,1683
10
+ stackhelx/history.py,sha256=loJrfP3YJHGXXlGqYLyYB99Lq_JDzmHoq6CeDOHOpPs,2531
11
+ stackhelx/mcp.py,sha256=iQ_tKvYriWeUyPZ4xjQB3rV1L4q8RAXVUShjaoRgR9w,19077
12
+ stackhelx/ports.py,sha256=F2sx6d--89poqqjQN7DEk5sVhX8K9IprGpRW_HfBOJ4,14293
13
+ stackhelx/registry.py,sha256=5tlZiJ1zghxpp4KWf-zOjmCAzH1huhRoeEHC9vTmg9M,13349
14
+ stackhelx/runner.py,sha256=Imjw45tadn0SNyK05KooC5qQ61N7V9CXhjezVw8ZqvY,36244
15
+ stackhelx/scripts.py,sha256=-aFQwjIAu4xDnwT0VoxxGF_JsAWN38J9Kai13AoASRo,4634
16
+ stackhelx/server.py,sha256=BShuSGHeNlCsQVwUgIFkd5Pdg_ZvifyfQBxNFnRhBEg,75144
17
+ stackhelx/tunnel.py,sha256=wiUmrsdgsrR3bqOUUeBZnY4vEpXoOp4-tHdm7cMCM5k,7879
18
+ stackhelx/web/app.css,sha256=yg-rJcIh_xTvLfAaYZBXWT1Qeac8gFojpO2r4i9GKg8,39558
19
+ stackhelx/web/app.js,sha256=wBlAyeZvXaLYIz8QIgNEu_D02QvAS8ROHxMXhAv6x7Y,87233
20
+ stackhelx/web/index.html,sha256=OCKyYk2SO7-ZMcgpgMUPZQFoz969CVCjIhjCBVos2o4,17871
21
+ stackhelx/web/tokens.css,sha256=s8gNd0cI9ZM_zFUUp2_kRKwN45ppv8wJBwdA98sLa7o,3593
22
+ stackhelx-1.0.0.dist-info/METADATA,sha256=PF1X2aUem4Ju9E5DdaK3WJCfrybkoF8awYheLmajLf0,12728
23
+ stackhelx-1.0.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
24
+ stackhelx-1.0.0.dist-info/entry_points.txt,sha256=l1LQJHvHwCB7Xr8vn3PMfBcB4GCVU-tqYEYRTOm5AyI,72
25
+ stackhelx-1.0.0.dist-info/licenses/LICENSE,sha256=J-YF-HS26LOhmzHOeCUGqOGgMZ_cZg0m_Y4L_ox8bcI,1064
26
+ stackhelx-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ shx = stackhelx.cli:app
3
+ stackhelx = stackhelx.cli:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 TicoraX
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.