@aigencydev/cli 0.3.0 → 0.3.2

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.
package/README.md CHANGED
@@ -1,83 +1,280 @@
1
1
  # AIGENCY CLI
2
2
 
3
3
  Terminalden yapay zeka destekli kod üretimi, dosya yönetimi ve proje otomasyonu.
4
+ AIGENCY hesabınla bağlanır, projende çalışır, kodu senin onayınla yazar.
5
+
6
+ ```
7
+ ┌──────────────────────────────────────────┐
8
+ │ ✦ AIGENCY CLI v0.3.0 │
9
+ │ ● default · AIGENCY Pro · my-app │
10
+ │ │
11
+ │ ▸ Sana nasıl yardımcı olabilirim? │
12
+ └──────────────────────────────────────────┘
13
+ ```
14
+
15
+ ---
4
16
 
5
17
  ## Kurulum
6
18
 
7
- **macOS / Linux**
19
+ **npm ile (önerilen)**
20
+ ```bash
21
+ npm install -g @aigencydev/cli
22
+ ```
23
+
24
+ **macOS / Linux — shell installer**
8
25
  ```bash
9
26
  curl -fsSL https://aigency.dev/cli/install.sh | bash
10
27
  ```
11
28
 
12
- **Windows (PowerShell)**
29
+ **Windows PowerShell**
13
30
  ```powershell
14
31
  irm https://aigency.dev/cli/install.ps1 | iex
15
32
  ```
16
33
 
17
- **npm (alternatif)**
18
- ```bash
19
- npm install -g @aigencydev/cli
20
- ```
34
+ > **Not:** Node.js 18.18 veya üzeri gerekir. `node --version` ile kontrol edebilirsin.
35
+
36
+ ---
21
37
 
22
- ## Kullanım
38
+ ## Hızlı Başlangıç
23
39
 
24
40
  ```bash
25
- # Hesabınıza bağlanın
41
+ # 1) Hesabına bağlan (tarayıcı açılır)
26
42
  aigency login
27
43
 
28
- # Mevcut dizinde .aigency/ proje klasörü oluşturun
44
+ # 2) Bir proje dizinine gir ve .aigency/ iskeletini oluştur
45
+ cd ~/projects/my-app
29
46
  aigency init
30
47
 
31
- # Aylık kullanımınızı görün
32
- aigency usage
48
+ # 3) Ajanla konuşmaya başla
49
+ aigency "bana bir Next.js CV sitesi oluştur, Apple tarzı"
33
50
 
34
- # Sürüm kontrolü
35
- aigency update
36
-
37
- # Yardım
38
- aigency help
51
+ # ya da interaktif modda
52
+ aigency
39
53
  ```
40
54
 
41
- ## Paketler
55
+ ---
56
+
57
+ ## Komutlar
58
+
59
+ | Komut | Açıklama |
60
+ |---|---|
61
+ | `aigency` | İnteraktif sohbet modu (varsayılan) |
62
+ | `aigency "<prompt>"` | Tek seferlik prompt çalıştır |
63
+ | `aigency login` | AIGENCY hesabına OAuth ile bağlan |
64
+ | `aigency logout` | Oturumu kapat, yerel token'ları sil |
65
+ | `aigency init` | Mevcut dizinde `.aigency/` yapısını kur |
66
+ | `aigency usage` | Aylık token kullanımını göster |
67
+ | `aigency update` | En son sürümü kontrol et |
68
+ | `aigency help` | Komut yardımı |
69
+ | `aigency --version` | Sürümü göster |
70
+
71
+ **Flag'ler:**
72
+ - `--mode <default\|plan\|accept_edits\|auto>` — başlangıç izin modu
73
+ - `--model <pro\|max>` — AIGENCY paket seviyesi
42
74
 
43
- | Paket | Fiyat | Aylık token |
44
- |---|---|---|
45
- | AIGENCY CLI Pro | 1.500 ₺/ay | 1.000.000 |
46
- | AIGENCY CLI Max | 3.000 ₺/ay | 5.000.000 + öncelikli kuyruk + Auto mode |
75
+ ---
47
76
 
48
- ## İzin Modları (Faz 4'te aktif)
77
+ ## İzin Modları
49
78
 
50
79
  | Mod | Davranış |
51
80
  |---|---|
