tunacode-cli 0.0.10__tar.gz → 0.0.12__tar.gz
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-0.0.10 → tunacode_cli-0.0.12}/PKG-INFO +115 -40
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/README.md +112 -38
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/pyproject.toml +4 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/cli/commands.py +3 -4
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/cli/main.py +5 -4
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/cli/repl.py +2 -13
- tunacode_cli-0.0.12/src/tunacode/cli/textual_app.py +423 -0
- tunacode_cli-0.0.12/src/tunacode/cli/textual_bridge.py +158 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/configuration/defaults.py +3 -4
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/configuration/models.py +3 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/configuration/settings.py +2 -2
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/constants.py +2 -10
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/agents/main.py +3 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/setup/__init__.py +0 -2
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/setup/agent_setup.py +3 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/setup/base.py +3 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/setup/config_setup.py +16 -6
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/setup/coordinator.py +2 -2
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/setup/environment_setup.py +2 -2
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/setup/git_safety_setup.py +1 -2
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/state.py +3 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/setup.py +2 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/tools/base.py +4 -43
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/tools/read_file.py +2 -2
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/tools/run_command.py +2 -2
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/tools/update_file.py +3 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/tools/write_file.py +3 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/completers.py +1 -1
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/console.py +2 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/constants.py +1 -1
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/decorators.py +2 -2
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/input.py +1 -1
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/keybindings.py +1 -1
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/output.py +11 -4
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/panels.py +3 -4
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/prompt_manager.py +1 -1
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/validators.py +1 -1
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/utils/diff_utils.py +3 -3
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode_cli.egg-info/PKG-INFO +115 -40
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode_cli.egg-info/SOURCES.txt +2 -2
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode_cli.egg-info/requires.txt +2 -1
- tunacode_cli-0.0.10/src/tunacode/core/setup/undo_setup.py +0 -33
- tunacode_cli-0.0.10/src/tunacode/services/undo_service.py +0 -244
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/LICENSE +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/setup.cfg +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/setup.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/__init__.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/cli/__init__.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/configuration/__init__.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/context.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/__init__.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/agents/__init__.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/core/tool_handler.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/exceptions.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/prompts/system.txt +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/py.typed +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/services/__init__.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/services/mcp.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/tools/__init__.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/types.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/__init__.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/lexers.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/ui/tool_ui.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/utils/__init__.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/utils/bm25.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/utils/file_utils.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/utils/ripgrep.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/utils/system.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/utils/text_utils.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode/utils/user_configuration.py +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode_cli.egg-info/dependency_links.txt +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode_cli.egg-info/entry_points.txt +0 -0
- {tunacode_cli-0.0.10 → tunacode_cli-0.0.12}/src/tunacode_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tunacode-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.12
|
|
4
4
|
Summary: Your agentic CLI developer.
|
|
5
5
|
Author-email: larock22 <noreply@github.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -19,11 +19,11 @@ Classifier: Topic :: Utilities
|
|
|
19
19
|
Requires-Python: >=3.10
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
|
+
Requires-Dist: typer==0.15.3
|
|
22
23
|
Requires-Dist: prompt_toolkit==3.0.51
|
|
23
24
|
Requires-Dist: pydantic-ai[logfire]==0.2.6
|
|
24
25
|
Requires-Dist: pygments==2.19.1
|
|
25
26
|
Requires-Dist: rich==14.0.0
|
|
26
|
-
Requires-Dist: typer==0.15.3
|
|
27
27
|
Provides-Extra: dev
|
|
28
28
|
Requires-Dist: build; extra == "dev"
|
|
29
29
|
Requires-Dist: black; extra == "dev"
|
|
@@ -31,6 +31,7 @@ Requires-Dist: flake8; extra == "dev"
|
|
|
31
31
|
Requires-Dist: isort; extra == "dev"
|
|
32
32
|
Requires-Dist: pytest; extra == "dev"
|
|
33
33
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
34
|
+
Requires-Dist: textual-dev; extra == "dev"
|
|
34
35
|
Dynamic: license-file
|
|
35
36
|
|
|
36
37
|
# TunaCode
|
|
@@ -126,6 +127,27 @@ pip install tunacode-cli
|
|
|
126
127
|
wget -qO- https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/install_linux.sh | bash
|
|
127
128
|
```
|
|
128
129
|
|
|
130
|
+
### Uninstallation
|
|
131
|
+
|
|
132
|
+
To completely remove TunaCode from your system:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Download and run the uninstall script
|
|
136
|
+
wget -qO- https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/uninstall.sh | bash
|
|
137
|
+
|
|
138
|
+
# Or manually:
|
|
139
|
+
# 1. Remove the package
|
|
140
|
+
pipx uninstall tunacode # if installed via pipx
|
|
141
|
+
# OR
|
|
142
|
+
pip uninstall tunacode-cli # if installed via pip
|
|
143
|
+
|
|
144
|
+
# 2. Remove configuration files
|
|
145
|
+
rm -rf ~/.config/tunacode*
|
|
146
|
+
|
|
147
|
+
# 3. Remove any leftover binaries
|
|
148
|
+
rm -f ~/.local/bin/tunacode
|
|
149
|
+
```
|
|
150
|
+
|
|
129
151
|
### Setup Options
|
|
130
152
|
|
|
131
153
|
<details>
|
|
@@ -285,6 +307,97 @@ Create a `TUNACODE.md` file your project root to customize TunaCode's behavior:
|
|
|
285
307
|
|
|
286
308
|
---
|
|
287
309
|
|
|
310
|
+
## Source Code Architecture
|
|
311
|
+
|
|
312
|
+
### Directory Structure
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
src/tunacode/
|
|
316
|
+
├── cli/ # Command Line Interface
|
|
317
|
+
│ ├── commands.py # Command registry and implementations
|
|
318
|
+
│ ├── main.py # Entry point and CLI setup (Typer)
|
|
319
|
+
│ └── repl.py # Interactive REPL loop
|
|
320
|
+
│
|
|
321
|
+
├── configuration/ # Configuration Management
|
|
322
|
+
│ ├── defaults.py # Default configuration values
|
|
323
|
+
│ ├── models.py # Configuration data models
|
|
324
|
+
│ └── settings.py # Settings loader and validator
|
|
325
|
+
│
|
|
326
|
+
├── core/ # Core Application Logic
|
|
327
|
+
│ ├── agents/ # AI Agent System
|
|
328
|
+
│ │ └── main.py # Primary agent implementation (pydantic-ai)
|
|
329
|
+
│ ├── setup/ # Application Setup & Initialization
|
|
330
|
+
│ │ ├── agent_setup.py # Agent configuration
|
|
331
|
+
│ │ ├── base.py # Setup step base class
|
|
332
|
+
│ │ ├── config_setup.py # Configuration setup
|
|
333
|
+
│ │ ├── coordinator.py # Setup orchestration
|
|
334
|
+
│ │ ├── environment_setup.py # Environment validation
|
|
335
|
+
│ │ └── git_safety_setup.py # Git safety checks
|
|
336
|
+
│ ├── state.py # Application state management
|
|
337
|
+
│ └── tool_handler.py # Tool execution and validation
|
|
338
|
+
│
|
|
339
|
+
├── services/ # External Services
|
|
340
|
+
│ ├── mcp.py # Model Context Protocol integration
|
|
341
|
+
│ └── undo_service.py # Undo operations (beta)
|
|
342
|
+
│
|
|
343
|
+
├── tools/ # AI Agent Tools
|
|
344
|
+
│ ├── base.py # Tool base classes
|
|
345
|
+
│ ├── read_file.py # File reading tool
|
|
346
|
+
│ ├── run_command.py # Command execution tool
|
|
347
|
+
│ ├── update_file.py # File modification tool
|
|
348
|
+
│ └── write_file.py # File creation tool
|
|
349
|
+
│
|
|
350
|
+
├── ui/ # User Interface Components
|
|
351
|
+
│ ├── completers.py # Tab completion
|
|
352
|
+
│ ├── console.py # Rich console setup
|
|
353
|
+
│ ├── input.py # Input handling
|
|
354
|
+
│ ├── keybindings.py # Keyboard shortcuts
|
|
355
|
+
│ ├── lexers.py # Syntax highlighting
|
|
356
|
+
│ ├── output.py # Output formatting and banner
|
|
357
|
+
│ ├── panels.py # UI panels and layouts
|
|
358
|
+
│ ├── prompt_manager.py # Prompt toolkit integration
|
|
359
|
+
│ ├── tool_ui.py # Tool confirmation dialogs
|
|
360
|
+
│ └── validators.py # Input validation
|
|
361
|
+
│
|
|
362
|
+
├── utils/ # Utility Functions
|
|
363
|
+
│ ├── bm25.py # BM25 search algorithm(beta)
|
|
364
|
+
│ ├── diff_utils.py # Diff generation and formatting
|
|
365
|
+
│ ├── file_utils.py # File system operations
|
|
366
|
+
│ ├── ripgrep.py # Code search utilities
|
|
367
|
+
│ ├── system.py # System information
|
|
368
|
+
│ ├── text_utils.py # Text processing
|
|
369
|
+
│ └── user_configuration.py # User config management
|
|
370
|
+
│
|
|
371
|
+
├── constants.py # Application constants
|
|
372
|
+
├── context.py # Context management
|
|
373
|
+
├── exceptions.py # Custom exceptions
|
|
374
|
+
├── types.py # Type definitions
|
|
375
|
+
└── prompts/
|
|
376
|
+
└── system.txt # System prompts for AI agent
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Key Components
|
|
380
|
+
|
|
381
|
+
| Component | Purpose | Key Files |
|
|
382
|
+
| -------------------- | ------------------------ | ------------------------------- |
|
|
383
|
+
| **CLI Layer** | Command parsing and REPL | `cli/main.py`, `cli/repl.py` |
|
|
384
|
+
| **Agent System** | AI-powered assistance | `core/agents/main.py` |
|
|
385
|
+
| **Tool System** | File/command operations | `tools/*.py` |
|
|
386
|
+
| **State Management** | Session state tracking | `core/state.py` |
|
|
387
|
+
| **UI Framework** | Rich terminal interface | `ui/output.py`, `ui/console.py` |
|
|
388
|
+
| **Configuration** | User settings & models | `configuration/*.py` |
|
|
389
|
+
| **Setup System** | Initial configuration | `core/setup/*.py` |
|
|
390
|
+
|
|
391
|
+
### Data Flow
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
CLI Input → Command Registry → REPL → Agent → Tools → UI Output
|
|
395
|
+
↓ ↓ ↓ ↓ ↓ ↑
|
|
396
|
+
State Manager ←────────────────────────────────────────┘
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
288
401
|
## Development
|
|
289
402
|
|
|
290
403
|
### Requirements
|
|
@@ -305,44 +418,6 @@ make lint
|
|
|
305
418
|
make test
|
|
306
419
|
```
|
|
307
420
|
|
|
308
|
-
### Release Process
|
|
309
|
-
|
|
310
|
-
<details>
|
|
311
|
-
<summary><b>Click to expand release steps</b></summary>
|
|
312
|
-
|
|
313
|
-
1. **Update versions:**
|
|
314
|
-
|
|
315
|
-
- `pyproject.toml`
|
|
316
|
-
- `src/tunacode/constants.py` (APP_VERSION)
|
|
317
|
-
|
|
318
|
-
2. **Commit and tag:**
|
|
319
|
-
|
|
320
|
-
```bash
|
|
321
|
-
git add pyproject.toml src/tunacode/constants.py
|
|
322
|
-
git commit -m "chore: bump version to X.Y.Z"
|
|
323
|
-
git tag vX.Y.Z
|
|
324
|
-
git push origin vX.Y.Z
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
3. **Create release:**
|
|
328
|
-
```bash
|
|
329
|
-
gh release create vX.Y.Z --title "vX.Y.Z" --notes "Release notes"
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
</details>
|
|
333
|
-
|
|
334
|
-
### Commit Convention
|
|
335
|
-
|
|
336
|
-
Following [Conventional Commits](https://www.conventionalcommits.org/):
|
|
337
|
-
|
|
338
|
-
- `feat:` New features
|
|
339
|
-
- `fix:` Bug fixes
|
|
340
|
-
- `docs:` Documentation
|
|
341
|
-
- `style:` Code formatting
|
|
342
|
-
- `refactor:` Code refactoring
|
|
343
|
-
- `test:` Tests
|
|
344
|
-
- `chore:` Maintenance
|
|
345
|
-
|
|
346
421
|
---
|
|
347
422
|
|
|
348
423
|
## Links
|
|
@@ -91,6 +91,27 @@ pip install tunacode-cli
|
|
|
91
91
|
wget -qO- https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/install_linux.sh | bash
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
### Uninstallation
|
|
95
|
+
|
|
96
|
+
To completely remove TunaCode from your system:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Download and run the uninstall script
|
|
100
|
+
wget -qO- https://raw.githubusercontent.com/alchemiststudiosDOTai/tunacode/master/scripts/uninstall.sh | bash
|
|
101
|
+
|
|
102
|
+
# Or manually:
|
|
103
|
+
# 1. Remove the package
|
|
104
|
+
pipx uninstall tunacode # if installed via pipx
|
|
105
|
+
# OR
|
|
106
|
+
pip uninstall tunacode-cli # if installed via pip
|
|
107
|
+
|
|
108
|
+
# 2. Remove configuration files
|
|
109
|
+
rm -rf ~/.config/tunacode*
|
|
110
|
+
|
|
111
|
+
# 3. Remove any leftover binaries
|
|
112
|
+
rm -f ~/.local/bin/tunacode
|
|
113
|
+
```
|
|
114
|
+
|
|
94
115
|
### Setup Options
|
|
95
116
|
|
|
96
117
|
<details>
|
|
@@ -250,6 +271,97 @@ Create a `TUNACODE.md` file your project root to customize TunaCode's behavior:
|
|
|
250
271
|
|
|
251
272
|
---
|
|
252
273
|
|
|
274
|
+
## Source Code Architecture
|
|
275
|
+
|
|
276
|
+
### Directory Structure
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
src/tunacode/
|
|
280
|
+
├── cli/ # Command Line Interface
|
|
281
|
+
│ ├── commands.py # Command registry and implementations
|
|
282
|
+
│ ├── main.py # Entry point and CLI setup (Typer)
|
|
283
|
+
│ └── repl.py # Interactive REPL loop
|
|
284
|
+
│
|
|
285
|
+
├── configuration/ # Configuration Management
|
|
286
|
+
│ ├── defaults.py # Default configuration values
|
|
287
|
+
│ ├── models.py # Configuration data models
|
|
288
|
+
│ └── settings.py # Settings loader and validator
|
|
289
|
+
│
|
|
290
|
+
├── core/ # Core Application Logic
|
|
291
|
+
│ ├── agents/ # AI Agent System
|
|
292
|
+
│ │ └── main.py # Primary agent implementation (pydantic-ai)
|
|
293
|
+
│ ├── setup/ # Application Setup & Initialization
|
|
294
|
+
│ │ ├── agent_setup.py # Agent configuration
|
|
295
|
+
│ │ ├── base.py # Setup step base class
|
|
296
|
+
│ │ ├── config_setup.py # Configuration setup
|
|
297
|
+
│ │ ├── coordinator.py # Setup orchestration
|
|
298
|
+
│ │ ├── environment_setup.py # Environment validation
|
|
299
|
+
│ │ └── git_safety_setup.py # Git safety checks
|
|
300
|
+
│ ├── state.py # Application state management
|
|
301
|
+
│ └── tool_handler.py # Tool execution and validation
|
|
302
|
+
│
|
|
303
|
+
├── services/ # External Services
|
|
304
|
+
│ ├── mcp.py # Model Context Protocol integration
|
|
305
|
+
│ └── undo_service.py # Undo operations (beta)
|
|
306
|
+
│
|
|
307
|
+
├── tools/ # AI Agent Tools
|
|
308
|
+
│ ├── base.py # Tool base classes
|
|
309
|
+
│ ├── read_file.py # File reading tool
|
|
310
|
+
│ ├── run_command.py # Command execution tool
|
|
311
|
+
│ ├── update_file.py # File modification tool
|
|
312
|
+
│ └── write_file.py # File creation tool
|
|
313
|
+
│
|
|
314
|
+
├── ui/ # User Interface Components
|
|
315
|
+
│ ├── completers.py # Tab completion
|
|
316
|
+
│ ├── console.py # Rich console setup
|
|
317
|
+
│ ├── input.py # Input handling
|
|
318
|
+
│ ├── keybindings.py # Keyboard shortcuts
|
|
319
|
+
│ ├── lexers.py # Syntax highlighting
|
|
320
|
+
│ ├── output.py # Output formatting and banner
|
|
321
|
+
│ ├── panels.py # UI panels and layouts
|
|
322
|
+
│ ├── prompt_manager.py # Prompt toolkit integration
|
|
323
|
+
│ ├── tool_ui.py # Tool confirmation dialogs
|
|
324
|
+
│ └── validators.py # Input validation
|
|
325
|
+
│
|
|
326
|
+
├── utils/ # Utility Functions
|
|
327
|
+
│ ├── bm25.py # BM25 search algorithm(beta)
|
|
328
|
+
│ ├── diff_utils.py # Diff generation and formatting
|
|
329
|
+
│ ├── file_utils.py # File system operations
|
|
330
|
+
│ ├── ripgrep.py # Code search utilities
|
|
331
|
+
│ ├── system.py # System information
|
|
332
|
+
│ ├── text_utils.py # Text processing
|
|
333
|
+
│ └── user_configuration.py # User config management
|
|
334
|
+
│
|
|
335
|
+
├── constants.py # Application constants
|
|
336
|
+
├── context.py # Context management
|
|
337
|
+
├── exceptions.py # Custom exceptions
|
|
338
|
+
├── types.py # Type definitions
|
|
339
|
+
└── prompts/
|
|
340
|
+
└── system.txt # System prompts for AI agent
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Key Components
|
|
344
|
+
|
|
345
|
+
| Component | Purpose | Key Files |
|
|
346
|
+
| -------------------- | ------------------------ | ------------------------------- |
|
|
347
|
+
| **CLI Layer** | Command parsing and REPL | `cli/main.py`, `cli/repl.py` |
|
|
348
|
+
| **Agent System** | AI-powered assistance | `core/agents/main.py` |
|
|
349
|
+
| **Tool System** | File/command operations | `tools/*.py` |
|
|
350
|
+
| **State Management** | Session state tracking | `core/state.py` |
|
|
351
|
+
| **UI Framework** | Rich terminal interface | `ui/output.py`, `ui/console.py` |
|
|
352
|
+
| **Configuration** | User settings & models | `configuration/*.py` |
|
|
353
|
+
| **Setup System** | Initial configuration | `core/setup/*.py` |
|
|
354
|
+
|
|
355
|
+
### Data Flow
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
CLI Input → Command Registry → REPL → Agent → Tools → UI Output
|
|
359
|
+
↓ ↓ ↓ ↓ ↓ ↑
|
|
360
|
+
State Manager ←────────────────────────────────────────┘
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
253
365
|
## Development
|
|
254
366
|
|
|
255
367
|
### Requirements
|
|
@@ -270,44 +382,6 @@ make lint
|
|
|
270
382
|
make test
|
|
271
383
|
```
|
|
272
384
|
|
|
273
|
-
### Release Process
|
|
274
|
-
|
|
275
|
-
<details>
|
|
276
|
-
<summary><b>Click to expand release steps</b></summary>
|
|
277
|
-
|
|
278
|
-
1. **Update versions:**
|
|
279
|
-
|
|
280
|
-
- `pyproject.toml`
|
|
281
|
-
- `src/tunacode/constants.py` (APP_VERSION)
|
|
282
|
-
|
|
283
|
-
2. **Commit and tag:**
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
git add pyproject.toml src/tunacode/constants.py
|
|
287
|
-
git commit -m "chore: bump version to X.Y.Z"
|
|
288
|
-
git tag vX.Y.Z
|
|
289
|
-
git push origin vX.Y.Z
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
3. **Create release:**
|
|
293
|
-
```bash
|
|
294
|
-
gh release create vX.Y.Z --title "vX.Y.Z" --notes "Release notes"
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
</details>
|
|
298
|
-
|
|
299
|
-
### Commit Convention
|
|
300
|
-
|
|
301
|
-
Following [Conventional Commits](https://www.conventionalcommits.org/):
|
|
302
|
-
|
|
303
|
-
- `feat:` New features
|
|
304
|
-
- `fix:` Bug fixes
|
|
305
|
-
- `docs:` Documentation
|
|
306
|
-
- `style:` Code formatting
|
|
307
|
-
- `refactor:` Code refactoring
|
|
308
|
-
- `test:` Tests
|
|
309
|
-
- `chore:` Maintenance
|
|
310
|
-
|
|
311
385
|
---
|
|
312
386
|
|
|
313
387
|
## Links
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tunacode-cli"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.12"
|
|
8
8
|
description = "Your agentic CLI developer."
|
|
9
9
|
keywords = ["cli", "agent", "development", "automation"]
|
|
10
10
|
readme = "README.md"
|
|
@@ -25,11 +25,11 @@ classifiers = [
|
|
|
25
25
|
"Topic :: Utilities",
|
|
26
26
|
]
|
|
27
27
|
dependencies = [
|
|
28
|
+
"typer==0.15.3",
|
|
28
29
|
"prompt_toolkit==3.0.51",
|
|
29
30
|
"pydantic-ai[logfire]==0.2.6",
|
|
30
31
|
"pygments==2.19.1",
|
|
31
32
|
"rich==14.0.0",
|
|
32
|
-
"typer==0.15.3",
|
|
33
33
|
]
|
|
34
34
|
|
|
35
35
|
[project.scripts]
|
|
@@ -38,11 +38,12 @@ tunacode = "tunacode.cli.main:app"
|
|
|
38
38
|
[project.optional-dependencies]
|
|
39
39
|
dev = [
|
|
40
40
|
"build",
|
|
41
|
-
"black",
|
|
41
|
+
"black",
|
|
42
42
|
"flake8",
|
|
43
43
|
"isort",
|
|
44
44
|
"pytest",
|
|
45
45
|
"pytest-cov",
|
|
46
|
+
"textual-dev",
|
|
46
47
|
]
|
|
47
48
|
|
|
48
49
|
[project.urls]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Command system for
|
|
1
|
+
"""Command system for TunaCode CLI."""
|
|
2
2
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
4
|
from dataclasses import dataclass
|
|
@@ -248,14 +248,13 @@ class BranchCommand(SimpleCommand):
|
|
|
248
248
|
|
|
249
249
|
async def execute(self, args: List[str], context: CommandContext) -> None:
|
|
250
250
|
import subprocess
|
|
251
|
-
|
|
252
|
-
from ..services.undo_service import is_in_git_project
|
|
251
|
+
import os
|
|
253
252
|
|
|
254
253
|
if not args:
|
|
255
254
|
await ui.error("Usage: /branch <branch-name>")
|
|
256
255
|
return
|
|
257
256
|
|
|
258
|
-
if not
|
|
257
|
+
if not os.path.exists(".git"):
|
|
259
258
|
await ui.error("Not a git repository")
|
|
260
259
|
return
|
|
261
260
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Module:
|
|
2
|
+
Module: tunacode.cli.main
|
|
3
3
|
|
|
4
|
-
CLI entry point
|
|
5
|
-
Manages application startup, version checking, and REPL initialization.
|
|
4
|
+
Enhanced CLI entry point with better styling while staying CLI-based.
|
|
6
5
|
"""
|
|
7
6
|
|
|
8
7
|
import asyncio
|
|
@@ -17,7 +16,7 @@ from tunacode.ui import console as ui
|
|
|
17
16
|
from tunacode.utils.system import check_for_updates
|
|
18
17
|
|
|
19
18
|
app_settings = ApplicationSettings()
|
|
20
|
-
app = typer.Typer(help=
|
|
19
|
+
app = typer.Typer(help="🐟 TunaCode - Your AI-powered development assistant")
|
|
21
20
|
state_manager = StateManager()
|
|
22
21
|
|
|
23
22
|
|
|
@@ -29,6 +28,8 @@ def main(
|
|
|
29
28
|
model: str = typer.Option(None, "--model", help="Default model to use (e.g., openai/gpt-4)"),
|
|
30
29
|
key: str = typer.Option(None, "--key", help="API key for the provider"),
|
|
31
30
|
):
|
|
31
|
+
"""🚀 Start TunaCode - Your AI-powered development assistant"""
|
|
32
|
+
|
|
32
33
|
if version:
|
|
33
34
|
asyncio.run(ui.version())
|
|
34
35
|
return
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Module:
|
|
2
|
+
Module: tunacode.cli.repl
|
|
3
3
|
|
|
4
|
-
Interactive REPL (Read-Eval-Print Loop) implementation for
|
|
4
|
+
Interactive REPL (Read-Eval-Print Loop) implementation for TunaCode.
|
|
5
5
|
Handles user input, command processing, and agent interaction in an interactive shell.
|
|
6
6
|
"""
|
|
7
7
|
|
|
@@ -207,18 +207,7 @@ async def repl(state_manager: StateManager):
|
|
|
207
207
|
action = None
|
|
208
208
|
|
|
209
209
|
# Professional startup information
|
|
210
|
-
await ui.info("TunaCode v0.1 - Beta Release")
|
|
211
|
-
await ui.muted("• Caution: This tool can modify your codebase")
|
|
212
210
|
await ui.muted(f"• Model: {state_manager.session.current_model}")
|
|
213
|
-
await ui.line()
|
|
214
|
-
|
|
215
|
-
# Important safety warning
|
|
216
|
-
await ui.warning("⚠️ IMPORTANT: The /undo command has been removed for safety reasons")
|
|
217
|
-
await ui.muted("• Always use git branches before making major changes")
|
|
218
|
-
await ui.muted("• Use '/branch <name>' to create a new branch for experiments")
|
|
219
|
-
await ui.muted("• Commit your work frequently to preserve changes")
|
|
220
|
-
await ui.line()
|
|
221
|
-
|
|
222
211
|
await ui.success("Ready to assist with your development")
|
|
223
212
|
await ui.line()
|
|
224
213
|
|