tunacode-cli 0.0.6__py3-none-any.whl → 0.0.7__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/main.py CHANGED
@@ -25,10 +25,16 @@ state_manager = StateManager()
25
25
  def main(
26
26
  version: bool = typer.Option(False, "--version", "-v", help="Show version and exit."),
27
27
  run_setup: bool = typer.Option(False, "--setup", help="Run setup process."),
28
+ update: bool = typer.Option(False, "--update", "--upgrade", help="Update TunaCode to the latest version."),
28
29
  ):
29
30
  if version:
30
31
  asyncio.run(ui.version())
31
32
  return
33
+
34
+ if update:
35
+ from tunacode.utils.system import update_tunacode
36
+ asyncio.run(update_tunacode())
37
+ return
32
38
 
33
39
  asyncio.run(ui.banner())
34
40
 
@@ -4,7 +4,7 @@ from contextlib import asynccontextmanager
4
4
  from datetime import datetime, timezone
5
5
  from typing import Any, Dict, Optional
6
6
 
7
- from tinyagent.react.react_agent import ReactAgent
7
+ from tinyagent import ReactAgent
8
8
 
9
9
  from tunacode.core.state import StateManager
10
10
  from tunacode.tools.tinyagent_tools import read_file, run_command, update_file, write_file
@@ -58,12 +58,9 @@ def get_or_create_react_agent(model: ModelName, state_manager: StateManager) ->
58
58
  if state_manager.session.user_config["env"].get(key_name):
59
59
  os.environ[key_name] = state_manager.session.user_config["env"][key_name]
60
60
 
61
- # Create new ReactAgent with the actual model name
62
- agent = ReactAgent(model_override=actual_model)
63
-
64
- # Register our tools
65
- for fn in (read_file, write_file, update_file, run_command):
66
- agent.register_tool(fn._tool)
61
+ # Create new ReactAgent with tools
62
+ # Note: tinyAgent gets model from environment variables, not constructor
63
+ agent = ReactAgent(tools=[read_file, write_file, update_file, run_command])
67
64
 
68
65
  # Add MCP compatibility method
69
66
  @asynccontextmanager
