tunacode-cli 0.0.19__py3-none-any.whl → 0.0.21__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 +3 -1
- tunacode/constants.py +1 -1
- tunacode/core/setup/config_setup.py +22 -2
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.21.dist-info}/METADATA +1 -1
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.21.dist-info}/RECORD +9 -9
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.21.dist-info}/WHEEL +0 -0
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.21.dist-info}/entry_points.txt +0 -0
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.21.dist-info}/licenses/LICENSE +0 -0
- {tunacode_cli-0.0.19.dist-info → tunacode_cli-0.0.21.dist-info}/top_level.txt +0 -0
tunacode/cli/main.py
CHANGED
|
@@ -50,7 +50,9 @@ 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
|
+
import traceback
|
|
54
|
+
|
|
55
|
+
await ui.error(f"{str(e)}\n\nTraceback:\n{traceback.format_exc()}")
|
|
54
56
|
|
|
55
57
|
has_update, latest_version = await update_task
|
|
56
58
|
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
|
|
@@ -150,7 +156,9 @@ class ConfigSetup(BaseSetup):
|
|
|
150
156
|
|
|
151
157
|
# Only continue if at least one API key was provided
|
|
152
158
|
env = self.state_manager.session.user_config.get("env", {})
|
|
153
|
-
has_api_key =
|
|
159
|
+
has_api_key = (
|
|
160
|
+
any(key.endswith("_API_KEY") and env.get(key) for key in env) if env else False
|
|
161
|
+
)
|
|
154
162
|
|
|
155
163
|
if has_api_key:
|
|
156
164
|
if not self.state_manager.session.user_config.get("default_model"):
|
|
@@ -179,7 +187,15 @@ class ConfigSetup(BaseSetup):
|
|
|
179
187
|
"Skip the ones you don't need."
|
|
180
188
|
)
|
|
181
189
|
await ui.panel("Setup", message, border_style=UI_COLORS["primary"])
|
|
182
|
-
|
|
190
|
+
env_config = self.state_manager.session.user_config.get("env")
|
|
191
|
+
if not env_config:
|
|
192
|
+
self.state_manager.session.user_config["env"] = DEFAULT_USER_CONFIG["env"].copy()
|
|
193
|
+
env_config = self.state_manager.session.user_config["env"]
|
|
194
|
+
|
|
195
|
+
# Ensure env_config is not None before copying
|
|
196
|
+
if env_config is None:
|
|
197
|
+
env_config = {}
|
|
198
|
+
env_keys = env_config.copy()
|
|
183
199
|
for key in env_keys:
|
|
184
200
|
provider = key_to_title(key)
|
|
185
201
|
val = await ui.input(
|
|
@@ -248,6 +264,10 @@ class ConfigSetup(BaseSetup):
|
|
|
248
264
|
|
|
249
265
|
# Apply CLI overrides
|
|
250
266
|
if self.cli_config.get("key"):
|
|
267
|
+
# Ensure env dict exists
|
|
268
|
+
if "env" not in self.state_manager.session.user_config:
|
|
269
|
+
self.state_manager.session.user_config["env"] = {}
|
|
270
|
+
|
|
251
271
|
# Determine which API key to set based on the model or baseurl
|
|
252
272
|
if self.cli_config.get("baseurl") and "openrouter" in self.cli_config["baseurl"]:
|
|
253
273
|
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=Ym48fTSA-gbabExgqEHRHXhF26j8BdFV9dgNvOuH824,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=cHHudWzbf0xJASYK6CkAQn8h3s7gS-TWyzR27sOcofw,1945
|
|
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=-t8Akv4rVme_FU14N-mmF4NHHpVfsHccodZvncmG6r0,14134
|
|
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.21.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
|
|
71
|
+
tunacode_cli-0.0.21.dist-info/METADATA,sha256=0J9IjicKgu-Znos9pg8cvysobz269IEfwkFrZX578fY,18552
|
|
72
|
+
tunacode_cli-0.0.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
73
|
+
tunacode_cli-0.0.21.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
|
|
74
|
+
tunacode_cli-0.0.21.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
|
|
75
|
+
tunacode_cli-0.0.21.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|