tunacode-cli 0.0.19__py3-none-any.whl → 0.0.22__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 +9 -2
- tunacode/constants.py +1 -1
- tunacode/core/setup/config_setup.py +24 -3
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.22.dist-info}/METADATA +1 -1
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.22.dist-info}/RECORD +9 -9
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.22.dist-info}/WHEEL +0 -0
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.22.dist-info}/entry_points.txt +0 -0
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.22.dist-info}/licenses/LICENSE +0 -0
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.22.dist-info}/top_level.txt +0 -0
tunacode/cli/main.py
CHANGED
|
@@ -40,7 +40,7 @@ def main(
|
|
|
40
40
|
await ui.banner()
|
|
41
41
|
|
|
42
42
|
# Start update check in background
|
|
43
|
-
update_task = asyncio.to_thread(check_for_updates)
|
|
43
|
+
update_task = asyncio.create_task(asyncio.to_thread(check_for_updates))
|
|
44
44
|
|
|
45
45
|
cli_config = {}
|
|
46
46
|
if baseurl or model or key:
|
|
@@ -50,7 +50,14 @@ def main(
|
|
|
50
50
|
await setup(run_setup, state_manager, cli_config)
|
|
51
51
|
await repl(state_manager)
|
|
52
52
|
except Exception as e:
|
|
53
|
-
|
|
53
|
+
from tunacode.exceptions import ConfigurationError
|
|
54
|
+
if isinstance(e, ConfigurationError):
|
|
55
|
+
# ConfigurationError already printed helpful message, just exit cleanly
|
|
56
|
+
update_task.cancel() # Cancel the update check
|
|
57
|
+
return
|
|
58
|
+
import traceback
|
|
59
|
+
|
|
60
|
+
await ui.error(f"{str(e)}\n\nTraceback:\n{traceback.format_exc()}")
|
|
54
61
|
|
|
55
62
|
has_update, latest_version = await update_task
|
|
56
63
|
if has_update:
|
tunacode/constants.py
CHANGED
|
@@ -75,6 +75,12 @@ class ConfigSetup(BaseSetup):
|
|
|
75
75
|
else:
|
|
76
76
|
if force_setup:
|
|
77
77
|
await ui.muted("Running setup process, resetting config")
|
|
78
|
+
# Ensure user_config is properly initialized
|
|
79
|
+
if (
|
|
80
|
+
not hasattr(self.state_manager.session, "user_config")
|
|
81
|
+
or self.state_manager.session.user_config is None
|
|
82
|
+
):
|
|
83
|
+
self.state_manager.session.user_config = {}
|
|
78
84
|
self.state_manager.session.user_config = DEFAULT_USER_CONFIG.copy()
|
|
79
85
|
user_configuration.save_config(
|
|
80
86
|
self.state_manager
|
|
@@ -96,7 +102,8 @@ class ConfigSetup(BaseSetup):
|
|
|
96
102
|
" [green]tunacode --model 'openrouter:anthropic/claude-3.5-sonnet' --key 'your-key' --baseurl 'https://openrouter.ai/api/v1'[/green]"
|
|
97
103
|
)
|
|
98
104
|
console.print("\n[yellow]Run 'tunacode --help' for more options[/yellow]\n")
|
|
99
|
-
|
|
105
|
+
from tunacode.exceptions import ConfigurationError
|
|
106
|
+
raise ConfigurationError("No configuration found. Please use CLI flags to configure.")
|
|
100
107
|
|
|
101
108
|
if not self.state_manager.session.user_config.get("default_model"):
|
|
102
109
|
raise ConfigurationError(
|
|
@@ -150,7 +157,9 @@ class ConfigSetup(BaseSetup):
|
|
|
150
157
|
|
|
151
158
|
# Only continue if at least one API key was provided
|
|
152
159
|
env = self.state_manager.session.user_config.get("env", {})
|
|
153
|
-
has_api_key =
|
|
160
|
+
has_api_key = (
|
|
161
|
+
any(key.endswith("_API_KEY") and env.get(key) for key in env) if env else False
|
|
162
|
+
)
|
|
154
163
|
|
|
155
164
|
if has_api_key:
|
|
156
165
|
if not self.state_manager.session.user_config.get("default_model"):
|
|
@@ -179,7 +188,15 @@ class ConfigSetup(BaseSetup):
|
|
|
179
188
|
"Skip the ones you don't need."
|
|
180
189
|
)
|
|
181
190
|
await ui.panel("Setup", message, border_style=UI_COLORS["primary"])
|
|
182
|
-
|
|
191
|
+
env_config = self.state_manager.session.user_config.get("env")
|
|
192
|
+
if not env_config:
|
|
193
|
+
self.state_manager.session.user_config["env"] = DEFAULT_USER_CONFIG["env"].copy()
|
|
194
|
+
env_config = self.state_manager.session.user_config["env"]
|
|
195
|
+
|
|
196
|
+
# Ensure env_config is not None before copying
|
|
197
|
+
if env_config is None:
|
|
198
|
+
env_config = {}
|
|
199
|
+
env_keys = env_config.copy()
|
|
183
200
|
for key in env_keys:
|
|
184
201
|
provider = key_to_title(key)
|
|
185
202
|
val = await ui.input(
|
|
@@ -248,6 +265,10 @@ class ConfigSetup(BaseSetup):
|
|
|
248
265
|
|
|
249
266
|
# Apply CLI overrides
|
|
250
267
|
if self.cli_config.get("key"):
|
|
268
|
+
# Ensure env dict exists
|
|
269
|
+
if "env" not in self.state_manager.session.user_config:
|
|
270
|
+
self.state_manager.session.user_config["env"] = {}
|
|
271
|
+
|
|
251
272
|
# Determine which API key to set based on the model or baseurl
|
|
252
273
|
if self.cli_config.get("baseurl") and "openrouter" in self.cli_config["baseurl"]:
|
|
253
274
|
self.state_manager.session.user_config["env"]["OPENROUTER_API_KEY"] = (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
tunacode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
tunacode/constants.py,sha256=
|
|
2
|
+
tunacode/constants.py,sha256=N_CLpRt2L3j1KkQejeBlv1NoY0RPaL8eKW6_jceUVyY,3799
|
|
3
3
|
tunacode/context.py,sha256=9FQ2vf9qY4bcRufKtR0g0eOzB8hZ4aesOfFGy_JOMzQ,2634
|
|
4
4
|
tunacode/exceptions.py,sha256=_Dyj6cC0868dMABekdQHXCg5XhucJumbGUMXaSDzgB4,2645
|
|
5
5
|
tunacode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -7,7 +7,7 @@ tunacode/setup.py,sha256=dYn0NeAxtNIDSogWEmGSyjb9wsr8AonZ8vAo5sw9NIw,1909
|
|
|
7
7
|
tunacode/types.py,sha256=5mMJDgFqVcKzhtHh9unPISBFqkeNje6KISGUpRkqRjY,7146
|
|
8
8
|
tunacode/cli/__init__.py,sha256=zgs0UbAck8hfvhYsWhWOfBe5oK09ug2De1r4RuQZREA,55
|
|
9
9
|
tunacode/cli/commands.py,sha256=ZsIfNStLeVAENXzz1bvJUa3IThpeDrc_xjS0eT9wauM,30798
|
|
10
|
-
tunacode/cli/main.py,sha256=
|
|
10
|
+
tunacode/cli/main.py,sha256=GmRwHkYMVM56h95ktaP4f9a-HUdrf3vZ_si30Ak7XMQ,2254
|
|
11
11
|
tunacode/cli/repl.py,sha256=t4lSv5rIZeqWQptUAsBhnLQty2znFKX_2csaNEkuVdU,13375
|
|
12
12
|
tunacode/cli/textual_app.py,sha256=1GNyYacMqCgIgYl1G2B5sIoksIAzKiGuPJ-wxHhzu5I,12951
|
|
13
13
|
tunacode/cli/textual_bridge.py,sha256=DcIbIbYBW4rDKMTWDqAKgWv7PtxZYBKGUcYo7uLSzuM,6175
|
|
@@ -30,7 +30,7 @@ tunacode/core/llm/planner.py,sha256=Vv0CIn4oS3wzdWZs6WY8R-ALzBWaHtR40Wx-_xW3gmc,
|
|
|
30
30
|
tunacode/core/setup/__init__.py,sha256=lzdpY6rIGf9DDlDBDGFvQZaSOQeFsNglHbkpq1-GtU8,376
|
|
31
31
|
tunacode/core/setup/agent_setup.py,sha256=trELO8cPnWo36BBnYmXDEnDPdhBg0p-VLnx9A8hSSSQ,1401
|
|
32
32
|
tunacode/core/setup/base.py,sha256=cbyT2-xK2mWgH4EO17VfM_OM2bj0kT895NW2jSXbe3c,968
|
|
33
|
-
tunacode/core/setup/config_setup.py,sha256=
|
|
33
|
+
tunacode/core/setup/config_setup.py,sha256=Vtab0P7ZuHTxf-HmllvXHYy9kHBy4OIs0guN8cgjqzY,14268
|
|
34
34
|
tunacode/core/setup/coordinator.py,sha256=oVTN2xIeJERXitVJpkIk9tDGLs1D1bxIRmaogJwZJFI,2049
|
|
35
35
|
tunacode/core/setup/environment_setup.py,sha256=n3IrObKEynHZSwtUJ1FddMg2C4sHz7ca42awemImV8s,2225
|
|
36
36
|
tunacode/core/setup/git_safety_setup.py,sha256=T7hwIf3u3Tq3QtIdUAfuHI6vclMfm2Sqcml5l6x02oA,6799
|
|
@@ -67,9 +67,9 @@ tunacode/utils/ripgrep.py,sha256=AXUs2FFt0A7KBV996deS8wreIlUzKOlAHJmwrcAr4No,583
|
|
|
67
67
|
tunacode/utils/system.py,sha256=FSoibTIH0eybs4oNzbYyufIiV6gb77QaeY2yGqW39AY,11381
|
|
68
68
|
tunacode/utils/text_utils.py,sha256=B9M1cuLTm_SSsr15WNHF6j7WdLWPvWzKZV0Lvfgdbjg,2458
|
|
69
69
|
tunacode/utils/user_configuration.py,sha256=IGvUH37wWtZ4M5xpukZEWYhtuKKyKcl6DaeObGXdleU,2610
|
|
70
|
-
tunacode_cli-0.0.
|
|
71
|
-
tunacode_cli-0.0.
|
|
72
|
-
tunacode_cli-0.0.
|
|
73
|
-
tunacode_cli-0.0.
|
|
74
|
-
tunacode_cli-0.0.
|
|
75
|
-
tunacode_cli-0.0.
|
|
70
|
+
tunacode_cli-0.0.22.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
|
|
71
|
+
tunacode_cli-0.0.22.dist-info/METADATA,sha256=ZnF-83DdljMDRpAqpVkXQT5LjRrtI8HGSYctTpc0dzk,18552
|
|
72
|
+
tunacode_cli-0.0.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
73
|
+
tunacode_cli-0.0.22.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
|
|
74
|
+
tunacode_cli-0.0.22.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
|
|
75
|
+
tunacode_cli-0.0.22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|