neyino 0.4.4__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.
- neyino-0.4.4.dist-info/METADATA +32 -0
- neyino-0.4.4.dist-info/RECORD +5 -0
- neyino-0.4.4.dist-info/WHEEL +4 -0
- neyino-0.4.4.dist-info/entry_points.txt +2 -0
- neyino.py +171 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: neyino
|
|
3
|
+
Version: 0.4.4
|
|
4
|
+
Summary: Neyino CLI — agentic coding in your terminal. Installs the Neyino binary for your platform.
|
|
5
|
+
Project-URL: Homepage, https://neyino.com
|
|
6
|
+
Project-URL: Documentation, https://neyino.com/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/Neyino/neyino
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: agent,ai,cli,coding,neyino
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Requires-Python: >=3.8
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# neyino (pip)
|
|
21
|
+
|
|
22
|
+
PyPI shim for the [Neyino CLI](https://neyino.com). `pip install neyino` gives you a `neyino`
|
|
23
|
+
command that fetches the platform binary from `neyino.com/dl` on first run (sha256-verified
|
|
24
|
+
against the release manifest) into `~/.neyino/bin`, then hands the terminal over to it.
|
|
25
|
+
|
|
26
|
+
- Pinned installs resolve their matching version first (`neyino==0.4.4` downloads `0.4.4`).
|
|
27
|
+
- `NEYINO_DOWNLOAD_BASE` mirrors the download origin; `NEYINO_INSTALL_DIR` relocates the binary.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install neyino
|
|
31
|
+
neyino
|
|
32
|
+
```
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
neyino.py,sha256=jVDR499lQSlkT86gIHy3FkOKuo6Z5qU576dAKUFmOqU,6047
|
|
2
|
+
neyino-0.4.4.dist-info/METADATA,sha256=bN1ABaj84t9VAcG_Qz9HZHqnw8PlHmClLTkPfFHLp8w,1245
|
|
3
|
+
neyino-0.4.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
4
|
+
neyino-0.4.4.dist-info/entry_points.txt,sha256=jbWeHywMolFMvHdFEnSjg-9d4sGPWgiNbLLIgrJFg9I,39
|
|
5
|
+
neyino-0.4.4.dist-info/RECORD,,
|
neyino.py
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"""Neyino CLI shim: fetches the platform binary on first run, then hands over the terminal."""
|
|
2
|
+
|
|
3
|
+
import hashlib
|
|
4
|
+
import os
|
|
5
|
+
import platform
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
import time
|
|
9
|
+
import urllib.error
|
|
10
|
+
import urllib.request
|
|
11
|
+
|
|
12
|
+
# Keep in sync with pyproject.toml: a pinned pip install downloads this exact version first.
|
|
13
|
+
VERSION = "0.4.4"
|
|
14
|
+
BASE = os.environ.get("NEYINO_DOWNLOAD_BASE", "https://neyino.com/dl").rstrip("/")
|
|
15
|
+
MIN_BINARY = 8 * 1024 * 1024
|
|
16
|
+
CHUNK = 1 << 20
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def platform_binary():
|
|
20
|
+
system = sys.platform
|
|
21
|
+
if system.startswith("win"):
|
|
22
|
+
os_name = "windows"
|
|
23
|
+
elif system == "darwin":
|
|
24
|
+
os_name = "darwin"
|
|
25
|
+
elif system.startswith(("linux", "freebsd")):
|
|
26
|
+
os_name = "linux"
|
|
27
|
+
else:
|
|
28
|
+
raise RuntimeError("unsupported operating system: " + system)
|
|
29
|
+
machine = platform.machine().lower()
|
|
30
|
+
if machine in ("x86_64", "amd64"):
|
|
31
|
+
arch = "x64"
|
|
32
|
+
elif machine in ("aarch64", "arm64"):
|
|
33
|
+
arch = "arm64"
|
|
34
|
+
else:
|
|
35
|
+
raise RuntimeError("unsupported architecture: " + machine)
|
|
36
|
+
suffix = ".exe" if os_name == "windows" else ""
|
|
37
|
+
return "neyino-" + os_name + "-" + arch + suffix
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def install_dir():
|
|
41
|
+
override = os.environ.get("NEYINO_INSTALL_DIR")
|
|
42
|
+
if override:
|
|
43
|
+
return os.path.abspath(os.path.expanduser(override))
|
|
44
|
+
return os.path.join(os.path.expanduser("~"), ".neyino", "bin")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def fetch(url, dest, timeout=600):
|
|
48
|
+
"""Streams url to dest, retrying transient failures up to three times."""
|
|
49
|
+
last = None
|
|
50
|
+
for attempt in range(3):
|
|
51
|
+
try:
|
|
52
|
+
request = urllib.request.Request(url, headers={"User-Agent": "neyino-pip/" + VERSION})
|
|
53
|
+
done = 0
|
|
54
|
+
total = 0
|
|
55
|
+
with urllib.request.urlopen(request, timeout=timeout) as response, open(dest, "wb") as out:
|
|
56
|
+
total = int(response.headers.get("Content-Length") or 0)
|
|
57
|
+
while True:
|
|
58
|
+
chunk = response.read(CHUNK)
|
|
59
|
+
if not chunk:
|
|
60
|
+
break
|
|
61
|
+
out.write(chunk)
|
|
62
|
+
done += len(chunk)
|
|
63
|
+
if total and sys.stderr.isatty():
|
|
64
|
+
sys.stderr.write("\rneyino: downloading %d%%" % (done * 100 // total))
|
|
65
|
+
sys.stderr.flush()
|
|
66
|
+
if total and sys.stderr.isatty():
|
|
67
|
+
sys.stderr.write("\n")
|
|
68
|
+
return
|
|
69
|
+
except (OSError, urllib.error.URLError) as error:
|
|
70
|
+
last = error
|
|
71
|
+
time.sleep(1 + attempt * 2)
|
|
72
|
+
raise RuntimeError("download failed: " + url + " (" + str(last) + ")")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def fetch_text(url):
|
|
76
|
+
try:
|
|
77
|
+
request = urllib.request.Request(url, headers={"User-Agent": "neyino-pip/" + VERSION})
|
|
78
|
+
with urllib.request.urlopen(request, timeout=30) as response:
|
|
79
|
+
return response.read().decode("utf-8", "replace")
|
|
80
|
+
except Exception: # noqa: BLE001 - a missing manifest simply means "no checksum available"
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def sha256_of(path):
|
|
85
|
+
digest = hashlib.sha256()
|
|
86
|
+
with open(path, "rb") as handle:
|
|
87
|
+
while True:
|
|
88
|
+
chunk = handle.read(CHUNK)
|
|
89
|
+
if not chunk:
|
|
90
|
+
break
|
|
91
|
+
digest.update(chunk)
|
|
92
|
+
return digest.hexdigest()
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def pinned_is_current(path, marker):
|
|
96
|
+
try:
|
|
97
|
+
with open(marker, "r") as handle:
|
|
98
|
+
return handle.read().strip() == VERSION and os.path.getsize(path) > MIN_BINARY
|
|
99
|
+
except OSError:
|
|
100
|
+
return False
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def download_binary(directory, name):
|
|
104
|
+
path = os.path.join(directory, name)
|
|
105
|
+
marker = path + ".version"
|
|
106
|
+
if os.path.exists(path) and pinned_is_current(path, marker):
|
|
107
|
+
return path
|
|
108
|
+
os.makedirs(directory, exist_ok=True)
|
|
109
|
+
temp = path + ".part"
|
|
110
|
+
# Versioned first so a pinned install gets the matching bytes; /latest is the fallback.
|
|
111
|
+
attempts = [
|
|
112
|
+
(BASE + "/" + VERSION + "/" + name, BASE + "/" + VERSION + "/SHA256SUMS", VERSION),
|
|
113
|
+
(BASE + "/latest/" + name, None, "latest"),
|
|
114
|
+
]
|
|
115
|
+
errors = []
|
|
116
|
+
for binary_url, sums_url, label in attempts:
|
|
117
|
+
try:
|
|
118
|
+
fetch(binary_url, temp)
|
|
119
|
+
if os.path.getsize(temp) < MIN_BINARY:
|
|
120
|
+
raise RuntimeError("download looks truncated: " + binary_url)
|
|
121
|
+
if sums_url:
|
|
122
|
+
manifest = fetch_text(sums_url)
|
|
123
|
+
if manifest is None:
|
|
124
|
+
raise RuntimeError("checksum manifest unavailable: " + sums_url)
|
|
125
|
+
expected = None
|
|
126
|
+
for line in manifest.splitlines():
|
|
127
|
+
parts = line.split()
|
|
128
|
+
if len(parts) >= 2 and parts[-1] == name:
|
|
129
|
+
expected = parts[0].lower()
|
|
130
|
+
break
|
|
131
|
+
if expected is None:
|
|
132
|
+
raise RuntimeError(name + " missing from checksum manifest")
|
|
133
|
+
actual = sha256_of(temp)
|
|
134
|
+
if actual != expected:
|
|
135
|
+
raise RuntimeError("sha256 mismatch for " + binary_url)
|
|
136
|
+
os.replace(temp, path)
|
|
137
|
+
if os.name != "nt":
|
|
138
|
+
os.chmod(path, 0o755)
|
|
139
|
+
with open(marker, "w") as handle:
|
|
140
|
+
handle.write(label + "\n")
|
|
141
|
+
if sys.stderr.isatty():
|
|
142
|
+
sys.stderr.write("neyino: installed " + name + " to " + path + "\n")
|
|
143
|
+
return path
|
|
144
|
+
except Exception as error: # noqa: BLE001 - fall through to the next source
|
|
145
|
+
errors.append(label + ": " + str(error))
|
|
146
|
+
try:
|
|
147
|
+
os.remove(temp)
|
|
148
|
+
except OSError:
|
|
149
|
+
pass
|
|
150
|
+
raise RuntimeError(" | ".join(errors))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def ensure():
|
|
154
|
+
name = platform_binary()
|
|
155
|
+
return download_binary(install_dir(), name)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def main():
|
|
159
|
+
try:
|
|
160
|
+
binary = ensure()
|
|
161
|
+
except Exception as error: # noqa: BLE001 - surface a clean one-liner instead of a traceback
|
|
162
|
+
sys.stderr.write("neyino: install failed: " + str(error) + "\n")
|
|
163
|
+
raise SystemExit(1)
|
|
164
|
+
argv = [binary] + sys.argv[1:]
|
|
165
|
+
if os.name == "nt":
|
|
166
|
+
raise SystemExit(subprocess.call(argv))
|
|
167
|
+
os.execv(binary, argv)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
if __name__ == "__main__":
|
|
171
|
+
main()
|