tunacode-cli 0.0.14__py3-none-any.whl → 0.0.16__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.

Potentially problematic release.


This version of tunacode-cli might be problematic. Click here for more details.

tunacode/cli/commands.py CHANGED
@@ -493,6 +493,106 @@ class CompactCommand(SimpleCommand):
493
493
  context.state_manager.session.messages = context.state_manager.session.messages[-2:]
494
494
 
495
495
 
496
+ class UpdateCommand(SimpleCommand):
497
+ """Update TunaCode to the latest version."""
498
+
499
+ def __init__(self):
500
+ super().__init__(
501
+ CommandSpec(
502
+ name="update",
503
+ aliases=["/update"],
504
+ description="Update TunaCode to the latest version",
505
+ category=CommandCategory.SYSTEM,
506
+ )
507
+ )
508
+
509
+ async def execute(self, args: List[str], context: CommandContext) -> None:
510
+ import subprocess
511
+ import sys
512
+ import shutil
513
+
514
+ await ui.info("Checking for TunaCode updates...")
515
+
516
+ # Detect installation method
517
+ installation_method = None
518
+
519
+ # Check if installed via pipx
520
+ if shutil.which("pipx"):
521
+ try:
522
+ result = subprocess.run(
523
+ ["pipx", "list"],
524
+ capture_output=True,
525
+ text=True,
526
+ timeout=10
527
+ )
528
+ if "tunacode" in result.stdout.lower():
529
+ installation_method = "pipx"
530
+ except (subprocess.TimeoutExpired, subprocess.CalledProcessError):
531
+ pass
532
+
533
+ # Check if installed via pip
534
+ if not installation_method:
535
+ try:
536
+ result = subprocess.run(
537
+ [sys.executable, "-m", "pip", "show", "tunacode-cli"],
538
+ capture_output=True,
539
+ text=True,
540
+ timeout=10
541
+ )
542
+ if result.returncode == 0:
543
+ installation_method = "pip"
544
+ except (subprocess.TimeoutExpired, subprocess.CalledProcessError):
545
+ pass
546
+
547
+ if not installation_method:
548
+ await ui.error("Could not detect TunaCode installation method")
549
+ await ui.muted("Manual update options:")
550
+ await ui.muted(" pipx: pipx upgrade tunacode")
551
+ await ui.muted(" pip: pip install --upgrade tunacode-cli")
552
+ return
553
+
554
+ # Perform update based on detected method
555
+ try:
556
+ if installation_method == "pipx":
557
+ await ui.info("Updating via pipx...")
558
+ result = subprocess.run(
559
+ ["pipx", "upgrade", "tunacode"],
560
+ capture_output=True,
561
+ text=True,
562
+ timeout=60
563
+ )
564
+ else: # pip
565
+ await ui.info("Updating via pip...")
566
+ result = subprocess.run(
567
+ [sys.executable, "-m", "pip", "install", "--upgrade", "tunacode-cli"],
568
+ capture_output=True,
569
+ text=True,
570
+ timeout=60
571
+ )
572
+
573
+ if result.returncode == 0:
574
+ await ui.success("TunaCode updated successfully!")
575
+ await ui.muted("Restart TunaCode to use the new version")
576
+
577
+ # Show update output if available
578
+ if result.stdout.strip():
579
+ output_lines = result.stdout.strip().split('\n')
580
+ for line in output_lines[-5:]: # Show last 5 lines
581
+ if line.strip():
582
+ await ui.muted(f" {line}")
583
+ else:
584
+ await ui.error("Update failed")
585
+ if result.stderr:
586
+ await ui.muted(f"Error: {result.stderr.strip()}")
587
+
588
+ except subprocess.TimeoutExpired:
589
+ await ui.error("Update timed out")
590
+ except subprocess.CalledProcessError as e:
591
+ await ui.error(f"Update failed: {e}")
592
+ except FileNotFoundError:
593
+ await ui.error(f"Could not find {installation_method} executable")
594
+
595
+
496
596
  class ModelCommand(SimpleCommand):
497
597
  """Manage model selection."""
498
598
 
@@ -628,6 +728,7 @@ class CommandRegistry:
628
728
  FixCommand,
629
729
  ParseToolsCommand,
630
730
  RefreshConfigCommand,
731
+ UpdateCommand,
631
732
  HelpCommand,
632
733
  BranchCommand,
