> For the complete documentation index, see [llms.txt](https://docs.yemreak.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yemreak.com/contents/6f0ac383.md).

# Extension Debug Yavas, VSCode Eval ile AI Aninda Test Yapiyor

{% embed url="<https://youtu.be/LM2GJORCi_k>" %}

"Extension yükle, sil, yükle, sil... çok vakit alıyor abi." AI extension geliştirirken sürekli hata yapıyordu, düzeltmesi için extension'ı reload etmem gerekiyordu. Yavaş. VSCode eval komutu ekledim, AI artık direkt VSCode'un içinde kodu çalıştırıp test ediyor.

İlk tepkim: "Işıkları açtır, status bar eklesin, terminal açsın - bakalım ne yapabilir?"

## Akış: Inline Test, Anında Feedback

Pattern şu: AI VSCode extension yazıyor → `vscode-cli eval 'kod burada'` çalıştırıyor → sonuç görüyor → hata varsa düzeltiyor. Reload yok, file artifact yok. Direkt çalıştır, test et, öğren.

Örnek: Status bar eklemek istiyorum. AI kodu yazıyor, `vscode-cli eval` ile direkt VSCode'da çalıştırıyor. Çalışmadı? Hatayı görüyor, düzeltiyor, tekrar deniyor. Extension install/uninstall loop'u yok. Hız = feedback loop hızı.

Multi-line kod heredoc ile:

```sh
vscode-cli eval "$(cat <<'EOF'
const statusBar = vscode.window.createStatusBarItem()
statusBar.text = "Next: listening for request"
statusBar.show()
EOF
)"
```

AI'nın öğrenmesi için önemli olan feedback almak. Yanıl, öğren, yanıl, öğren. Bunu yapabilirse her şeyi çok hızlı yapıyor - insandan çok daha hızlı.

## Demo: Status Bar + Işık Kontrolü

Status bar'a AI'ın bir sonraki aksiyonunu yazdırdım. "Next: waiting for your request", "Next: creating status bar", "Next: opening terminal". Agent ne yapıyor, görünür olsun diye.

Sonra Hue ışıklarıma butonu ekledim. VSCode'dan direkt ışığı açıp kapatabiliyorum. Pattern: `vscode-cli eval` ile status bar item oluştur → command register et → butona bas → `hue` CLI tool çalıştır → ışık toggle.

Işıkları kontrol eden buton VSCode'da çalışıyor. Neden? Çünkü yapabiliyorum :D Amaç ne yapabileceğimizi göstermek. Deployment butonu mu eklemek istiyorsun? CLI scriptini status bar'a koy. Sürekli çalıştırdığın bir komut mu var? Quick panel'e ekle.

## Multi-Agent Vision: Status Bar Lanes

Birden fazla agent çalışsın istiyorsun. Her agent ne yapıyor? Status bar'da lane'ler oluşturabilirsin. Agent 1 sol tarafta, Agent 2 sağda, Agent 3 ortada. Her biri kendi aksiyonunu gösteriyor.

Terminal title'ları da kullanılabilir. Ama status bar daha visible. Agent durumunu her zaman görebiliyorsun. 3 agent paralel çalışıyor, hepsi ne yapıyor - tek bakışta belli.

## Pattern: CLI Bridge = Platform Control

vscode-cli eval = VSCode API'sine direkt erişim. Extension kodu inline çalıştırabiliyorsun. Aynı pattern Chrome için çalışır (`chrome-cdp eval`), MacOS için çalışır (`hammerspoon eval`).

Platform'un API'sine eval interface aç → AI kodu yaz → inline çalıştır → test et → düzelt. Artifact yok, state yok. REPL pattern. Immediate mode.

VSCode extension development normalde: kod yaz → extension package'la → yükle → test et → hata → uninstall → tekrar. Yavaş. Eval ile: kod yaz → çalıştır → test et → düzelt. Hızlı.

## Kod & Setup

**Install Extension:**

```bash
# From OpenVSX
code --install-extension yemreak.cli-bridge
```

**Install CLI:**

```bash
# Option 1: NPM (recommended)
npm install -g vscode-cli-bridge

# Option 2: Clone from GitHub
git clone https://github.com/yemreak/vscode-cli-bridge
cd vscode-cli-bridge
chmod +x vscode-cli.ts
ln -sf $(pwd)/vscode-cli.ts ~/.local/bin/vscode-cli
```

**Use:**

```bash
# Diagnostics
vscode-cli diagnostics

# Eval code
vscode-cli eval "const sb = vscode.window.createStatusBarItem(); sb.text = 'Test'; sb.show()"

# Rename
vscode-cli rename oldName newName
```

Architecture: TCP socket (port 9485) → JSON-RPC → VSCode Extension API

Pattern: unified CLI bridge - same interface for all platforms (Chrome, Hammerspoon, VSCode)

Code: [GitHub](https://github.com/yemreak/vscode-cli-bridge) | [NPM](https://www.npmjs.com/package/vscode-cli-bridge)

Sırada ne var? Bilmem :D Belki 3 agent paralel çalışırken status bar'da hepsini gösteririm. Belki başka platform'lara bridge kurarım. Flow state'i koru, devam et.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.yemreak.com/contents/6f0ac383.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