52
- | `default` | Dosya okuma otomatik, yazma ve komut onay ister |
53
- | `plan` | Dry-run — hiçbir şey yazılmaz, sadece plan gösterilir |
54
- | `accept_edits` | Dosya yazma otomatik, komut hâlâ onay ister |
55
- | `auto` | Sınıflandırıcı destekli tam otomatik (sadece Max tier) |
81
+ | `default` | Dosya okuma otomatik, yazma ve komut için onay sorulur |
82
+ | `plan` | Dry-run — hiçbir şey yazılmaz, sadece yapılacakların planı gösterilir |
83
+ | `accept_edits` | Dosya yazma otomatik, shell komutları hâlâ onay ister |
84
+ | `auto` | Sınıflandırıcı destekli tam otomatik (yalnızca **Max** tier) |
85
+
86
+ Mod'u çalışırken değiştirmek için **Shift+Tab** bas.
87
+
88
+ ---
89
+
90
+ ## Kısayollar
91
+
92
+ | Tuş | İşlev |
93
+ |---|---|
94
+ | `Shift+Tab` | İzin modlarını döngüle (default → plan → accept_edits → auto) |
95
+ | `ESC` | Aktif ajan işlemini iptal et |
96
+ | `Ctrl+C` | Çalışıyorsa iptal, boştaysa çıkış |
97
+ | `/` | Slash komut başlat |
98
+
99
+ ---
100
+
101
+ ## Slash Komutları
102
+
103
+ | Komut | İşlev |
104
+ |---|---|
105
+ | `/help` | Komut listesi |
106
+ | `/clear` | Sohbet geçmişini ve onay cache'ini temizle |
107
+ | `/mode [default\|plan\|accept_edits\|auto]` | Modu değiştir veya göster |
108
+ | `/cost` | Bu oturumda kullanılan token sayısı |
109
+ | `/undo` | Son dosya düzenlemesini geri al (checkpoint'ten) |
110
+ | `/exit` veya `/quit` | Çıkış |
111
+
112
+ ---
113
+
114
+ ## Araçlar (Ajanın Kullanabildiği Tool'lar)
115
+
116
+ Ajan projenizde aşağıdaki işlemleri yapabilir (izin modunuza göre onay ister):
117
+
118
+ **Dosya sistemi**
119
+ - `read_file` — Dosya içeriği okur
120
+ - `list_files` — Dizin listeler (gitignore'a saygı duyar)
121
+ - `search_files` — Regex ile içerik arar
122
+ - `write_file` — Yeni dosya yazar veya tamamen değiştirir
123
+ - `edit_file` — Mevcut dosyada cerrahi değişiklik yapar
124
+
125
+ **Shell**
126
+ - `bash_execute` — İnteraktif olmayan shell komutu çalıştırır (5 dk timeout, canlı çıktı akışı)
127
+
128
+ **Hafıza (kalıcı, makineye özel)**
129
+ - `save_memory` — Önemli bilgiyi oturumlar arası sakla
130
+ - `read_memory` — Detay hafıza dosyasını oku
131
+ - `delete_memory` — Artık geçerli olmayan bilgiyi sil
132
+
133
+ **Görev planlama**
134
+ - `write_tasks` — Büyük görevleri adımlara böl, ilerlemeyi canlı göster
135
+ - `read_tasks` — Mevcut görev listesini oku
136
+
137
+ **Sandbox:** `.git/`, `.env*`, `~/.ssh/`, `node_modules/`, `.next/` gibi hassas yollar
138
+ otomatik reddedilir. `sudo`, `rm -rf /`, `curl | sh` gibi tehlikeli komutlar
139
+ engellenir.
140
+
141
+ ---
142
+
143
+ ## Proje Yapılandırması (`.aigency/`)
144
+
145
+ `aigency init` çalıştırdığında projenizde aşağıdaki yapı oluşturulur:
146
+
147
+ ```
148
+ <proje>/.aigency/
149
+ ├── AIGENCY.md # Proje talimatları (ajan her oturum başında okur)
150
+ ├── PROGRESS.md # İlerleme takibi (opsiyonel)
151
+ ├── settings.json # İzin modu, allow/deny listeleri
152
+ ├── settings.local.json # Kişisel override (gitignored)
153
+ ├── rules/ # Path-scoped kurallar
154
+ │ └── example.md
155
+ ├── hooks/ # PreToolUse/PostToolUse script'leri
156
+ │ ├── hooks.json
157
+ │ └── README.md
158
+ ├── logs/ # Günlük JSONL logları (gitignored)
159
+ └── .gitignore
160
+ ```
161
+
162
+ **AIGENCY.md** en önemli dosyadır — projenizin teknoloji yığını, kodlama kuralları,
163
+ stil tercihleri ve "dokunulmaması gereken yerler"i buraya yazın. Ajan her oturum
164
+ başında bu dosyayı okur ve yazdığı kod bunlarla hizalanır.
165
+
166
+ ---
167
+
168
+ ## Kalıcı Hafıza ve Oturum Verileri
169
+
170
+ AIGENCY CLI, **makineye özel** veriler için kullanıcının home dizininde ayrı
171
+ bir alan kullanır:
172
+
173
+ ```
174
+ ~/.aigency/
175
+ ├── cli.json # Auth metadata
176
+ ├── credentials.enc # AES-256-GCM şifreli token'lar
177
+ ├── settings.json # Kullanıcı seviyesi ayarlar
178
+ ├── AIGENCY.md # Tüm projelerde geçerli global talimatlar
179
+ ├── cli.log # Rotating log (5 MB × 3 yedek)
180
+ ├── cache/ # LLM response, hash cache
181
+ ├── temp/ # Oturum scratch alanı
182
+ └── projects/
183
+ └── <proje-hash>/ # Git remote veya yola göre hash
184
+ ├── memory/
185
+ │ ├── MEMORY.md # Hafıza index'i
186
+ │ ├── user_*.md # Kullanıcı hakkında
187
+ │ ├── feedback_*.md # Davranış kuralları
188
+ │ ├── project_*.md # Proje bağlamı
189
+ │ └── reference_*.md # Harici kaynak pointer'ları
190
+ ├── sessions/
191
+ │ └── <id>.jsonl # Oturum transkriptleri
192
+ └── checkpoints/ # Dosya edit snapshot'ları (undo için)
193
+ ```
194
+
195
+ Bu alan **git'e commit edilmez** ve senkronize de olmaz — her makinede ayrı.
196
+ `.aigency/` (proje klasörü) ise git'e eklenebilir, takımla paylaşılır.
197
+
198
+ ---
199
+
200
+ ## Paketler
201
+
202
+ | Paket | Fiyat | Aylık Token | Ek Özellikler |
203
+ |---|---|---|---|
204
+ | **AIGENCY CLI Pro** | 1.500 ₺/ay | 1.000.000 | Standart |
205
+ | **AIGENCY CLI Max** | 3.000 ₺/ay | 5.000.000 | Öncelikli kuyruk, Auto mode |
206
+
207
+ Paketleri [aigency.dev/developer/cli](https://aigency.dev/developer/cli) üzerinden
208
+ yönetebilir, kullanımınızı canlı izleyebilirsiniz.
209
+
210
+ ---
56
211
 
57
212
  ## Yapılandırma
58
213
 
59
214
  ### Ortam değişkenleri
60
215
 
61
- - `AIGENCY_CLI_API_URL` API sunucu URL'i (varsayılan `https://aigency.dev`)
62
- - `AIGENCY_CLI_DEBUG=1` — ayrıntılı debug log'ları
216
+ | Değişken | Açıklama |
217
+ |---|---|
218
+ | `AIGENCY_CLI_API_URL` | API sunucu adresi (varsayılan `https://aigency.dev`) |
219
+ | `AIGENCY_CLI_DEBUG` | `1` verilirse ayrıntılı debug log'lar |
63
220
 
64
- ### Dosyalar
221
+ ### `.aigency/settings.json` Örneği
65
222
 
66
- - `~/.aigency/config.json` — kullanıcı düzeyinde varsayılan ayarlar
67
- - `~/.aigency/credentials.enc` — şifrelenmiş oturum token'ları (AES-256-GCM)
68
- - `<proje>/.aigency/settings.json` — proje düzeyinde ayar override
223
+ ```json
224
+ {
225
+ "permissions": {
226
+ "defaultMode": "default",
227
+ "allow": [
228
+ "Read(**/*)",
229
+ "Bash(npm run *)",
230
+ "Bash(git status)"
231
+ ],
232
+ "ask": [
233
+ "Write(**/*)",
234
+ "Edit(**/*)",
235
+ "Bash(*)"
236
+ ],
237
+ "deny": [
238
+ "Read(.env)",
239
+ "Write(.git/**)",
240
+ "Bash(rm -rf *)",
241
+ "Bash(sudo *)"
242
+ ]
243
+ },
244
+ "memory": {
245
+ "enabled": true
246
+ },
247
+ "hooks": {
248
+ "enabled": false
249
+ }
250
+ }
251
+ ```
252
+
253
+ ---
69
254
 
70
- ## Geliştirme
255
+ ## Geliştirme (Contributing)
71
256
 
72
257
  ```bash
73
- cd aigency-cli
258
+ git clone https://github.com/aigencydev/cli.git
259
+ cd cli
74
260
  npm install
261
+
75
262
  npm run dev -- help # tsx ile direkt çalıştır
76
- npm run typecheck # tip kontrolü
263
+ npm run typecheck # TypeScript tip kontrolü
264
+ npm run test # Vitest
77
265
  npm run build # dist/ üret
78
- node dist/index.js help # derlenmiş halini çalıştır
79
266
  ```
80
267
 
268
+ ---
269
+
270
+ ## Destek
271
+
272
+ - **Web**: [aigency.dev/developer/cli](https://aigency.dev/developer/cli)
273
+ - **Tanıtım**: [aigency.dev/forge](https://aigency.dev/forge)
274
+ - **Sorun / öneri**: [aigency.dev/contact](https://aigency.dev/contact)
275
+
276
+ ---
277
+
81
278
  ## Lisans
82
279
 
83
- Özel — AIGENCY.
280
+ Özel — AIGENCY. Tüm hakları saklıdır.
@@ -345,10 +345,23 @@ export const bashTool = async (params, ctx) => {
345
345
  duration: Date.now() - start,
346
346
  };
347
347
  }
348
+ let errorMsg;
349
+ if (result.exitCode !== 0) {
350
+ const stderrTrim = result.stderr.trim();
351
+ const stdoutTrim = result.stdout.trim();
352
+ const errorDetail = stderrTrim || stdoutTrim;
353
+ if (errorDetail) {
354
+ const tail = errorDetail.slice(-500);
355
+ errorMsg = `Komut başarısız (exit code ${result.exitCode}): ${tail}`;
356
+ }
357
+ else {
358
+ errorMsg = `Komut çıktı vermeden başarısız oldu (exit code ${result.exitCode}). Komut yanlış olabilir veya binary bulunamamış olabilir.`;
359
+ }
360
+ }
348
361
  return {
349
362
  success: result.exitCode === 0,
350
363
  output: output || "(çıktı yok)",
351
- error: result.exitCode !== 0 ? `Exit code ${result.exitCode}` : undefined,
364
+ error: errorMsg,
352
365
  metadata: {
353
366
  exit_code: result.exitCode,
354
367
  stdout_length: result.stdout.length,
package/dist/ui/App.js CHANGED
@@ -227,11 +227,20 @@ export function App({ session, initialMode, initialModel, cwd, projectRoot, init
227
227
  break;
228
228
  case "agent_tool_result": {
229
229
  const status = event.result.success ? "ok" : "error";
230
+ let displayContent;
231
+ if (event.result.success) {
232
+ displayContent = (event.result.output || "").slice(0, 500);
233
+ }
234
+ else {
235
+ const err = event.result.error || "Hata";
236
+ const out = (event.result.output || "").trim();
237
+ displayContent = out
238
+ ? `${err}\n\n${out.slice(0, 800)}`
239
+ : err;
240
+ }
230
241
  pushMessage({
231
242
  kind: "tool_result",
232
- content: event.result.success
233
- ? event.result.output.slice(0, 500)
234
- : event.result.error || "Hata",
243
+ content: displayContent,
235
244
  toolStatus: status,
236
245
  });
237
246
  void recorderRef.current.toolResult("unknown", event.result.success, event.result.output, event.result.error, event.stepId);
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
- export const CLI_VERSION = "0.3.0";
1
+ export const CLI_VERSION = "0.3.2";
2
2
  export const CLI_NAME = "aigency";
3
3
  export const CLI_DISPLAY_NAME = "AIGENCY CLI";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigencydev/cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "AIGENCY CLI — terminalden yapay zeka destekli kod üretimi, dosya yönetimi ve proje otomasyonu.",
5
5
  "type": "module",
6
6
  "bin": {