akashcli 4.6.4__tar.gz → 4.6.6__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.
Files changed (32) hide show
  1. {akashcli-4.6.4 → akashcli-4.6.6}/PKG-INFO +1 -1
  2. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/__init__.py +1 -1
  3. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/cli.py +11 -3
  4. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/relay.py +26 -28
  5. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/PKG-INFO +1 -1
  6. {akashcli-4.6.4 → akashcli-4.6.6}/pyproject.toml +1 -1
  7. {akashcli-4.6.4 → akashcli-4.6.6}/README.md +0 -0
  8. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/_net.py +0 -0
  9. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/auth.py +0 -0
  10. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/client.py +0 -0
  11. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/config.py +0 -0
  12. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/crypto.py +0 -0
  13. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/env_manager.py +0 -0
  14. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/exceptions.py +0 -0
  15. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/exec.py +0 -0
  16. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/integrity.py +0 -0
  17. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/logger.py +0 -0
  18. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/models.py +0 -0
  19. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/p2p.py +0 -0
  20. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/packages.py +0 -0
  21. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/restore.py +0 -0
  22. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/snapshot_crypto.py +0 -0
  23. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/storage.py +0 -0
  24. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/terminal.py +0 -0
  25. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/uploader.py +0 -0
  26. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/utils.py +0 -0
  27. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/SOURCES.txt +0 -0
  28. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/dependency_links.txt +0 -0
  29. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/entry_points.txt +0 -0
  30. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/requires.txt +0 -0
  31. {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/top_level.txt +0 -0
  32. {akashcli-4.6.4 → akashcli-4.6.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.6.4
3
+ Version: 4.6.6
4
4
  Summary: Akash CLI — secure remote shell relay, file vault, and device management
5
5
  License-Expression: MIT
6
6
  Keywords: akash,cli,relay,remote-shell,vault
@@ -2,6 +2,6 @@ try:
2
2
  from importlib.metadata import version
3
3
  __version__ = version("akashcli")
4
4
  except Exception:
5
- __version__ = "4.6.4"
5
+ __version__ = "4.6.6"
6
6
 
7
7
  AKASH_VERSION = __version__
@@ -155,10 +155,19 @@ app = typer.Typer(
155
155
  no_args_is_help=False,
156
156
  )
157
157
 
158
+ def raise_exit():
159
+ raise typer.Exit(0)
160
+
161
+ def _print_version(value: bool):
162
+ if value:
163
+ from . import __version__
164
+ print(f"akashcli v{__version__}")
165
+ raise typer.Exit(0)
166
+
158
167
  @app.callback(invoke_without_command=True)
159
168
  def _main(ctx: typer.Context,
160
169
  version: bool = typer.Option(False, "--version", "-v", is_eager=True, expose_value=False,
161
- callback=lambda v: (print("akashcli v1.5.0"), raise_exit()) if v else None,
170
+ callback=_print_version,
162
171
  help="Show version and exit."),
163
172
  help: bool = typer.Option(False, "--help", "-h", is_eager=True, expose_value=False,
164
173
  callback=lambda v: (_print_help(), raise_exit()) if v else None,
@@ -168,8 +177,7 @@ def _main(ctx: typer.Context,
168
177
  _print_help()
169
178
  raise typer.Exit(0)
170
179
 
171
- def raise_exit():
172
- raise typer.Exit(0)
180
+
173
181
 
174
182
  def _print_help():
175
183
  C, G, Y, DM, RS = _C, _G, _Y, _DM, _RS
@@ -25,7 +25,7 @@ Wire protocol (all JSON frames over the relay WebSocket):
25
25
 
26
26
  from __future__ import annotations
27
27
 
28
- AKASH_VERSION = "4.6.4"
28
+ AKASH_VERSION = "4.6.6"
29
29
 
30
30
  import base64
31
31
  import json
@@ -290,31 +290,24 @@ def _handle_pty(ws, frame: dict) -> None:
290
290
  import subprocess as _sp
291
291
  import tempfile as _tmp
292
292
 
293
- shell = command or os.environ.get("SHELL", "/bin/bash")
294
-
295
- # On Android non-root, TIOCSCTTY is blocked by SELinux so bash prints:
296
- # "cannot set terminal process group … no job control"
297
- # Fix: launch bash with --rcfile pointing to a temp file that sources
298
- # ~/.bashrc then runs `set +m` (disable job-control monitoring).
299
- # This silences the warning while keeping the shell fully interactive.
300
- _env = {**os.environ,
301
- "TERM": "xterm-256color",
302
- "COLUMNS": str(cols), "LINES": str(rows)}
293
+ shell_bin = os.environ.get("SHELL", "/bin/bash")
294
+ _env = {**os.environ, "TERM": "xterm-256color", "COLUMNS": str(cols), "LINES": str(rows)}
303
295
  _bash_env_file = None
304
- _shell_args = [shell]
305
- if "bash" in shell.lower():
306
- try:
307
- _fd, _bash_env_file = _tmp.mkstemp(prefix=".akash_rc_", suffix=".sh")
308
- # Source ~/.bashrc if it exists, then disable job-control monitoring
309
- _rc = (
310
- b'[ -f ~/.bashrc ] && . ~/.bashrc\n'
311
- b'set +m\n'
312
- )
313
- os.write(_fd, _rc)
314
- os.close(_fd)
315
- _shell_args = [shell, "--rcfile", _bash_env_file]
316
- except Exception:
317
- _bash_env_file = None
296
+
297
+ if command:
298
+ # Evaluate commands with flags/arguments through the shell
299
+ _shell_args = [shell_bin, "-c", command]
300
+ else:
301
+ _shell_args = [shell_bin]
302
+ if "bash" in shell_bin.lower():
303
+ try:
304
+ _fd, _bash_env_file = _tmp.mkstemp(prefix=".akash_rc_", suffix=".sh")
305
+ _rc = b'[ -f ~/.bashrc ] && . ~/.bashrc\nset +m\n'
306
+ os.write(_fd, _rc)
307
+ os.close(_fd)
308
+ _shell_args = [shell_bin, "--rcfile", _bash_env_file]
309
+ except Exception:
310
+ _bash_env_file = None
318
311
 
319
312
  try:
320
313
  proc = _sp.Popen(
@@ -919,9 +912,14 @@ _PTY_APPS = frozenset({
919
912
 
920
913
  def _is_pty_cmd(cmd: str) -> bool:
921
914
  """Return True if cmd should run in PTY mode (TUI / interactive app)."""
922
- first = cmd.strip().lstrip("\\").split()[0] if cmd.strip() else ""
923
- # strip path — /usr/bin/vim → vim
924
- first = first.split("/")[-1]
915
+ parts = cmd.strip().lstrip("\\").split()
916
+ if not parts:
917
+ return False
918
+ first = parts[0].split("/")[-1]
919
+ # Commands with -c, -e, or file arguments are batch scripts, NOT interactive TUI sessions
920
+ if first in ("python", "python3", "ipython", "node", "ruby", "perl"):
921
+ if len(parts) > 1 and (parts[1] in ("-c", "-e") or not parts[1].startswith("-")):
922
+ return False
925
923
  return first in _PTY_APPS
926
924
 
927
925
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.6.4
3
+ Version: 4.6.6
4
4
  Summary: Akash CLI — secure remote shell relay, file vault, and device management
5
5
  License-Expression: MIT
6
6
  Keywords: akash,cli,relay,remote-shell,vault
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "akashcli"
3
- version = "4.6.4"
3
+ version = "4.6.6"
4
4
  description = "Akash CLI — secure remote shell relay, file vault, and device management"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes