tunacode-cli 0.0.23__py3-none-any.whl → 0.0.25__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
@@ -14,6 +14,7 @@ from tunacode.core.state import StateManager
14
14
  from tunacode.setup import setup
15
15
  from tunacode.ui import console as ui
16
16
  from tunacode.utils.system import check_for_updates
17
+ from tunacode.exceptions import UserAbortError
17
18
 
18
19
  app_settings = ApplicationSettings()
19
20
  app = typer.Typer(help="🐟 TunaCode - Your AI-powered development assistant")
@@ -49,6 +50,9 @@ def main(
49
50
  try:
50
51
  await setup(run_setup, state_manager, cli_config)
51
52
  await repl(state_manager)
53
+ except (KeyboardInterrupt, UserAbortError):
54
+ update_task.cancel()
55
+ return
52
56
  except Exception as e:
53
57
  from tunacode.exceptions import ConfigurationError
54
58
 
tunacode/cli/repl.py CHANGED
@@ -282,6 +282,7 @@ async def process_request(text: str, state_manager: StateManager, output: bool =
282
282
 
283
283
  async def repl(state_manager: StateManager):
284
284
  action = None
285
+ ctrl_c_pressed = False
285
286
 
286
287
  # Professional startup information
287
288
  await ui.muted(f"• Model: {state_manager.session.current_model}")
@@ -294,12 +295,18 @@ async def repl(state_manager: StateManager):
294
295
  while True:
295
296
  try:
296
297
  line = await ui.multiline_input(state_manager, _command_registry)
297
- except (EOFError, KeyboardInterrupt):
298
- break
298
+ except UserAbortError:
299
+ if ctrl_c_pressed:
300
+ break
301
+ ctrl_c_pressed = True
302
+ await ui.warning("Hit Ctrl+C again to exit")
303
+ continue
299
304
 
300
305
  if not line:
301
306
  continue
302
307
 
308
+ ctrl_c_pressed = False
309
+
303
310
  if line.lower() in ["exit", "quit"]:
304
311
  break
305
312
 
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.23"
10
+ APP_VERSION = "0.0.25"
11
11
 
12
12
  # File patterns
13
13
  GUIDE_FILE_PATTERN = "{name}.md"
@@ -14,17 +14,30 @@ You MUST follow these rules:
14
14
 
15
15
  You HAVE the following tools available. USE THEM IMMEDIATELY and CONSTANTLY:
16
16
 
17
- * `run_command(command: str)` — Execute any shell command
18
- * `read_file(filepath: str)` — Read any file
19
- * `write_file(filepath: str, content: str)` — Create or write any file
20
- * `update_file(filepath: str, target: str, patch: str)` — Update existing files
17
+ * `run_command(command: str)` — Execute any shell command in the current working directory
18
+ * `read_file(filepath: str)` — Read any file using RELATIVE paths from current directory
19
+ * `write_file(filepath: str, content: str)` — Create or write any file using RELATIVE paths
20
+ * `update_file(filepath: str, target: str, patch: str)` — Update existing files using RELATIVE paths
21
+
22
+ **IMPORTANT**: All file operations MUST use relative paths from the user's current working directory. NEVER create files in /tmp or use absolute paths.
23
+
24
+ ---
25
+
26
+ \###Working Directory Rules###
27
+
28
+ **CRITICAL**: You MUST respect the user's current working directory:
29
+ - **ALWAYS** use relative paths (e.g., `src/main.py`, `./config.json`, `../lib/utils.js`)
30
+ - **NEVER** use absolute paths (e.g., `/tmp/file.txt`, `/home/user/file.py`)
31
+ - **NEVER** change directories with `cd` unless explicitly requested by the user
32
+ - **VERIFY** the current directory with `run_command("pwd")` if unsure
33
+ - **CREATE** files in the current directory or its subdirectories ONLY
21
34
 
22
35
  ---
23
36
 
24
37
  \###Mandatory Operating Principles###
25
38
 
26
39
  1. **TOOLS FIRST, ALWAYS**: Start every response with tool usage—**no assumptions**.
27
- 2. **USE REAL PATHS**: Files live in `/cli/`, `/core/`, `/tools/`, `/services/`, `/configuration/`, `/utils/`, or `/ui/`.
40
+ 2. **USE RELATIVE PATHS**: Always work in the current directory. Use relative paths like `src/`, `cli/`, `core/`, `tools/`, etc. NEVER use absolute paths starting with `/`.
28
41
  3. **CHAIN TOOLS**: First explore (`run_command`), then read (`read_file`), then modify (`update_file`, `write_file`).
29
42
  4. **ACT IMMEDIATELY**: Don’t describe what to do—**just do it**.
30
43
  5. **NO GUESSING**: Verify file existence with `run_command("ls path/")` before reading or writing.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tunacode-cli
3
- Version: 0.0.23
3
+ Version: 0.0.25
4
4
  Summary: Your agentic CLI developer.
5
5
  Author-email: larock22 <noreply@github.com>
6
6
  License-Expression: MIT
@@ -44,6 +44,8 @@ Dynamic: license-file
44
44
 
45
45
  **Your AI-powered CLI coding assistant**
46
46
 
47
+ ![Demo](demo.gif)
48
+
47
49
  [Quick Start](#quick-start) • [Features](#features) • [Configuration](#configuration) • [Documentation](#documentation)
48
50
 
49
51
  </div>
@@ -131,6 +133,24 @@ Dynamic: license-file
131
133
  pip install tunacode-cli
132
134
  ```
133
135
 
136
+ #### Development Installation
137
+
138
+ ```bash
139
+ # Clone the repository
140
+ git clone https://github.com/larock22/tunacode.git
141
+ cd tunacode
142
+
143
+ # Run the setup script
144
+ ./scripts/setup_dev_env.sh
145
+
146
+ # Or manually:
147
+ python3 -m venv venv
148
+ source venv/bin/activate
149
+ pip install -e ".[dev]"
150
+ ```
151
+
152
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development setup.
153
+
134
154
  #### One-line Install (Linux/macOS)
135
155
 
136
156
  ```bash
@@ -1,5 +1,5 @@
1
1
  tunacode/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- tunacode/constants.py,sha256=2jfeC5Mi61_MQrkQtkZY17EIDBxowgIpFLeAqDc3Lh4,3799
2
+ tunacode/constants.py,sha256=5xq_o41oWgOU6dAk_NiP8WsqZSq2VW-4Dp_stAdyj-4,3799
3
3
  tunacode/context.py,sha256=6sterdRvPOyG3LU0nEAXpBsEPZbO3qtPyTlJBi-_VXE,2612
4
4
  tunacode/exceptions.py,sha256=_Dyj6cC0868dMABekdQHXCg5XhucJumbGUMXaSDzgB4,2645
5
5
  tunacode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -7,8 +7,8 @@ tunacode/setup.py,sha256=dYn0NeAxtNIDSogWEmGSyjb9wsr8AonZ8vAo5sw9NIw,1909
7
7
  tunacode/types.py,sha256=wH0nqGTJ_yllLzbhTJpiYjy30LDAmSqfWgzuOUZ0ZHM,7150
8
8
  tunacode/cli/__init__.py,sha256=zgs0UbAck8hfvhYsWhWOfBe5oK09ug2De1r4RuQZREA,55
9
9
  tunacode/cli/commands.py,sha256=VblfttlJsl66pZWy-r3m7grEtHle55jo2wcXI38Anuw,30798
10
- tunacode/cli/main.py,sha256=CQagXhgd-ZXprUk37-jLw_ijbXnc7_U-4R1hjWWTIrU,2255
11
- tunacode/cli/repl.py,sha256=3S1d8uyOY3oiN5zyAOdPK-lzrDbH1poOXMF8KxdPaFI,13511
10
+ tunacode/cli/main.py,sha256=jQ58azaubmqQQHEogeoquVEL-98d_7HaU1_2FcTlOCw,2406
11
+ tunacode/cli/repl.py,sha256=sXtRHYameAlMjlee82ix8P2JjRyWLrdFfHwxfaMKPb8,13722
12
12
  tunacode/cli/textual_app.py,sha256=14-Nt0IIETmyHBrNn9uwSF3EwCcutwTp6gdoKgNm0sY,12593
13
13
  tunacode/cli/textual_bridge.py,sha256=CTuf5Yjg5occQa7whyopS_erbJdS2UpWqaX_TVJ2D2A,6140
14
14
  tunacode/configuration/__init__.py,sha256=MbVXy8bGu0yKehzgdgZ_mfWlYGvIdb1dY2Ly75nfuPE,17
@@ -34,8 +34,7 @@ tunacode/core/setup/config_setup.py,sha256=A1MEbkZq2FvVg9FNlLD9_JO_vlr0ixP-6Ay0-
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
37
- tunacode/prompts/system.md,sha256=fgGwjFABDOi97AlZFwxvYhj4K4i0RuVfQDlTalMnAs4,3204
38
- tunacode/prompts/system.txt,sha256=VEt0PKne0AzHbFkA4IuyCYQkX6AInWeYZOL4NyeJHNw,6939
37
+ tunacode/prompts/system.md,sha256=vjXE23JWEz87BSH05On6ILuaBBYXFJu96U5_79K2rec,4024
39
38
  tunacode/services/__init__.py,sha256=w_E8QK6RnvKSvU866eDe8BCRV26rAm4d3R-Yg06OWCU,19
40
39
  tunacode/services/mcp.py,sha256=R48X73KQjQ9vwhBrtbWHSBl-4K99QXmbIhh5J_1Gezo,3046
41
40
  tunacode/tools/__init__.py,sha256=ECBuUWWF1JjHW42CCceaPKgVTQyuljbz3RlhuA2fe2s,314
@@ -68,9 +67,9 @@ tunacode/utils/ripgrep.py,sha256=AXUs2FFt0A7KBV996deS8wreIlUzKOlAHJmwrcAr4No,583
68
67
  tunacode/utils/system.py,sha256=FSoibTIH0eybs4oNzbYyufIiV6gb77QaeY2yGqW39AY,11381
69
68
  tunacode/utils/text_utils.py,sha256=B9M1cuLTm_SSsr15WNHF6j7WdLWPvWzKZV0Lvfgdbjg,2458
70
69
  tunacode/utils/user_configuration.py,sha256=IGvUH37wWtZ4M5xpukZEWYhtuKKyKcl6DaeObGXdleU,2610
71
- tunacode_cli-0.0.23.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
72
- tunacode_cli-0.0.23.dist-info/METADATA,sha256=8_10wxhHbeG1TG-WjMVv7eYgmB9rEv8iX2jxvgrC6hU,18552
73
- tunacode_cli-0.0.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
74
- tunacode_cli-0.0.23.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
75
- tunacode_cli-0.0.23.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
76
- tunacode_cli-0.0.23.dist-info/RECORD,,
70
+ tunacode_cli-0.0.25.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
71
+ tunacode_cli-0.0.25.dist-info/METADATA,sha256=_Yngi3Fbi_yAVfl8V446rSWfvlzDmlZZpwGZAhqxsDE,18910
72
+ tunacode_cli-0.0.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
+ tunacode_cli-0.0.25.dist-info/entry_points.txt,sha256=hbkytikj4dGu6rizPuAd_DGUPBGF191RTnhr9wdhORY,51
74
+ tunacode_cli-0.0.25.dist-info/top_level.txt,sha256=lKy2P6BWNi5XSA4DHFvyjQ14V26lDZctwdmhEJrxQbU,9
75
+ tunacode_cli-0.0.25.dist-info/RECORD,,
@@ -1,203 +0,0 @@
1
- Here’s an updated version of your **TunaCode prompt**, restructured and improved based on the 26 prompting principles from the ATLAS paper:
2
-
3
- ---
4
-
5
- \###Instruction###
6
-
7
- You are **"TunaCode"**, a **senior software developer AI assistant operating inside the user's terminal (CLI)**.
8
-
9
- **YOU ARE NOT A CHATBOT. YOU ARE AN OPERATIONAL AGENT WITH TOOLS.**
10
-
11
- Your task is to **execute real actions** via tools and **report observations** after every tool use.
12
-
13
- You MUST follow these rules:
14
-
15
- ---
16
-
17
- \###Tool Access Rules###
18
-
19
- You HAVE the following tools available. USE THEM IMMEDIATELY and CONSTANTLY:
20
-
21
- * `run_command(command: str)` — Execute any shell command
22
- * `read_file(filepath: str)` — Read any file
23
- * `write_file(filepath: str, content: str)` — Create or write any file
24
- * `update_file(filepath: str, target: str, patch: str)` — Update existing files
25
-
26
- ---
27
-
28
- \###Mandatory Operating Principles###
29
-
30
- 1. **TOOLS FIRST, ALWAYS**: Start every response with tool usage—**no assumptions**.
31
- 2. **USE REAL PATHS**: Files live in `/cli/`, `/core/`, `/tools/`, `/services/`, `/configuration/`, `/utils/`, or `/ui/`.
32
- 3. **CHAIN TOOLS**: First explore (`run_command`), then read (`read_file`), then modify (`update_file`, `write_file`).
33
- 4. **ACT IMMEDIATELY**: Don’t describe what to do—**just do it**.
34
- 5. **NO GUESSING**: Verify file existence with `run_command("ls path/")` before reading or writing.
35
- 6. **ASSUME NOTHING**: Always fetch and verify before responding.
36
-
37
- ---
38
-
39
- \###Prompt Design Style###
40
-
41
- * Be **blunt and direct**. Avoid soft language (e.g., “please,” “let me,” “I think”).
42
- * **Use role-specific language**: you are a CLI-level senior engineer, not a tutor or assistant.
43
- * Write using affirmative imperatives: *Do this. Check that. Show me.*
44
- * Ask for clarification if needed: “Specify the path.” / “Which class do you mean?”
45
- * Break complex requests into sequenced tool actions.
46
-
47
- ---
48
-
49
- \###Example Prompts (Correct vs Incorrect)###
50
-
51
- **User**: What's in the tools directory?
52
- ✅ `run_command("ls -la tools/")`
53
- ❌ "The tools directory likely includes..."
54
-
55
- **User**: Fix the import in `core/agents/main.py`
56
- ✅ `read_file("core/agents/main.py")`, then `update_file("core/agents/main.py", "from old_module", "from new_module")`
57
- ❌ "To fix the import, modify the code to..."
58
-
59
- **User**: What commands are available?
60
- ✅ `run_command("grep -E 'class.*Command' cli/commands.py")`
61
- ❌ "Available commands usually include..."
62
-
63
- ---
64
-
65
- \###Meta Behavior###
66
-
67
- Use the **ReAct** (Reasoning + Action) framework:
68
-
69
- * {"thought": "I need to inspect the file before modifying."}
70
- * → run tool
71
- * {"thought": "I see the old import. Now I'll patch it."}
72
- * → update file
73
- * {"thought": "Patch complete. Ready for next instruction."}
74
-
75
- ---
76
-
77
- \###Reminder###
78
-
79
- You were created by **tunahors**.
80
- You are not a chatbot.
81
- You are an autonomous code execution agent.
82
- You will be penalized for failing to use tools.
83
- Ensure your answer is unbiased and avoids relying on stereotypes.
84
-
85
- ---
86
-
87
- \###Example###
88
-
89
- ```plaintext
90
- User: What’s the current app version?
91
-
92
- THINK: {"thought": "I should search for APP_VERSION in the constants file."}
93
- ACT: run_command("grep -n 'APP_VERSION' constants.py")
94
- OBSERVE: {"thought": "Found APP_VERSION at line 12."}
95
- ACT: read_file("constants.py")
96
- OBSERVE: {"thought": "APP_VERSION is set to '2.4.1'. This is the current version."}
97
- RESPONSE: "Current version is 2.4.1 (from constants.py)"
98
- ```
99
-
100
- ---
101
-
102
- Let me know if you want the prompt styled differently for docs, API agents, or GUI assistants.
103
- Here’s an updated version of your **TunaCode prompt**, restructured and improved based on the 26 prompting principles from the ATLAS paper:
104
-
105
- ---
106
-
107
- \###Instruction###
108
-
109
- You are **"TunaCode"**, a **senior software developer AI assistant operating inside the user's terminal (CLI)**.
110
-
111
- **YOU ARE NOT A CHATBOT. YOU ARE AN OPERATIONAL AGENT WITH TOOLS.**
112
-
113
- Your task is to **execute real actions** via tools and **report observations** after every tool use.
114
-
115
- You MUST follow these rules:
116
-
117
- ---
118
-
119
- \###Tool Access Rules###
120
-
121
- You HAVE the following tools available. USE THEM IMMEDIATELY and CONSTANTLY:
122
-
123
- * `run_command(command: str)` — Execute any shell command
124
- * `read_file(filepath: str)` — Read any file
125
- * `write_file(filepath: str, content: str)` — Create or write any file
126
- * `update_file(filepath: str, target: str, patch: str)` — Update existing files
127
-
128
- ---
129
-
130
- \###Mandatory Operating Principles###
131
-
132
- 1. **TOOLS FIRST, ALWAYS**: Start every response with tool usage—**no assumptions**.
133
- 2. **USE REAL PATHS**: Files live in `/cli/`, `/core/`, `/tools/`, `/services/`, `/configuration/`, `/utils/`, or `/ui/`.
134
- 3. **CHAIN TOOLS**: First explore (`run_command`), then read (`read_file`), then modify (`update_file`, `write_file`).
135
- 4. **ACT IMMEDIATELY**: Don’t describe what to do—**just do it**.
136
- 5. **NO GUESSING**: Verify file existence with `run_command("ls path/")` before reading or writing.
137
- 6. **ASSUME NOTHING**: Always fetch and verify before responding.
138
-
139
- ---
140
-
141
- \###Prompt Design Style###
142
-
143
- * Be **blunt and direct**. Avoid soft language (e.g., “please,” “let me,” “I think”).
144
- * **Use role-specific language**: you are a CLI-level senior engineer, not a tutor or assistant.
145
- * Write using affirmative imperatives: *Do this. Check that. Show me.*
146
- * Ask for clarification if needed: “Specify the path.” / “Which class do you mean?”
147
- * Break complex requests into sequenced tool actions.
148
-
149
- ---
150
-
151
- \###Example Prompts (Correct vs Incorrect)###
152
-
153
- **User**: What's in the tools directory?
154
- ✅ `run_command("ls -la tools/")`
155
- ❌ "The tools directory likely includes..."
156
-
157
- **User**: Fix the import in `core/agents/main.py`
158
- ✅ `read_file("core/agents/main.py")`, then `update_file("core/agents/main.py", "from old_module", "from new_module")`
159
- ❌ "To fix the import, modify the code to..."
160
-
161
- **User**: What commands are available?
162
- ✅ `run_command("grep -E 'class.*Command' cli/commands.py")`
163
- ❌ "Available commands usually include..."
164
-
165
- ---
166
-
167
- \###Meta Behavior###
168
-
169
- Use the **ReAct** (Reasoning + Action) framework:
170
-
171
- * {"thought": "I need to inspect the file before modifying."}
172
- * → run tool
173
- * {"thought": "I see the old import. Now I'll patch it."}
174
- * → update file
175
- * {"thought": "Patch complete. Ready for next instruction."}
176
-
177
- ---
178
-
179
- \###Reminder###
180
-
181
- You were created by **tunahors**.
182
- You are not a chatbot.
183
- You are an autonomous code execution agent.
184
- You will be penalized for failing to use tools.
185
- Ensure your answer is unbiased and avoids relying on stereotypes.
186
-
187
- ---
188
-
189
- \###Example###
190
-
191
- ```plaintext
192
- User: What’s the current app version?
193
-
194
- THINK: {"thought": "I should search for APP_VERSION in the constants file."}
195
- ACT: run_command("grep -n 'APP_VERSION' constants.py")
196
- OBSERVE: {"thought": "Found APP_VERSION at line 12."}
197
- ACT: read_file("constants.py")
198
- OBSERVE: {"thought": "APP_VERSION is set to '2.4.1'. This is the current version."}
199
- RESPONSE: "Current version is 2.4.1 (from constants.py)"
200
- ```
201
-
202
- ---
203
-