zpx 0.0.1__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.
zpx/__init__.py ADDED
@@ -0,0 +1,9 @@
1
+ """zpx · CLI de ZPX Forge."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
5
+ try:
6
+ # Una sola fuente de verdad: la versión de pyproject.toml
7
+ __version__ = version("zpx")
8
+ except PackageNotFoundError: # ejecutando desde el código sin instalar
9
+ __version__ = "0.0.0+local"
zpx/cli.py ADDED
@@ -0,0 +1,59 @@
1
+ """zpx · CLI de ZPX Forge.
2
+
3
+ F0: `zpx version` y `zpx health`. En F5 llegan login (device flow), connect, clone, start, done, ask y audit.
4
+ """
5
+
6
+ import argparse
7
+ import json
8
+ import os
9
+ import sys
10
+
11
+ import httpx
12
+
13
+ from zpx import __version__
14
+
15
+ DEFAULT_URL = os.environ.get("ZPX_URL", "https://zpxforge.com")
16
+
17
+
18
+ def cmd_version(_args) -> int:
19
+ print(f"zpx {__version__}")
20
+ return 0
21
+
22
+
23
+ def cmd_health(args) -> int:
24
+ url = f"{args.url.rstrip('/')}/api/v1/health"
25
+ try:
26
+ r = httpx.get(url, timeout=10, follow_redirects=True)
27
+ data = r.json()
28
+ except (httpx.HTTPError, ValueError) as exc:
29
+ print(f"✘ No pude consultar {url}: {exc}", file=sys.stderr)
30
+ return 1
31
+ if args.json:
32
+ print(json.dumps(data, indent=2, ensure_ascii=False))
33
+ else:
34
+ mark = {"ok": "✔", "degraded": "⚠"}.get(data.get("status"), "✘")
35
+ print(f"{mark} ZPX Forge {data.get('version')} ({data.get('env')}) · {data.get('status')}")
36
+ for name, check in (data.get("checks") or {}).items():
37
+ detail = f"{check.get('ms')} ms" if check.get("ok") else check.get("error")
38
+ print(f" {'✔' if check.get('ok') else '✘'} {name}: {detail}")
39
+ return 0 if data.get("status") in {"ok", "degraded"} else 1
40
+
41
+
42
+ def build_parser() -> argparse.ArgumentParser:
43
+ parser = argparse.ArgumentParser(prog="zpx", description="CLI de ZPX Forge")
44
+ sub = parser.add_subparsers(dest="command", required=True)
45
+ sub.add_parser("version", help="versión del CLI").set_defaults(func=cmd_version)
46
+ h = sub.add_parser("health", help="salud de la plataforma")
47
+ h.add_argument("--url", default=DEFAULT_URL, help=f"URL de ZPX Forge (por defecto {DEFAULT_URL})")
48
+ h.add_argument("--json", action="store_true", help="salida en JSON")
49
+ h.set_defaults(func=cmd_health)
50
+ return parser
51
+
52
+
53
+ def main(argv: list[str] | None = None) -> int:
54
+ args = build_parser().parse_args(argv)
55
+ return args.func(args)
56
+
57
+
58
+ if __name__ == "__main__":
59
+ sys.exit(main())
@@ -0,0 +1,43 @@
1
+ Metadata-Version: 2.3
2
+ Name: zpx
3
+ Version: 0.0.1
4
+ Summary: CLI de ZPX Forge: conecta tu Claude Code o Codex con tu fábrica de software
5
+ Keywords: zpx,zpx-forge,ai-agents,claude-code,codex,cli
6
+ Author: Zynplex
7
+ Classifier: Development Status :: 2 - Pre-Alpha
8
+ Classifier: Environment :: Console
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Topic :: Software Development
12
+ Requires-Dist: httpx>=0.28
13
+ Requires-Python: >=3.10
14
+ Project-URL: Homepage, https://zpxforge.com
15
+ Project-URL: Documentation, https://zpxforge.com/docs
16
+ Description-Content-Type: text/markdown
17
+
18
+ # zpx
19
+
20
+ CLI de [ZPX Forge](https://zpxforge.com): conecta tu Claude Code o Codex con tu fábrica de software.
21
+
22
+ > Versión temprana (0.0.x). Hoy incluye `zpx health` y `zpx version`; los comandos para agentes
23
+ > (`login`, `projects`, `tasks`…) llegan en próximas versiones.
24
+
25
+ ## Uso
26
+
27
+ ```bash
28
+ uvx zpx health # probar sin instalar nada
29
+ pipx install zpx # instalarlo de forma permanente
30
+ uv tool install zpx # o con uv
31
+ pip install zpx # o con pip, dentro de un entorno virtual
32
+ ```
33
+
34
+ ```bash
35
+ zpx version # versión del CLI
36
+ zpx health # salud de la plataforma
37
+ zpx health --json # en JSON
38
+ zpx health --url http://localhost:3000 # otra instancia
39
+ ```
40
+
41
+ La URL por defecto es `https://zpxforge.com`; también se puede fijar con la variable `ZPX_URL`.
42
+
43
+ Documentación: https://zpxforge.com/docs
@@ -0,0 +1,6 @@
1
+ zpx/__init__.py,sha256=u5tezIjvQ0w4Q44XTnEOApfo40wLnRo_QCCvPfVX33M,300
2
+ zpx/cli.py,sha256=fsjXTsyWBcYVOGQ-qA2pB_SKx2Y1-mgn3rUrAzY8Uzc,1998
3
+ zpx-0.0.1.dist-info/WHEEL,sha256=8ZlpUMJ7mlDirmlHRhDirEx_nPnARrwDjeE92mlk68E,81
4
+ zpx-0.0.1.dist-info/entry_points.txt,sha256=Lfs5CmFazXyPcpWoeUm1ZZlwkbGadYa3tn2eQmmUqgQ,38
5
+ zpx-0.0.1.dist-info/METADATA,sha256=QyFD1E0fTD6f5gKNBF40FCywnjSTEmF4hkX3V2IM9jU,1454
6
+ zpx-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.11.21
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ zpx = zpx.cli:main
3
+