nercone-shell 0.2.2__tar.gz → 0.2.4__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.
- nercone_shell-0.2.4/PKG-INFO +62 -0
- nercone_shell-0.2.4/README.md +48 -0
- {nercone_shell-0.2.2 → nercone_shell-0.2.4}/pyproject.toml +1 -1
- {nercone_shell-0.2.2 → nercone_shell-0.2.4}/src/nercone_shell/__main__.py +13 -5
- nercone_shell-0.2.2/PKG-INFO +0 -16
- nercone_shell-0.2.2/README.md +0 -2
- {nercone_shell-0.2.2 → nercone_shell-0.2.4}/src/nercone_shell/__init__.py +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: nercone-shell
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: Modern shell for Developers
|
|
5
|
+
Author: Nercone
|
|
6
|
+
Author-email: Nercone <nercone@diamondgotcat.net>
|
|
7
|
+
License: MIT
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Dist: nercone-modern
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<img width="1710" alt="Screenshot" src="https://github.com/user-attachments/assets/a717ebd3-c9d4-447c-86a5-7d33eea9c028" />
|
|
17
|
+
|
|
18
|
+
# Nersh (Nercone Shell)
|
|
19
|
+
Modern shell for Developers
|
|
20
|
+
|
|
21
|
+
## Requiments
|
|
22
|
+
- CPython 3.9+
|
|
23
|
+
- `uv` [PyPI↗︎](https://pypi.org/project/uv/) or `pip3` [PyPI↗︎](https://pypi.org/project/pip/)
|
|
24
|
+
- `nercone-modern` [PyPI↗︎](https://pypi.org/project/nercone-modern/)
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
### using uv (recommended)
|
|
29
|
+
```
|
|
30
|
+
uv tool install nercone-shell
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### using pip3
|
|
34
|
+
|
|
35
|
+
**System Python:**
|
|
36
|
+
```
|
|
37
|
+
pip3 install nercone-shell --break-system-packages
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Venv Python:**
|
|
41
|
+
```
|
|
42
|
+
pip3 install nercone-shell
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Update
|
|
46
|
+
|
|
47
|
+
### using uv (recommended)
|
|
48
|
+
```
|
|
49
|
+
uv tool install nercone-shell --upgrade
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### using pip3
|
|
53
|
+
|
|
54
|
+
**System Python:**
|
|
55
|
+
```
|
|
56
|
+
pip3 install nercone-shell --upgrade --break-system-packages
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Venv Python:**
|
|
60
|
+
```
|
|
61
|
+
pip3 install nercone-shell --upgrade
|
|
62
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
<img width="1710" alt="Screenshot" src="https://github.com/user-attachments/assets/a717ebd3-c9d4-447c-86a5-7d33eea9c028" />
|
|
3
|
+
|
|
4
|
+
# Nersh (Nercone Shell)
|
|
5
|
+
Modern shell for Developers
|
|
6
|
+
|
|
7
|
+
## Requiments
|
|
8
|
+
- CPython 3.9+
|
|
9
|
+
- `uv` [PyPI↗︎](https://pypi.org/project/uv/) or `pip3` [PyPI↗︎](https://pypi.org/project/pip/)
|
|
10
|
+
- `nercone-modern` [PyPI↗︎](https://pypi.org/project/nercone-modern/)
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
### using uv (recommended)
|
|
15
|
+
```
|
|
16
|
+
uv tool install nercone-shell
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### using pip3
|
|
20
|
+
|
|
21
|
+
**System Python:**
|
|
22
|
+
```
|
|
23
|
+
pip3 install nercone-shell --break-system-packages
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Venv Python:**
|
|
27
|
+
```
|
|
28
|
+
pip3 install nercone-shell
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Update
|
|
32
|
+
|
|
33
|
+
### using uv (recommended)
|
|
34
|
+
```
|
|
35
|
+
uv tool install nercone-shell --upgrade
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### using pip3
|
|
39
|
+
|
|
40
|
+
**System Python:**
|
|
41
|
+
```
|
|
42
|
+
pip3 install nercone-shell --upgrade --break-system-packages
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Venv Python:**
|
|
46
|
+
```
|
|
47
|
+
pip3 install nercone-shell --upgrade
|
|
48
|
+
```
|
|
@@ -17,7 +17,6 @@ import readline
|
|
|
17
17
|
import subprocess
|
|
18
18
|
from pathlib import Path
|
|
19
19
|
from nercone_modern.color import ModernColor
|
|
20
|
-
from nercone_modern.text import ModernText
|
|
21
20
|
from importlib.metadata import version, PackageNotFoundError
|
|
22
21
|
|
|
23
22
|
try:
|
|
@@ -31,6 +30,7 @@ NERSH_HISTORY_PATH = Path(os.environ.get("NERSH_HISTORY_PATH", str(Path(NERSH_PA
|
|
|
31
30
|
NERSH_CONFIG: dict = {}
|
|
32
31
|
NERSH_CONFIG_PATH = Path(os.environ.get("NERSH_CONFIG_PATH", str(Path(NERSH_PATH, "config.json"))))
|
|
33
32
|
NERSH_CONFIG_DEFAULT: dict = {
|
|
33
|
+
"show_version": True,
|
|
34
34
|
"override_env": {
|
|
35
35
|
"SHELL": f"{shutil.which('nersh')}"
|
|
36
36
|
},
|
|
@@ -146,6 +146,9 @@ def shorten_path(path: str) -> str:
|
|
|
146
146
|
return f"/{path_str}"
|
|
147
147
|
return path_str
|
|
148
148
|
|
|
149
|
+
def show_version():
|
|
150
|
+
print(f"Nersh v{VERSION}")
|
|
151
|
+
|
|
149
152
|
def reset():
|
|
150
153
|
global ENVIRONMENT, NERSH_CONFIG
|
|
151
154
|
ENVIRONMENT = {"PWD": f"{Path(Path("~").expanduser())}"}
|
|
@@ -181,7 +184,11 @@ def run_line(command: str) -> int:
|
|
|
181
184
|
args = command.strip().split(" ")
|
|
182
185
|
cmd = args[0]
|
|
183
186
|
if cmd == "version":
|
|
184
|
-
|
|
187
|
+
show_version()
|
|
188
|
+
elif cmd == "reset":
|
|
189
|
+
reset()
|
|
190
|
+
elif cmd == "reload":
|
|
191
|
+
reload()
|
|
185
192
|
elif cmd == "cd":
|
|
186
193
|
target = " ".join(args[1:])
|
|
187
194
|
if not target:
|
|
@@ -254,7 +261,9 @@ def main() -> int:
|
|
|
254
261
|
else:
|
|
255
262
|
readline.parse_and_bind("tab: complete")
|
|
256
263
|
readline.set_completer_delims(' \t\n;')
|
|
257
|
-
|
|
264
|
+
if NERSH_CONFIG.get("show_version", True):
|
|
265
|
+
show_version()
|
|
266
|
+
for p in NERSH_CONFIG.get("autoruns", []):
|
|
258
267
|
if Path(p).is_file():
|
|
259
268
|
with Path(p).open("r") as f:
|
|
260
269
|
run_script(f.read())
|
|
@@ -268,8 +277,7 @@ def main() -> int:
|
|
|
268
277
|
readline.read_history_file(NERSH_HISTORY_PATH)
|
|
269
278
|
while True:
|
|
270
279
|
try:
|
|
271
|
-
|
|
272
|
-
run_line(command)
|
|
280
|
+
run_line(input(f"{ModernColor.color('green')}{getpass.getuser()}{ModernColor.color('reset')}@{os.uname()[1].rsplit('.', 1)[0]} {ModernColor.color('green')}{shorten_path(ENVIRONMENT.get('PWD', f'{Path('~').expanduser()}'))}{ModernColor.color('reset')}> "))
|
|
273
281
|
except KeyboardInterrupt:
|
|
274
282
|
print()
|
|
275
283
|
continue
|
nercone_shell-0.2.2/PKG-INFO
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: nercone-shell
|
|
3
|
-
Version: 0.2.2
|
|
4
|
-
Summary: Modern shell for Developers
|
|
5
|
-
Author: Nercone
|
|
6
|
-
Author-email: Nercone <nercone@diamondgotcat.net>
|
|
7
|
-
License: MIT
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Dist: nercone-modern
|
|
12
|
-
Requires-Python: >=3.8
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
|
|
15
|
-
# Nersh (Nercone Shell)
|
|
16
|
-
Modern shell for Developers
|
nercone_shell-0.2.2/README.md
DELETED
|
File without changes
|