cmux-code 0.1.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.
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: cmux-code
3
+ Version: 0.1.0
4
+ Summary: Pi coding agent launcher with cmux CLI and Cloud VM instructions
5
+ Author: Manaflow AI
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/manaflow-ai/cmux
8
+ Project-URL: Repository, https://github.com/manaflow-ai/cmuxterm-hq
9
+ Keywords: cmux,pi,coding-agent,cloud-vm
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+
13
+ # cmux-code for Python
14
+
15
+ Install from PyPI with:
16
+
17
+ ```sh
18
+ python -m pip install cmux-code
19
+ cmux-code
20
+ ```
21
+
22
+ The Python package is a thin launcher. It uses an installed `cmux-code` npm binary when present, or downloads the same pinned distribution through `npx`. Pi requires Node.js 20.18.1 or newer. The launcher never handles passwords or stores cmux credentials.
@@ -0,0 +1,10 @@
1
+ # cmux-code for Python
2
+
3
+ Install from PyPI with:
4
+
5
+ ```sh
6
+ python -m pip install cmux-code
7
+ cmux-code
8
+ ```
9
+
10
+ The Python package is a thin launcher. It uses an installed `cmux-code` npm binary when present, or downloads the same pinned distribution through `npx`. Pi requires Node.js 20.18.1 or newer. The launcher never handles passwords or stores cmux credentials.
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: cmux-code
3
+ Version: 0.1.0
4
+ Summary: Pi coding agent launcher with cmux CLI and Cloud VM instructions
5
+ Author: Manaflow AI
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/manaflow-ai/cmux
8
+ Project-URL: Repository, https://github.com/manaflow-ai/cmuxterm-hq
9
+ Keywords: cmux,pi,coding-agent,cloud-vm
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+
13
+ # cmux-code for Python
14
+
15
+ Install from PyPI with:
16
+
17
+ ```sh
18
+ python -m pip install cmux-code
19
+ cmux-code
20
+ ```
21
+
22
+ The Python package is a thin launcher. It uses an installed `cmux-code` npm binary when present, or downloads the same pinned distribution through `npx`. Pi requires Node.js 20.18.1 or newer. The launcher never handles passwords or stores cmux credentials.
@@ -0,0 +1,9 @@
1
+ README.md
2
+ cmux_code.py
3
+ pyproject.toml
4
+ cmux_code.egg-info/PKG-INFO
5
+ cmux_code.egg-info/SOURCES.txt
6
+ cmux_code.egg-info/dependency_links.txt
7
+ cmux_code.egg-info/entry_points.txt
8
+ cmux_code.egg-info/top_level.txt
9
+ tests/test_launcher.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ cmux-code = cmux_code:main
@@ -0,0 +1 @@
1
+ cmux_code
@@ -0,0 +1,42 @@
1
+ """Python launcher for the cmux-code Pi distribution."""
2
+ from __future__ import annotations
3
+
4
+ import importlib.metadata
5
+ import os
6
+ import shutil
7
+ import subprocess
8
+ import sys
9
+
10
+
11
+ def _run(command: list[str]) -> int:
12
+ try:
13
+ completed = subprocess.run(command, check=False)
14
+ except OSError as exc:
15
+ print(f"cmux-code: could not start {' '.join(command)}: {exc}", file=sys.stderr)
16
+ return 1
17
+ return completed.returncode
18
+
19
+
20
+ def main() -> int:
21
+ """Run an installed cmux-code npm binary, or download it with npx."""
22
+ args = sys.argv[1:]
23
+ local = shutil.which("cmux-code")
24
+ if local and os.path.realpath(local) != os.path.realpath(sys.argv[0]):
25
+ return _run([local, *args])
26
+
27
+ npx = shutil.which("npx")
28
+ if not npx:
29
+ print(
30
+ "cmux-code requires Node.js 20.18.1+ and npx. Install Node.js, then run `pip install -U cmux-code` again.",
31
+ file=sys.stderr,
32
+ )
33
+ return 1
34
+ try:
35
+ version = importlib.metadata.version("cmux-code")
36
+ except importlib.metadata.PackageNotFoundError:
37
+ version = "0.1.0"
38
+ return _run([npx, "--yes", f"cmux-code@{version}", *args])
39
+
40
+
41
+ if __name__ == "__main__":
42
+ raise SystemExit(main())
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cmux-code"
7
+ version = "0.1.0"
8
+ description = "Pi coding agent launcher with cmux CLI and Cloud VM instructions"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = {text = "MIT"}
12
+ authors = [{name = "Manaflow AI"}]
13
+ keywords = ["cmux", "pi", "coding-agent", "cloud-vm"]
14
+
15
+ [project.urls]
16
+ Homepage = "https://github.com/manaflow-ai/cmux"
17
+ Repository = "https://github.com/manaflow-ai/cmuxterm-hq"
18
+
19
+ [project.scripts]
20
+ cmux-code = "cmux_code:main"
21
+
22
+ [tool.setuptools]
23
+ py-modules = ["cmux_code"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,28 @@
1
+ import contextlib
2
+ import io
3
+ import os
4
+ import sys
5
+ import unittest
6
+ from unittest.mock import patch
7
+
8
+ import cmux_code
9
+
10
+
11
+ class LauncherTests(unittest.TestCase):
12
+ def test_uses_npx_when_node_is_available(self):
13
+ with patch.object(cmux_code.shutil, "which", side_effect=lambda name: "/usr/bin/npx" if name == "npx" else None), patch.object(cmux_code.subprocess, "run") as run:
14
+ run.return_value.returncode = 0
15
+ with patch.object(sys, "argv", ["cmux-code", "--help"]):
16
+ self.assertEqual(cmux_code.main(), 0)
17
+ run.assert_called_once_with(["/usr/bin/npx", "--yes", "cmux-code@0.1.0", "--help"], check=False)
18
+
19
+ def test_reports_missing_node(self):
20
+ with patch.object(cmux_code.shutil, "which", return_value=None), patch.object(sys, "argv", ["cmux-code"]):
21
+ stderr = io.StringIO()
22
+ with contextlib.redirect_stderr(stderr):
23
+ self.assertEqual(cmux_code.main(), 1)
24
+ self.assertIn("Node.js", stderr.getvalue())
25
+
26
+
27
+ if __name__ == "__main__":
28
+ unittest.main()