633
734
  # TunaCodeCommand, # TODO: Temporarily disabled
tunacode/constants.py CHANGED
@@ -7,7 +7,7 @@ Centralizes all magic strings, UI text, error messages, and application constant
7
7
 
8
8
  # Application info
9
9
  APP_NAME = "TunaCode"
10
- APP_VERSION = "0.0.14"
10
+ APP_VERSION = "0.0.16"
11
11
 
12
12
  # File patterns
13
13
  GUIDE_FILE_PATTERN = "{name}.md"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tunacode-cli
3
- Version: 0.0.14
3
+ Version: 0.0.16
4
4
  Summary: Your agentic CLI developer.
5
5
  Author-email: larock22 <noreply@github.com>
6
6
  License-Expression: MIT
@@ -1,12 +1,12 @@
1
1
  tunacode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- tunacode/constants.py,sha256=BOVIWHNIfskD3863sTZRjTb0mTMmYVQuUXbViQsoc3o,3807
2
+ tunacode/constants.py,sha256=VSgtLvaGhxIaPDvHx1nVwHxig1K9_R2uSodDt05bJNA,3807
3
3
  tunacode/context.py,sha256=0ttsxxLAyD4pSoxw7S-pyzor0JUkhOFZh96aAf4Kqsg,2634
4
4
  tunacode/exceptions.py,sha256=RFUH8wOsWEvSPGIYM2exr4t47YkEyZt4Fr-DfTo6_JY,2647
5
5
  tunacode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  tunacode/setup.py,sha256=dYn0NeAxtNIDSogWEmGSyjb9wsr8AonZ8vAo5sw9NIw,1909
7
7
  tunacode/types.py,sha256=5mMJDgFqVcKzhtHh9unPISBFqkeNje6KISGUpRkqRjY,7146
8
8
  tunacode/cli/__init__.py,sha256=zgs0UbAck8hfvhYsWhWOfBe5oK09ug2De1r4RuQZREA,55
9
- tunacode/cli/commands.py,sha256=PVibeHVoukKYq1YGQOFVJlsjMMJuzbr_8HVUpuNDxWc,26015
9
+ tunacode/cli/commands.py,sha256=Bd1Yw_CG1xuHj4qUStgbuahZ2PwGTUT4fvcSQ05gBw8,29751
10
10
  tunacode/cli/main.py,sha256=mmJ-x5fUcW2349fz-85LSiNRf0hvKOw0TQfxtPWWbDg,1760
11
11
  tunacode/cli/repl.py,sha256=BR2TNTNf1g14V278loSA3JysiaYrM2nXhL6BxmVqUuI,10942
12
12
  tunacode/cli/textual_app.py,sha256=EdeeKjIikrtj-3FleBtP5DX5KwnMjc_bPepUB5DDkvw,13202
@@ -59,9 +59,9 @@ tunacode/utils/ripgrep.py,sha256=AXUs2FFt0A7KBV996deS8wreIlUzKOlAHJmwrcAr4No,583
59
59
  tunacode/utils/system.py,sha256=FSoibTIH0eybs4oNzbYyufIiV6gb77QaeY2yGqW39AY,11381
60
60
  tunacode/utils/text_utils.py,sha256=B9M1cuLTm_SSsr15WNHF6j7WdLWPvWzKZV0Lvfgdbjg,2458
61
61
  tunacode/utils/user_configuration.py,sha256=uFrpSRTUf0CijZjw1rOp1sovqy1uyr0UNcn85S6jvdk,1790
62
- tunacode_cli-0.0.14.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
63
- tunacode_cli-0.0.14.dist-info/METADATA,sha256=14VXnSgm6XqCQHSwaiVI0nT_2usAuqtpKM9bKbV3v6I,14633
64
- tunacode_cli-0.0.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
- tunacode_cli-0.0.14.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
66
- tunacode_cli-0.0.14.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
67
- tunacode_cli-0.0.14.dist-info/RECORD,,
62
+ tunacode_cli-0.0.16.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
63
+ tunacode_cli-0.0.16.dist-info/METADATA,sha256=FAJO_sdRmHFOoXjxnWScQk9ueOUP1cFgtv3oopZ7JSQ,14633
64
+ tunacode_cli-0.0.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
+ tunacode_cli-0.0.16.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
66
+ tunacode_cli-0.0.16.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
67
+ tunacode_cli-0.0.16.dist-info/RECORD,,