Skip to content

Commit 32e5153

Browse files
committed
initial project wide agentic code update implemented with project and preview
1 parent 4f0e48a commit 32e5153

12 files changed

Lines changed: 2429 additions & 38 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Variables
44
BINARY_NAME=ti
5-
VERSION=0.0.2.2
5+
VERSION=0.0.2.4
66
BUILD_DIR=build
77
GO=go
88
BUILD_NUMBER=$(shell printf "%04d" $$(($(shell git rev-list --count HEAD 2>/dev/null || echo "0") + 1)))

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,69 @@ The Git integration uses:
132132

133133
For more technical details, see [internal/git/README.md](internal/git/README.md).
134134

135+
## Agentic Project Assist
136+
137+
The AI assistant can now operate across your **entire project** — not just the open file. Use `/project` to ask the AI to find, read, and modify multiple files at once based on a natural-language request.
138+
139+
### How It Works
140+
141+
When you send a `/project` command, the AI runs a three-phase pipeline:
142+
143+
1. **Scanning** — recursively walks the workspace directory, collecting all text files (up to 500, skipping `.git`, `vendor`, `node_modules`, `.ti`, `build`)
144+
2. **Ranking** — sends the file list and your request to the AI model, which returns up to 20 files most likely to need changes
145+
3. **Modifying** — reads each relevant file (up to 2000 lines), generates `SEARCH/REPLACE` patches, validates them, and writes the changes to disk
146+
147+
A change report is displayed when the operation completes, listing every file read, modified, or that encountered an error.
148+
149+
### Commands
150+
151+
```
152+
/project <request> Run a project-wide change
153+
/preview /project <request> Dry-run: show what would change without writing files
154+
/proceed Apply the changes from the last dry-run
155+
```
156+
157+
### Examples
158+
159+
```
160+
/project add error handling to all HTTP client calls
161+
/project rename the Config struct to AppConfig everywhere
162+
/project improve the aichat pane height calculation
163+
/preview /project update all log.Printf calls to use structured logging
164+
```
165+
166+
### Change Report
167+
168+
After each operation you'll see a summary like:
169+
170+
```
171+
Project-wide operation complete
172+
173+
Files scanned: 42
174+
Files modified: 3
175+
- internal/ui/aichat.go (+5 -2)
176+
- internal/config/config.go (+1 -0)
177+
- README.md (+3 -1)
178+
179+
Patch failures: 1
180+
- internal/executor/executor.go: search text not found in file content
181+
```
182+
183+
If nothing was changed: `No files were modified.`
184+
185+
### Safety
186+
187+
- Only files inside the workspace root are ever read or written
188+
- Symlinks that resolve outside the workspace are rejected
189+
- Paths returned by the AI that don't exist on disk are discarded (logged as "hallucinated paths")
190+
- Preview mode (`/preview /project`) never writes anything to disk
191+
192+
### Supported File Types
193+
194+
The scanner considers: `.go`, `.md`, `.sh`, `.bash`, `.ps1`, `.py`, `.ts`, `.js`, `.json`, `.yaml`, `.yml`, `.toml`, `.txt`, `.html`, `.css`
195+
196+
---
197+
135198
## Agentic Code Fixing
136199

137200
The AI assistant can autonomously fix code issues in your open files. Simply describe what you want to change, and the AI will read your code, generate a fix, and apply it directly to the editor.

docs/USAGE.md

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,22 @@
44

55
```bash
66
# Run with config file (if ~/.ti/config.json exists)
7-
./ti
8-
9-
# Override config with command-line flags
10-
./ti -workspace /path/to/workspace
11-
12-
# Specify Ollama URL (overrides config)
13-
./ti -ollama http://localhost:11434
14-
15-
# Specify model (overrides config)
16-
./ti -model llama2
17-
18-
# Use Gemini instead of Ollama
19-
./ti -gemini YOUR_API_KEY -model gemini-2.0-flash-exp
7+
./ti-linux-amd64
208

219
# Show version
22-
./ti -version
10+
./ti-linux-amd64 -version
2311

24-
# Show help
25-
./ti -help
2612

2713
## Starting the Application
2814

2915
```bash
30-
./build/ti -model qwen2.5-coder:3b -ollama http://192.168.0.78:11434 -workspace ~/ti-workspace
31-
```
32-
33-
```bash
34-
./build/ti -model qwen2.5-coder:1.5b -ollama http://localhost:11434 -workspace ~/ti-workspace
16+
./ti-linux-amd6
3517
```
3618

3719
```powershell
38-
.\build\ti.exe -model qwen2.5-coder:3b -ollama http://localhost:11434 -workspace C:\Users\ricardo\Programming\test
20+
.\build\ti-windows-amd6.exe
3921
```
4022

41-
```bash
42-
./build/ti -model gemini-2.5-flash-lite -gemini api_key_goes_here -workspace ~/ti-workspace
43-
```
44-
```bash
45-
./build/ti -model gemini-3-flash-preview -gemini api_key_goes_here -workspace ~/ti-workspace
46-
```
47-
4823

4924
## Key Features
5025

@@ -81,6 +56,9 @@ The right pane is now split horizontally:
8156
- `/fix <request>` - Force agentic mode (AI will modify code)
8257
- `/ask <question>` - Force conversational mode (AI won't modify code)
8358
- `/preview <request>` - Preview changes before applying them
59+
- `/project <request>` - Run a project-wide change across all files in the workspace
60+
- `/preview /project <request>` - Dry-run a project-wide change without writing files
61+
- `/proceed` - Apply the changes from the last `/preview /project` dry-run
8462
- `/model` - Display current agent, model, and API key (for Gemini)
8563
- `/help` - Display keyboard shortcuts and agent commands
8664
@@ -147,3 +125,5 @@ At the bottom of the screen, you'll see:
147125
- Unsaved files show a `*` in the title
148126
- AI responses show timestamps
149127
- Messages with code context are marked `[with context]`
128+
- `/project` works best with a focused, specific request — the AI picks up to 20 files to modify per run
129+
- Use `/preview /project` first on large or risky changes to see what would be affected before committing

0 commit comments

Comments
 (0)