zeroclaw 2.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.
- zeroclaw/__init__.py +60 -0
- zeroclaw/cli.py +179 -0
- zeroclaw/installer.py +190 -0
- zeroclaw/platform.py +87 -0
- zeroclaw-2.0.0.dist-info/METADATA +123 -0
- zeroclaw-2.0.0.dist-info/RECORD +8 -0
- zeroclaw-2.0.0.dist-info/WHEEL +4 -0
- zeroclaw-2.0.0.dist-info/entry_points.txt +2 -0
zeroclaw/__init__.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""zeroclaw — installer for the cmdop CLI.
|
|
2
|
+
|
|
3
|
+
Run `zeroclaw` to download, verify and launch cmdop on this machine.
|
|
4
|
+
|
|
5
|
+
This package is published by CMDOP — https://cmdop.com
|
|
6
|
+
|
|
7
|
+
Importing this module performs no network access and has no side effects.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from typing import TYPE_CHECKING
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING: # pragma: no cover — for type checkers and IDE completion only
|
|
15
|
+
from .cli import main
|
|
16
|
+
from .installer import (
|
|
17
|
+
InstallError,
|
|
18
|
+
InstallResult,
|
|
19
|
+
default_install_dir,
|
|
20
|
+
find_installed,
|
|
21
|
+
install,
|
|
22
|
+
)
|
|
23
|
+
from .platform import Platform, UnsupportedPlatform, detect
|
|
24
|
+
|
|
25
|
+
__version__ = "2.0.0"
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"__version__",
|
|
29
|
+
"InstallError",
|
|
30
|
+
"InstallResult",
|
|
31
|
+
"Platform",
|
|
32
|
+
"UnsupportedPlatform",
|
|
33
|
+
"default_install_dir",
|
|
34
|
+
"detect",
|
|
35
|
+
"find_installed",
|
|
36
|
+
"install",
|
|
37
|
+
"main",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def __getattr__(name: str):
|
|
42
|
+
"""Resolve the public API lazily.
|
|
43
|
+
|
|
44
|
+
Keeps `import zeroclaw` free of any work beyond binding a name — the
|
|
45
|
+
submodules import argparse, subprocess and urllib, none of which a caller
|
|
46
|
+
who only wants __version__ should pay for.
|
|
47
|
+
"""
|
|
48
|
+
if name in ("InstallError", "InstallResult", "default_install_dir", "find_installed", "install"):
|
|
49
|
+
from . import installer
|
|
50
|
+
|
|
51
|
+
return getattr(installer, name)
|
|
52
|
+
if name in ("Platform", "UnsupportedPlatform", "detect"):
|
|
53
|
+
from . import platform as _platform
|
|
54
|
+
|
|
55
|
+
return getattr(_platform, name)
|
|
56
|
+
if name == "main":
|
|
57
|
+
from .cli import main
|
|
58
|
+
|
|
59
|
+
return main
|
|
60
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
zeroclaw/cli.py
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"""The `zeroclaw` command.
|
|
2
|
+
|
|
3
|
+
Bare `zeroclaw` does the obvious thing: install cmdop if missing, then hand
|
|
4
|
+
over to it. No subcommand to learn, no flags required.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import argparse
|
|
10
|
+
import os
|
|
11
|
+
import subprocess
|
|
12
|
+
import sys
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from . import __version__
|
|
16
|
+
from .installer import (
|
|
17
|
+
InstallError,
|
|
18
|
+
default_install_dir,
|
|
19
|
+
find_installed,
|
|
20
|
+
install,
|
|
21
|
+
)
|
|
22
|
+
from .platform import UnsupportedPlatform, detect, is_windows
|
|
23
|
+
|
|
24
|
+
DOCS_URL = "https://cmdop.com"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _tty() -> bool:
|
|
28
|
+
return sys.stdout.isatty()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _dim(text: str) -> str:
|
|
32
|
+
return f"\033[2m{text}\033[0m" if _tty() else text
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _bold(text: str) -> str:
|
|
36
|
+
return f"\033[1m{text}\033[0m" if _tty() else text
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _progress(seen: int, total: int) -> None:
|
|
40
|
+
if not _tty():
|
|
41
|
+
return
|
|
42
|
+
if total:
|
|
43
|
+
pct = seen * 100 // total
|
|
44
|
+
bar = "█" * (pct // 4) + "░" * (25 - pct // 4)
|
|
45
|
+
sys.stdout.write(f"\r {bar} {pct:3d}% {seen / 1048576:.0f}/{total / 1048576:.0f} MB")
|
|
46
|
+
else:
|
|
47
|
+
sys.stdout.write(f"\r {seen / 1048576:.0f} MB")
|
|
48
|
+
sys.stdout.flush()
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _install(install_dir: Path | None, quiet: bool) -> int:
|
|
52
|
+
try:
|
|
53
|
+
target = detect()
|
|
54
|
+
except UnsupportedPlatform as exc:
|
|
55
|
+
print(f"error: {exc}", file=sys.stderr)
|
|
56
|
+
return 2
|
|
57
|
+
|
|
58
|
+
if not quiet:
|
|
59
|
+
print(f"Installing {_bold('cmdop')} for {target.label}…")
|
|
60
|
+
|
|
61
|
+
try:
|
|
62
|
+
result = install(install_dir=install_dir, target=target, on_progress=_progress)
|
|
63
|
+
except InstallError as exc:
|
|
64
|
+
if _tty():
|
|
65
|
+
sys.stdout.write("\r\033[K")
|
|
66
|
+
print(f"error: {exc}", file=sys.stderr)
|
|
67
|
+
return 1
|
|
68
|
+
|
|
69
|
+
if _tty():
|
|
70
|
+
sys.stdout.write("\r\033[K")
|
|
71
|
+
|
|
72
|
+
if quiet:
|
|
73
|
+
print(result.path)
|
|
74
|
+
return 0
|
|
75
|
+
|
|
76
|
+
print(f" Installed {_bold(str(result.path))}")
|
|
77
|
+
print(_dim(f" sha256 {result.sha256}"))
|
|
78
|
+
|
|
79
|
+
if not result.on_path:
|
|
80
|
+
print()
|
|
81
|
+
print(f" {result.path.parent} is not on your PATH. Add it:")
|
|
82
|
+
if is_windows():
|
|
83
|
+
print(_dim(f' setx PATH "%PATH%;{result.path.parent}"'))
|
|
84
|
+
else:
|
|
85
|
+
shell = Path(os.environ.get("SHELL", "")).name or "bash"
|
|
86
|
+
rc = "~/.zshrc" if shell == "zsh" else "~/.bashrc"
|
|
87
|
+
print(_dim(f' echo \'export PATH="{result.path.parent}:$PATH"\' >> {rc}'))
|
|
88
|
+
return 0
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _run(binary: Path, argv: list[str]) -> int:
|
|
92
|
+
try:
|
|
93
|
+
return subprocess.call([str(binary), *argv])
|
|
94
|
+
except OSError as exc:
|
|
95
|
+
print(f"error: could not run {binary}: {exc}", file=sys.stderr)
|
|
96
|
+
return 1
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def main(argv: list[str] | None = None) -> int:
|
|
100
|
+
argv = list(sys.argv[1:] if argv is None else argv)
|
|
101
|
+
|
|
102
|
+
parser = argparse.ArgumentParser(
|
|
103
|
+
prog="zeroclaw",
|
|
104
|
+
description=(
|
|
105
|
+
"Installer for the cmdop CLI — one binary that runs an AI agent on "
|
|
106
|
+
"your machine and connects it to your fleet. Run `zeroclaw` to "
|
|
107
|
+
f"install it and get started. {DOCS_URL}"
|
|
108
|
+
),
|
|
109
|
+
epilog="Published by CMDOP.",
|
|
110
|
+
)
|
|
111
|
+
parser.add_argument("--version", action="store_true", help="show version and exit")
|
|
112
|
+
parser.add_argument("--prefix", metavar="DIR", help="install directory")
|
|
113
|
+
parser.add_argument(
|
|
114
|
+
"--force", action="store_true", help="reinstall even if cmdop is present"
|
|
115
|
+
)
|
|
116
|
+
parser.add_argument(
|
|
117
|
+
"--quiet", action="store_true", help="print only the installed path"
|
|
118
|
+
)
|
|
119
|
+
parser.add_argument(
|
|
120
|
+
"--install-only",
|
|
121
|
+
action="store_true",
|
|
122
|
+
help="install without handing over to cmdop",
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
# Everything after `--` goes to cmdop untouched.
|
|
126
|
+
passthrough: list[str] = []
|
|
127
|
+
if "--" in argv:
|
|
128
|
+
split = argv.index("--")
|
|
129
|
+
argv, passthrough = argv[:split], argv[split + 1 :]
|
|
130
|
+
|
|
131
|
+
args = parser.parse_args(argv)
|
|
132
|
+
|
|
133
|
+
if args.version:
|
|
134
|
+
print(f"zeroclaw {__version__}")
|
|
135
|
+
return 0
|
|
136
|
+
|
|
137
|
+
install_dir = Path(args.prefix).expanduser() if args.prefix else None
|
|
138
|
+
binary_name = "cmdop.exe" if is_windows() else "cmdop"
|
|
139
|
+
|
|
140
|
+
# An explicit --prefix names exactly where the binary belongs, so only that
|
|
141
|
+
# location counts as "already installed". Without it, any cmdop on PATH
|
|
142
|
+
# does. Checking PATH under --prefix would silently skip the install the
|
|
143
|
+
# user just asked for.
|
|
144
|
+
if install_dir is not None:
|
|
145
|
+
candidate = install_dir / binary_name
|
|
146
|
+
existing = candidate if candidate.exists() else None
|
|
147
|
+
else:
|
|
148
|
+
existing = find_installed()
|
|
149
|
+
|
|
150
|
+
if args.force:
|
|
151
|
+
existing = None
|
|
152
|
+
|
|
153
|
+
if existing is None:
|
|
154
|
+
code = _install(install_dir, args.quiet)
|
|
155
|
+
if code != 0:
|
|
156
|
+
return code
|
|
157
|
+
existing = (install_dir or default_install_dir()) / binary_name
|
|
158
|
+
if not existing.exists():
|
|
159
|
+
found = find_installed()
|
|
160
|
+
if found is None:
|
|
161
|
+
print("error: install reported success but no binary was found.",
|
|
162
|
+
file=sys.stderr)
|
|
163
|
+
return 1
|
|
164
|
+
existing = found
|
|
165
|
+
if not args.quiet and not args.install_only:
|
|
166
|
+
print()
|
|
167
|
+
elif not args.quiet:
|
|
168
|
+
# Say so even under --install-only: a command that does nothing must
|
|
169
|
+
# still tell the user why.
|
|
170
|
+
print(_dim(f"cmdop is already installed at {existing}"))
|
|
171
|
+
|
|
172
|
+
if args.install_only:
|
|
173
|
+
return 0
|
|
174
|
+
|
|
175
|
+
return _run(existing, passthrough)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
if __name__ == "__main__": # pragma: no cover
|
|
179
|
+
raise SystemExit(main())
|
zeroclaw/installer.py
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"""Download, verify and install the cmdop binary.
|
|
2
|
+
|
|
3
|
+
Every download is checked against the published SHA256SUMS before anything is
|
|
4
|
+
written to the install directory. A checksum mismatch aborts — an installer
|
|
5
|
+
that would run unverified bytes is worse than no installer.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import hashlib
|
|
11
|
+
import os
|
|
12
|
+
import shutil
|
|
13
|
+
import stat
|
|
14
|
+
import tempfile
|
|
15
|
+
import urllib.error
|
|
16
|
+
import urllib.request
|
|
17
|
+
from dataclasses import dataclass
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
from .platform import Platform, detect, is_windows
|
|
21
|
+
|
|
22
|
+
BASE_URL = "https://install.cmdop.com/cli/latest"
|
|
23
|
+
CHECKSUMS_URL = f"{BASE_URL}/SHA256SUMS"
|
|
24
|
+
|
|
25
|
+
_CHUNK = 64 * 1024
|
|
26
|
+
_TIMEOUT = 60
|
|
27
|
+
|
|
28
|
+
# The distribution edge rejects urllib's default `Python-urllib/3.x` agent with
|
|
29
|
+
# HTTP 403, so every request must carry an explicit one. Identifying the
|
|
30
|
+
# package and version also makes this traffic legible in edge logs.
|
|
31
|
+
_USER_AGENT = "zeroclaw-installer/{version} (+https://cmdop.com)"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _request(url: str) -> urllib.request.Request:
|
|
35
|
+
from . import __version__
|
|
36
|
+
|
|
37
|
+
return urllib.request.Request(
|
|
38
|
+
url, headers={"User-Agent": _USER_AGENT.format(version=__version__)}
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class InstallError(RuntimeError):
|
|
43
|
+
"""Installation could not be completed. The message is user-facing."""
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass(frozen=True)
|
|
47
|
+
class InstallResult:
|
|
48
|
+
path: Path
|
|
49
|
+
sha256: str
|
|
50
|
+
on_path: bool
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def default_install_dir() -> Path:
|
|
54
|
+
"""Where the binary goes when the user does not choose.
|
|
55
|
+
|
|
56
|
+
A per-user directory, never a system one: it needs no sudo, and an
|
|
57
|
+
installer that silently asks for root is a bad neighbour.
|
|
58
|
+
"""
|
|
59
|
+
if is_windows():
|
|
60
|
+
base = os.environ.get("LOCALAPPDATA") or str(Path.home() / "AppData" / "Local")
|
|
61
|
+
return Path(base) / "cmdop" / "bin"
|
|
62
|
+
return Path.home() / ".local" / "bin"
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _fetch(url: str) -> bytes:
|
|
66
|
+
try:
|
|
67
|
+
with urllib.request.urlopen(_request(url), timeout=_TIMEOUT) as response:
|
|
68
|
+
return response.read()
|
|
69
|
+
except urllib.error.HTTPError as exc:
|
|
70
|
+
raise InstallError(f"{url} returned HTTP {exc.code}.") from exc
|
|
71
|
+
except urllib.error.URLError as exc:
|
|
72
|
+
raise InstallError(
|
|
73
|
+
f"Could not reach {url} ({exc.reason}). Check your network and retry."
|
|
74
|
+
) from exc
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def fetch_checksums() -> dict[str, str]:
|
|
78
|
+
"""Parse the published SHA256SUMS into {asset: digest}."""
|
|
79
|
+
text = _fetch(CHECKSUMS_URL).decode("utf-8", "replace")
|
|
80
|
+
sums: dict[str, str] = {}
|
|
81
|
+
for line in text.splitlines():
|
|
82
|
+
parts = line.split()
|
|
83
|
+
if len(parts) == 2:
|
|
84
|
+
digest, name = parts
|
|
85
|
+
sums[name.lstrip("*")] = digest.lower()
|
|
86
|
+
if not sums:
|
|
87
|
+
raise InstallError("Published checksum list was empty or malformed.")
|
|
88
|
+
return sums
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _download_verified(url: str, expected: str, dest: Path, on_progress=None) -> str:
|
|
92
|
+
"""Stream url to dest, hashing as we go. Returns the digest."""
|
|
93
|
+
digest = hashlib.sha256()
|
|
94
|
+
try:
|
|
95
|
+
with urllib.request.urlopen(_request(url), timeout=_TIMEOUT) as response:
|
|
96
|
+
total = int(response.headers.get("Content-Length") or 0)
|
|
97
|
+
seen = 0
|
|
98
|
+
with open(dest, "wb") as handle:
|
|
99
|
+
while True:
|
|
100
|
+
chunk = response.read(_CHUNK)
|
|
101
|
+
if not chunk:
|
|
102
|
+
break
|
|
103
|
+
handle.write(chunk)
|
|
104
|
+
digest.update(chunk)
|
|
105
|
+
seen += len(chunk)
|
|
106
|
+
if on_progress:
|
|
107
|
+
on_progress(seen, total)
|
|
108
|
+
except urllib.error.HTTPError as exc:
|
|
109
|
+
raise InstallError(f"Download failed: HTTP {exc.code} for {url}.") from exc
|
|
110
|
+
except urllib.error.URLError as exc:
|
|
111
|
+
raise InstallError(f"Download failed: {exc.reason}.") from exc
|
|
112
|
+
|
|
113
|
+
actual = digest.hexdigest()
|
|
114
|
+
if actual != expected:
|
|
115
|
+
dest.unlink(missing_ok=True)
|
|
116
|
+
raise InstallError(
|
|
117
|
+
"Checksum mismatch — the download does not match the published "
|
|
118
|
+
f"SHA256SUMS.\n expected {expected}\n got {actual}\n"
|
|
119
|
+
"Nothing was installed. Retry; if it persists, report it."
|
|
120
|
+
)
|
|
121
|
+
return actual
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def install(
|
|
125
|
+
install_dir: Path | None = None,
|
|
126
|
+
target: Platform | None = None,
|
|
127
|
+
on_progress=None,
|
|
128
|
+
) -> InstallResult:
|
|
129
|
+
"""Download the cmdop binary for this machine and install it.
|
|
130
|
+
|
|
131
|
+
Downloads to a temporary file, verifies the checksum, and only then moves
|
|
132
|
+
it into place — an interrupted run never leaves a partial binary where a
|
|
133
|
+
working one is expected.
|
|
134
|
+
"""
|
|
135
|
+
target = target or detect()
|
|
136
|
+
install_dir = Path(install_dir) if install_dir else default_install_dir()
|
|
137
|
+
|
|
138
|
+
checksums = fetch_checksums()
|
|
139
|
+
expected = checksums.get(target.asset)
|
|
140
|
+
if not expected:
|
|
141
|
+
raise InstallError(
|
|
142
|
+
f"No published checksum for {target.asset!r}. "
|
|
143
|
+
"This platform may not have a current release."
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
try:
|
|
147
|
+
install_dir.mkdir(parents=True, exist_ok=True)
|
|
148
|
+
except OSError as exc:
|
|
149
|
+
raise InstallError(f"Cannot create {install_dir}: {exc}") from exc
|
|
150
|
+
|
|
151
|
+
final = install_dir / target.binary_name
|
|
152
|
+
|
|
153
|
+
with tempfile.TemporaryDirectory(prefix="zeroclaw-") as tmp:
|
|
154
|
+
staged = Path(tmp) / target.binary_name
|
|
155
|
+
digest = _download_verified(
|
|
156
|
+
f"{BASE_URL}/{target.asset}", expected, staged, on_progress
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
if not target.is_windows:
|
|
160
|
+
staged.chmod(staged.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
|
161
|
+
|
|
162
|
+
try:
|
|
163
|
+
shutil.move(str(staged), str(final))
|
|
164
|
+
except OSError as exc:
|
|
165
|
+
raise InstallError(f"Cannot write {final}: {exc}") from exc
|
|
166
|
+
|
|
167
|
+
return InstallResult(path=final, sha256=digest, on_path=_on_path(install_dir))
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def _on_path(directory: Path) -> bool:
|
|
171
|
+
entries = (os.environ.get("PATH") or "").split(os.pathsep)
|
|
172
|
+
resolved = directory.resolve()
|
|
173
|
+
for entry in entries:
|
|
174
|
+
if not entry:
|
|
175
|
+
continue
|
|
176
|
+
try:
|
|
177
|
+
if Path(entry).resolve() == resolved:
|
|
178
|
+
return True
|
|
179
|
+
except OSError:
|
|
180
|
+
continue
|
|
181
|
+
return False
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def find_installed() -> Path | None:
|
|
185
|
+
"""Return an existing cmdop on PATH or in the default directory, if any."""
|
|
186
|
+
found = shutil.which("cmdop")
|
|
187
|
+
if found:
|
|
188
|
+
return Path(found)
|
|
189
|
+
candidate = default_install_dir() / ("cmdop.exe" if is_windows() else "cmdop")
|
|
190
|
+
return candidate if candidate.exists() else None
|
zeroclaw/platform.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""Platform detection.
|
|
2
|
+
|
|
3
|
+
Mirrors the asset naming used by install.cmdop.com. The labels here MUST match
|
|
4
|
+
the names in the published SHA256SUMS file; a mismatch means a 404 at download
|
|
5
|
+
time, so they are asserted against the live manifest in the test suite.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import platform
|
|
11
|
+
import sys
|
|
12
|
+
from dataclasses import dataclass
|
|
13
|
+
|
|
14
|
+
# Asset labels as published in SHA256SUMS.
|
|
15
|
+
_MACOS_SILICON = "macos-silicon"
|
|
16
|
+
_MACOS_INTEL = "macos-intel"
|
|
17
|
+
_LINUX_X64 = "linux-x64"
|
|
18
|
+
_LINUX_ARM64 = "linux-arm64"
|
|
19
|
+
_WINDOWS_X64 = "windows-x64"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class UnsupportedPlatform(RuntimeError):
|
|
23
|
+
"""This OS/architecture combination has no published cmdop binary."""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(frozen=True)
|
|
27
|
+
class Platform:
|
|
28
|
+
"""A resolved target: which artifact to fetch and what to call it on disk."""
|
|
29
|
+
|
|
30
|
+
label: str
|
|
31
|
+
binary_name: str
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def asset(self) -> str:
|
|
35
|
+
"""Filename of the artifact as published in SHA256SUMS."""
|
|
36
|
+
return f"cmdop-{self.label}.exe" if self.is_windows else f"cmdop-{self.label}"
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def is_windows(self) -> bool:
|
|
40
|
+
return self.label == _WINDOWS_X64
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def detect() -> Platform:
|
|
44
|
+
"""Resolve the current machine to a published artifact.
|
|
45
|
+
|
|
46
|
+
Raises UnsupportedPlatform with an actionable message when there is none —
|
|
47
|
+
never guesses an adjacent architecture, because a silently wrong binary is
|
|
48
|
+
a worse failure than a clear refusal.
|
|
49
|
+
"""
|
|
50
|
+
system = platform.system().lower()
|
|
51
|
+
machine = platform.machine().lower()
|
|
52
|
+
|
|
53
|
+
if machine in ("x86_64", "amd64"):
|
|
54
|
+
arch = "x64"
|
|
55
|
+
elif machine in ("arm64", "aarch64"):
|
|
56
|
+
arch = "arm64"
|
|
57
|
+
else:
|
|
58
|
+
raise UnsupportedPlatform(
|
|
59
|
+
f"Unsupported architecture: {platform.machine()!r}. "
|
|
60
|
+
"cmdop ships x64 and arm64 builds."
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
if system == "darwin":
|
|
64
|
+
label = _MACOS_SILICON if arch == "arm64" else _MACOS_INTEL
|
|
65
|
+
elif system == "linux":
|
|
66
|
+
label = _LINUX_X64 if arch == "x64" else _LINUX_ARM64
|
|
67
|
+
elif system == "windows":
|
|
68
|
+
if arch != "x64":
|
|
69
|
+
raise UnsupportedPlatform(
|
|
70
|
+
f"Unsupported Windows architecture: {platform.machine()!r}. "
|
|
71
|
+
"cmdop ships an x64 build for Windows."
|
|
72
|
+
)
|
|
73
|
+
label = _WINDOWS_X64
|
|
74
|
+
else:
|
|
75
|
+
raise UnsupportedPlatform(
|
|
76
|
+
f"Unsupported operating system: {platform.system()!r}. "
|
|
77
|
+
"cmdop ships macOS, Linux and Windows builds."
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return Platform(
|
|
81
|
+
label=label,
|
|
82
|
+
binary_name="cmdop.exe" if label == _WINDOWS_X64 else "cmdop",
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def is_windows() -> bool:
|
|
87
|
+
return sys.platform.startswith("win")
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zeroclaw
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Installer for the cmdop CLI — one binary, zero config, an AI agent on your machine
|
|
5
|
+
Project-URL: Homepage, https://cmdop.com
|
|
6
|
+
Project-URL: Documentation, https://docs.cmdop.com
|
|
7
|
+
Project-URL: Download, https://cmdop.com/download
|
|
8
|
+
Project-URL: Source (organization), https://github.com/commandoperator
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: ai-agent,cli,cmdop,installer,instant,remote,zero-config
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
26
|
+
Classifier: Topic :: System :: Installation/Setup
|
|
27
|
+
Classifier: Topic :: System :: Systems Administration
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# zeroclaw
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
**Installer for the [cmdop](https://cmdop.com) CLI** — one binary that runs an
|
|
35
|
+
AI agent on your machine and connects it to your fleet.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install zeroclaw
|
|
39
|
+
zeroclaw
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
That's it. `zeroclaw` detects your platform, downloads the `cmdop` binary,
|
|
43
|
+
verifies it against the published checksums, installs it, and hands over.
|
|
44
|
+
|
|
45
|
+
**How does CMDOP compare?**
|
|
46
|
+
[CMDOP Skills vs OpenClaw: two approaches to AI agent skills →](https://docs.cmdop.com/blog/cmdop-skills-vs-openclaw)
|
|
47
|
+
|
|
48
|
+
## What is cmdop
|
|
49
|
+
|
|
50
|
+
One executable that is the agent, the relay, the local server and the web
|
|
51
|
+
console at once. There is no gateway, backend, database server or broker to
|
|
52
|
+
stand up — you add one binary to a machine you already own.
|
|
53
|
+
|
|
54
|
+
- run an AI agent on your own machine, with your own tools
|
|
55
|
+
- reach it from anywhere: terminal, files, remote execution
|
|
56
|
+
- connect machines into a fleet
|
|
57
|
+
- works with Claude Code and other agent engines under the hood
|
|
58
|
+
|
|
59
|
+
Full documentation: **[docs.cmdop.com](https://docs.cmdop.com)**
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
zeroclaw # install cmdop (if needed), then run it
|
|
65
|
+
zeroclaw --install-only # install, don't hand over
|
|
66
|
+
zeroclaw --prefix ~/bin # choose the install directory
|
|
67
|
+
zeroclaw --force # reinstall even if already present
|
|
68
|
+
zeroclaw --quiet # print only the installed path
|
|
69
|
+
zeroclaw -- --help # everything after `--` goes to cmdop
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Default install directory is `~/.local/bin` (`%LOCALAPPDATA%\cmdop\bin` on
|
|
73
|
+
Windows). No `sudo`, no system directories.
|
|
74
|
+
|
|
75
|
+
## What it does, precisely
|
|
76
|
+
|
|
77
|
+
1. Detects your OS and architecture.
|
|
78
|
+
2. Fetches `SHA256SUMS` from `install.cmdop.com`.
|
|
79
|
+
3. Downloads the matching binary to a temporary file.
|
|
80
|
+
4. **Verifies the SHA-256 against the published checksum.** On mismatch it
|
|
81
|
+
aborts and installs nothing.
|
|
82
|
+
5. Moves the verified binary into the install directory and marks it
|
|
83
|
+
executable.
|
|
84
|
+
6. Runs it.
|
|
85
|
+
|
|
86
|
+
Supported: macOS (Apple Silicon, Intel), Linux (x64, arm64), Windows (x64).
|
|
87
|
+
|
|
88
|
+
## What it does not do
|
|
89
|
+
|
|
90
|
+
- **No side effects at install time.** `pip install zeroclaw` only unpacks
|
|
91
|
+
files. Nothing is downloaded or executed until you run `zeroclaw`.
|
|
92
|
+
- **No network access on import.** `import zeroclaw` touches nothing.
|
|
93
|
+
- **No telemetry.** The package sends no analytics, ever.
|
|
94
|
+
- **No dependencies.** Standard library only, so there is nothing to conflict
|
|
95
|
+
with what you already have installed.
|
|
96
|
+
|
|
97
|
+
## Python API
|
|
98
|
+
|
|
99
|
+
The installer is importable if you would rather script it:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import zeroclaw
|
|
103
|
+
|
|
104
|
+
target = zeroclaw.detect()
|
|
105
|
+
print(target.label, target.asset)
|
|
106
|
+
|
|
107
|
+
result = zeroclaw.install()
|
|
108
|
+
print(result.path, result.sha256)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`zeroclaw.install()` raises `zeroclaw.InstallError` with a user-facing message
|
|
112
|
+
on any failure, and `zeroclaw.UnsupportedPlatform` when there is no published
|
|
113
|
+
binary for the current machine.
|
|
114
|
+
|
|
115
|
+
## Links
|
|
116
|
+
|
|
117
|
+
- Website — <https://cmdop.com>
|
|
118
|
+
- Documentation — <https://docs.cmdop.com>
|
|
119
|
+
- Downloads — <https://cmdop.com/download>
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
MIT
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
zeroclaw/__init__.py,sha256=30o_bqcACh413J6Q0kqM7CvHB8qme3hQvrddotXE6ZM,1626
|
|
2
|
+
zeroclaw/cli.py,sha256=vwUbVMSEG0hZqbpCiYWsAe8bgJ6JCHIxGn4gyRKr02g,5377
|
|
3
|
+
zeroclaw/installer.py,sha256=bRt78GxB72WS51x0QpxLWFArTIpymDTtaodgz4rlaMc,6358
|
|
4
|
+
zeroclaw/platform.py,sha256=8i0xQVqNyYStCK-kRT-uwbcOmnoiRFexiuRJyFJZS7s,2616
|
|
5
|
+
zeroclaw-2.0.0.dist-info/METADATA,sha256=2xmIlL2UIYiOu2aFcGo8Ldu3uVrwFZYS32NqTJLJZJo,4301
|
|
6
|
+
zeroclaw-2.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
zeroclaw-2.0.0.dist-info/entry_points.txt,sha256=7F7o-9FN3Wse_P7OePszLAIxFwMq4nkRb6Bdhyv6AbM,47
|
|
8
|
+
zeroclaw-2.0.0.dist-info/RECORD,,
|