@@ -106,7 +103,12 @@ async def process_request_with_tinyagent(
106
103
 
107
104
  try:
108
105
  # Run the agent with the message
109
- result = await agent.run_react(message)
106
+ # The new API's run() method might be synchronous based on the examples
107
+ import asyncio
108
+ if asyncio.iscoroutinefunction(agent.run):
109
+ result = await agent.run(message)
110
+ else:
111
+ result = agent.run(message)
110
112
 
111
113
  # Update message history in state_manager
112
114
  # This will need to be adapted based on how tinyAgent returns messages
@@ -2,7 +2,7 @@
2
2
 
3
3
  from typing import Optional
4
4
 
5
- from tinyagent.decorators import tool
5
+ from tinyagent import tool
6
6
 
7
7
  from tunacode.exceptions import ToolExecutionError
8
8
  from tunacode.ui import console as ui
tunacode/utils/system.py CHANGED
@@ -277,6 +277,46 @@ def check_for_updates():
277
277
  return False, current_version
278
278
 
279
279
 
280
+ async def update_tunacode():
281
+ """
282
+ Update TunaCode to the latest version using pip.
283
+ """
284
+ from ..ui import console as ui
285
+
286
+ await ui.info("🔄 Checking for updates...")
287
+
288
+ has_update, latest_version = check_for_updates()
289
+
290
+ if not has_update:
291
+ await ui.success("✅ TunaCode is already up to date!")
292
+ return
293
+
294
+ app_settings = ApplicationSettings()
295
+ current_version = app_settings.version
296
+
297
+ await ui.info(f"📦 Updating from v{current_version} to v{latest_version}...")
298
+
299
+ try:
300
+ # Run pip install --upgrade tunacode-cli
301
+ result = subprocess.run(
302
+ ["pip", "install", "--upgrade", "tunacode-cli"],
303
+ capture_output=True,
304
+ text=True,
305
+ check=True
306
+ )
307
+
308
+ if result.returncode == 0:
309
+ await ui.success(f"🎉 Successfully updated to v{latest_version}!")
310
+ await ui.info("Please restart TunaCode to use the new version.")
311
+ else:
312
+ await ui.error(f"❌ Update failed: {result.stderr}")
313
+
314
+ except subprocess.CalledProcessError as e:
315
+ await ui.error(f"❌ Update failed: {e.stderr}")
316
+ except Exception as e:
317
+ await ui.error(f"❌ Update failed: {str(e)}")
318
+
319
+
280
320
  def list_cwd(max_depth=3):
281
321
  """
282
322
  Lists files in the current working directory up to a specified depth,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tunacode-cli
3
- Version: 0.0.6
3
+ Version: 0.0.7
4
4
  Summary: Your agentic CLI developer.
5
5
  Author-email: larock22 <noreply@github.com>
6
6
  License-Expression: MIT
@@ -71,16 +71,42 @@ Dynamic: license-file
71
71
 
72
72
  ## 🚀 Quick Start
73
73
 
74
+ ### One-Line Install (Linux/macOS)
75
+
76
+ ```bash
77
+ # Using curl
78
+ curl -sSL https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/install_linux.sh | bash
79
+
80
+ # Or using wget
81
+ wget -qO- https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/install_linux.sh | bash
82
+ ```
83
+
84
+ This creates a virtual environment in `~/.tunacode-venv` and adds the `tunacode` command to your PATH.
85
+
86
+ ### Alternative Install Methods
87
+
74
88
  ```bash
75
89
  # Install from PyPI
76
90
  pip install tunacode-cli
77
91
 
92
+ # Or install globally using pipx (recommended)
93
+ python3 -m pip install --user pipx
94
+ python3 -m pipx ensurepath
95
+ pipx install tunacode-cli
96
+ ```
97
+
98
+ ### Start Using TunaCode
99
+
100
+ ```bash
78
101
  # Run setup (first time only)
79
102
  tunacode
80
103
 
81
104
  # Start coding!
82
105
  tunacode
83
106
  > Help me refactor this codebase to use async/await
107
+
108
+ # Update to latest version
109
+ tunacode --update
84
110
  ```
85
111
 
86
112
  ## 📋 Commands
@@ -94,6 +120,7 @@ tunacode
94
120
  | `/branch <name>` | Create new git branch | `/branch feature/auth` |
95
121
  | `/compact` | Summarize and trim history | `/compact` |
96
122
  | `/help` | Show all commands | `/help` |
123
+ | `--update` | Update to latest version | `tunacode --update` |
97
124
 
98
125
  ## 🔧 Configuration
99
126
 
@@ -7,7 +7,7 @@ tunacode/setup.py,sha256=KCNhnu8FY5bFRqR0JMIh22xVakCC97kchmyGsUGUaJ4,1811
7
7
  tunacode/types.py,sha256=5mMJDgFqVcKzhtHh9unPISBFqkeNje6KISGUpRkqRjY,7146
8
8
  tunacode/cli/__init__.py,sha256=zgs0UbAck8hfvhYsWhWOfBe5oK09ug2De1r4RuQZREA,55
9
9
  tunacode/cli/commands.py,sha256=IHUza0gJUrN30sUHK9gU6-cSRV0TufViBU8qq0yzYbI,22979
10
- tunacode/cli/main.py,sha256=5_CXYtzN-Mc3nOv2Xpk6yfnV4d2SOgA9ENyTCe0cYYw,1226
10
+ tunacode/cli/main.py,sha256=-ZDDJHd4LUACrWxZ153fFgVcdSlr7GcQfXAcxyfxT7E,1470
11
11
  tunacode/cli/model_selector.py,sha256=EO3GY_YM6pByn4IuYYNn5bKQUCz6vaObFw7clJaJQD8,6190
12
12
  tunacode/cli/repl.py,sha256=-KvGMyYQk4WslSkGk0MVOUCB15DEp0BSPVWGj4TIZlo,8864
13
13
  tunacode/configuration/__init__.py,sha256=MbVXy8bGu0yKehzgdgZ_mfWlYGvIdb1dY2Ly75nfuPE,17
@@ -19,7 +19,7 @@ tunacode/core/state.py,sha256=0U_WU92yn5EQ27BLlHIkNIJJqjLMNHKNYSoba1rQqbQ,1376
19
19
  tunacode/core/tool_handler.py,sha256=OKx7jM8pml6pSEnoARu33_uBY8awJBqvhbVeBn6T4ow,1804
20
20
  tunacode/core/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  tunacode/core/agents/main.py,sha256=zsfSmUUHNFfEz9ludq9CZ13qaGJn91TrOyu1Pha_3-M,2339
22
- tunacode/core/agents/tinyagent_main.py,sha256=Yk0Fc_MKGJQqo-MIVGk8Q30Jnx4lumtF59O-eu_vuzw,5785
22
+ tunacode/core/agents/tinyagent_main.py,sha256=xVVlTY8BPfzdn7T_ORCKi9rqkmd_jWwN7QYo6zRk81s,5925
23
23
  tunacode/core/setup/__init__.py,sha256=jlveyriTXRcnoBLU6_TJ7Z-3E6EXjT9L5GD1vW4dei0,427
24
24
  tunacode/core/setup/agent_setup.py,sha256=k1bmQ21ue17_zZsWlhIfc7ZWN6vZtmOgKMMzR4Xu9-k,1410
25
25
  tunacode/core/setup/base.py,sha256=x9uYOITulrf4faP70NPTNBPb-wW1ZJGmcjAe0Sk5slk,961
@@ -39,7 +39,7 @@ tunacode/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  tunacode/tools/base.py,sha256=Cl-xthjTt6mlzvGsgmI-64m_8PCM1W8lccqsSemPq0k,8478
40
40
  tunacode/tools/read_file.py,sha256=QW97pPVcHvNJk48iPSwzOZ9Dbq_Ce8lQ7W0F82SXi7k,3051
41
41
  tunacode/tools/run_command.py,sha256=dspFV71g98gbOQV6CT9LsEoytQ_4zyVqqZD99zf__OY,3796
42
- tunacode/tools/tinyagent_tools.py,sha256=9JyTZgcvk2HVV6Q8UCS4tr0HPU6T2OMfS7AHJaMBgSw,2590
42
+ tunacode/tools/tinyagent_tools.py,sha256=wTeF5lfaYpa4GnWPq3qOo39QPcD3N2bMp670N1Luf9k,2579
43
43
  tunacode/tools/update_file.py,sha256=-ysza8w3eys1jj-oDFsamXiSVI28ONTkMQ4TJsoG6xs,4527
44
44
  tunacode/tools/write_file.py,sha256=taDr8nAnxYeEXz6W3tjzT_S96u2MiHD1puvJFfYxlbw,2919
45
45
  tunacode/ui/__init__.py,sha256=aRNE2pS50nFAX6y--rSGMNYwhz905g14gRd6g4BolYU,13
@@ -62,12 +62,12 @@ tunacode/utils/file_utils.py,sha256=AXiAJ_idtlmXEi9pMvwtfPy9Ys3yK-F4K7qb_NpwonU,
62
62
  tunacode/utils/lazy_imports.py,sha256=O5t6U1OaI7Ody69wPELQBh51aDyA5VxfLohZiD12oLY,1501
63
63
  tunacode/utils/regex_cache.py,sha256=vuB7c1HbZxcRKCE4R3DiOYvTpF1Nj4bcxW5nNEiOEAw,1093
64
64
  tunacode/utils/ripgrep.py,sha256=AXUs2FFt0A7KBV996deS8wreIlUzKOlAHJmwrcAr4No,583
65
- tunacode/utils/system.py,sha256=FSoibTIH0eybs4oNzbYyufIiV6gb77QaeY2yGqW39AY,11381
65
+ tunacode/utils/system.py,sha256=-mmYdP5_kkNVo2xUnKUL8JxtN-SVAlYx5erofEkYnUA,12641
66
66
  tunacode/utils/text_utils.py,sha256=B9M1cuLTm_SSsr15WNHF6j7WdLWPvWzKZV0Lvfgdbjg,2458
67
67
  tunacode/utils/user_configuration.py,sha256=uFrpSRTUf0CijZjw1rOp1sovqy1uyr0UNcn85S6jvdk,1790
68
- tunacode_cli-0.0.6.dist-info/licenses/LICENSE,sha256=SgvEceNP-y3_WodntkMGAkZyl_hAUvzBw5T9W--7YpM,1070
69
- tunacode_cli-0.0.6.dist-info/METADATA,sha256=7Tqjj-axKmfqKovX66Egt9YttEmEgC9CREPcVb3J1B0,7131
70
- tunacode_cli-0.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
71
- tunacode_cli-0.0.6.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
72
- tunacode_cli-0.0.6.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
73
- tunacode_cli-0.0.6.dist-info/RECORD,,
68
+ tunacode_cli-0.0.7.dist-info/licenses/LICENSE,sha256=SgvEceNP-y3_WodntkMGAkZyl_hAUvzBw5T9W--7YpM,1070
69
+ tunacode_cli-0.0.7.dist-info/METADATA,sha256=JoBpfeN_0GZaB3qbRNoaSTBXEvs0EQHDhcN7dNTn-BU,7859
70
+ tunacode_cli-0.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
71
+ tunacode_cli-0.0.7.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
72
+ tunacode_cli-0.0.7.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
73
+ tunacode_cli-0.0.7.dist-info/RECORD,,