codeep 1.0.0

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.
Files changed (103) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +576 -0
  3. package/dist/api/index.d.ts +8 -0
  4. package/dist/api/index.js +421 -0
  5. package/dist/app.d.ts +2 -0
  6. package/dist/app.js +1406 -0
  7. package/dist/components/AgentProgress.d.ts +33 -0
  8. package/dist/components/AgentProgress.js +97 -0
  9. package/dist/components/Export.d.ts +8 -0
  10. package/dist/components/Export.js +27 -0
  11. package/dist/components/Help.d.ts +2 -0
  12. package/dist/components/Help.js +3 -0
  13. package/dist/components/Input.d.ts +9 -0
  14. package/dist/components/Input.js +89 -0
  15. package/dist/components/Loading.d.ts +9 -0
  16. package/dist/components/Loading.js +31 -0
  17. package/dist/components/Login.d.ts +7 -0
  18. package/dist/components/Login.js +77 -0
  19. package/dist/components/Logo.d.ts +8 -0
  20. package/dist/components/Logo.js +89 -0
  21. package/dist/components/LogoutPicker.d.ts +8 -0
  22. package/dist/components/LogoutPicker.js +61 -0
  23. package/dist/components/Message.d.ts +10 -0
  24. package/dist/components/Message.js +234 -0
  25. package/dist/components/MessageList.d.ts +10 -0
  26. package/dist/components/MessageList.js +8 -0
  27. package/dist/components/ProjectPermission.d.ts +7 -0
  28. package/dist/components/ProjectPermission.js +52 -0
  29. package/dist/components/Search.d.ts +10 -0
  30. package/dist/components/Search.js +30 -0
  31. package/dist/components/SessionPicker.d.ts +9 -0
  32. package/dist/components/SessionPicker.js +88 -0
  33. package/dist/components/Sessions.d.ts +12 -0
  34. package/dist/components/Sessions.js +102 -0
  35. package/dist/components/Settings.d.ts +7 -0
  36. package/dist/components/Settings.js +162 -0
  37. package/dist/components/Status.d.ts +2 -0
  38. package/dist/components/Status.js +12 -0
  39. package/dist/config/config.test.d.ts +1 -0
  40. package/dist/config/config.test.js +157 -0
  41. package/dist/config/index.d.ts +121 -0
  42. package/dist/config/index.js +555 -0
  43. package/dist/config/providers.d.ts +43 -0
  44. package/dist/config/providers.js +82 -0
  45. package/dist/config/providers.test.d.ts +1 -0
  46. package/dist/config/providers.test.js +132 -0
  47. package/dist/index.d.ts +2 -0
  48. package/dist/index.js +38 -0
  49. package/dist/utils/agent.d.ts +37 -0
  50. package/dist/utils/agent.js +627 -0
  51. package/dist/utils/codeReview.d.ts +36 -0
  52. package/dist/utils/codeReview.js +390 -0
  53. package/dist/utils/context.d.ts +49 -0
  54. package/dist/utils/context.js +216 -0
  55. package/dist/utils/diffPreview.d.ts +57 -0
  56. package/dist/utils/diffPreview.js +335 -0
  57. package/dist/utils/export.d.ts +19 -0
  58. package/dist/utils/export.js +94 -0
  59. package/dist/utils/git.d.ts +85 -0
  60. package/dist/utils/git.js +399 -0
  61. package/dist/utils/git.test.d.ts +1 -0
  62. package/dist/utils/git.test.js +193 -0
  63. package/dist/utils/history.d.ts +93 -0
  64. package/dist/utils/history.js +348 -0
  65. package/dist/utils/interactive.d.ts +34 -0
  66. package/dist/utils/interactive.js +206 -0
  67. package/dist/utils/keychain.d.ts +17 -0
  68. package/dist/utils/keychain.js +160 -0
  69. package/dist/utils/learning.d.ts +89 -0
  70. package/dist/utils/learning.js +330 -0
  71. package/dist/utils/logger.d.ts +33 -0
  72. package/dist/utils/logger.js +130 -0
  73. package/dist/utils/project.d.ts +86 -0
  74. package/dist/utils/project.js +415 -0
  75. package/dist/utils/project.test.d.ts +1 -0
  76. package/dist/utils/project.test.js +212 -0
  77. package/dist/utils/ratelimit.d.ts +26 -0
  78. package/dist/utils/ratelimit.js +132 -0
  79. package/dist/utils/ratelimit.test.d.ts +1 -0
  80. package/dist/utils/ratelimit.test.js +131 -0
  81. package/dist/utils/retry.d.ts +28 -0
  82. package/dist/utils/retry.js +109 -0
  83. package/dist/utils/retry.test.d.ts +1 -0
  84. package/dist/utils/retry.test.js +163 -0
  85. package/dist/utils/search.d.ts +11 -0
  86. package/dist/utils/search.js +29 -0
  87. package/dist/utils/shell.d.ts +45 -0
  88. package/dist/utils/shell.js +242 -0
  89. package/dist/utils/skills.d.ts +144 -0
  90. package/dist/utils/skills.js +1137 -0
  91. package/dist/utils/smartContext.d.ts +29 -0
  92. package/dist/utils/smartContext.js +441 -0
  93. package/dist/utils/tools.d.ts +224 -0
  94. package/dist/utils/tools.js +731 -0
  95. package/dist/utils/update.d.ts +22 -0
  96. package/dist/utils/update.js +128 -0
  97. package/dist/utils/validation.d.ts +28 -0
  98. package/dist/utils/validation.js +141 -0
  99. package/dist/utils/validation.test.d.ts +1 -0
  100. package/dist/utils/validation.test.js +164 -0
  101. package/dist/utils/verify.d.ts +78 -0
  102. package/dist/utils/verify.js +464 -0
  103. package/package.json +68 -0
package/README.md ADDED
@@ -0,0 +1,576 @@
1
+ # Codeep
2
+
3
+ <p align="center">
4
+ <img src="Codeep.svg" alt="Codeep Logo" width="200">
5
+ </p>
6
+
7
+ <p align="center">
8
+ <strong>Deep into Code.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.
13
+ </p>
14
+
15
+ ## Features
16
+
17
+ ### Multi-Provider Support
18
+ - **Z.AI (ZhipuAI)** - GLM-4.7, GLM-4.7 Flash models
19
+ - **MiniMax** - MiniMax M2.1 model
20
+ - Switch between providers with `/provider`
21
+ - Configure different API keys per provider
22
+
23
+ ### Project Context Awareness
24
+ When started in a project directory, Codeep automatically:
25
+ - Detects project type (Node.js, Python, etc.)
26
+ - Reads file paths mentioned in your messages
27
+ - Attaches file contents to conversations
28
+ - Understands your project structure
29
+ - Can suggest and apply code changes (with write permission)
30
+
31
+ ### Session Management
32
+ - **Auto-save** - Conversations are automatically saved
33
+ - **Session picker** - Choose which session to continue on startup
34
+ - **Per-project sessions** - Sessions stored in `.codeep/sessions/`
35
+ - **Rename sessions** - Give meaningful names with `/rename`
36
+ - **Search history** - Find past conversations with `/search`
37
+ - **Export** - Save to Markdown, JSON, or plain text
38
+
39
+ ### Git Integration
40
+ - `/diff` - Review unstaged changes with AI assistance
41
+ - `/diff --staged` - Review staged changes
42
+ - `/commit` - Generate conventional commit messages
43
+
44
+ ### Code Block Management
45
+ - Automatic syntax highlighting for 12+ languages
46
+ - Copy code blocks to clipboard with `/copy [n]`
47
+ - Code blocks are numbered for easy reference
48
+
49
+ ### Autonomous Agent Mode
50
+
51
+ Codeep works as a **full AI coding agent** that autonomously:
52
+ - Creates, edits, and deletes files
53
+ - Executes shell commands (npm, git, build, test, etc.)
54
+ - Reads and analyzes your codebase
55
+ - Loops until the task is complete
56
+ - Reports all actions taken
57
+
58
+ **Auto mode (default)**: Just describe what you want - no special commands needed:
59
+ ```
60
+ > add error handling to src/api/index.ts
61
+ > run tests and fix any failures
62
+ > create a new React component for user settings
63
+ ```
64
+
65
+ **Manual mode**: Use `/agent <task>` when you want explicit control.
66
+
67
+ **Agent Tools:**
68
+ | Tool | Description |
69
+ |------|-------------|
70
+ | `read_file` | Read file contents |
71
+ | `write_file` | Create or overwrite files |
72
+ | `edit_file` | Edit specific text in files |
73
+ | `delete_file` | Delete files or directories |
74
+ | `create_directory` | Create folders |
75
+ | `list_files` | List directory contents |
76
+ | `execute_command` | Run shell commands |
77
+ | `search_code` | Search for patterns in code |
78
+ | `fetch_url` | Fetch content from URLs |
79
+
80
+ ### Undo & History
81
+ - **Undo actions** - Revert any file change the agent made
82
+ - **Session history** - View and restore from previous agent sessions
83
+ - **Action tracking** - All file operations are logged for review
84
+
85
+ ### Context Persistence
86
+ - **Save conversations** - Continue where you left off
87
+ - **Per-project context** - Each project maintains its own history
88
+ - **Automatic summarization** - Old messages are summarized to save space
89
+
90
+ ### Web Fetch
91
+ - Agent can fetch documentation and web content
92
+ - Useful for looking up API docs, examples, etc.
93
+ - Automatic HTML-to-text conversion
94
+
95
+ ### Smart Context
96
+ Agent automatically gathers relevant files before making changes:
97
+ - Analyzes imports and dependencies
98
+ - Reads related type definitions
99
+ - Understands project structure
100
+ - Prevents duplicate code and inconsistencies
101
+
102
+ ### Code Review Mode
103
+ Built-in static analysis with `/review`:
104
+ - Security vulnerabilities (XSS, injection, hardcoded secrets)
105
+ - Performance issues (inefficient patterns)
106
+ - Type safety problems (any types, ts-ignore)
107
+ - Best practices and maintainability
108
+ - Generates a score (0-100)
109
+
110
+ ### Interactive Mode
111
+ Agent asks clarifying questions when tasks are ambiguous:
112
+ ```
113
+ You: "add authentication"
114
+ Agent: "What type of authentication do you want?
115
+ a) JWT tokens
116
+ b) Session-based
117
+ c) OAuth (Google/GitHub)"
118
+ ```
119
+
120
+ ### Diff Preview
121
+ See exactly what will change before applying:
122
+ ```diff
123
+ - const user = getUser();
124
+ + const user = await getUser();
125
+ ```
126
+
127
+ ### Learning Mode
128
+ Agent learns your coding preferences:
129
+ - Indentation style (tabs/spaces)
130
+ - Quote style (single/double)
131
+ - Naming conventions
132
+ - Preferred libraries
133
+ - Custom rules you define
134
+
135
+ ### Skills System
136
+ Predefined workflows for common development tasks. Execute with a single command:
137
+
138
+ ```
139
+ /commit - Generate commit message and commit
140
+ /test - Generate tests for current code
141
+ /docs - Add documentation to code
142
+ /refactor - Improve code quality
143
+ /fix - Debug and fix issues
144
+ /component - Generate React/Vue component
145
+ /docker - Generate Dockerfile
146
+ ```
147
+
148
+ **50+ Built-in Skills:**
149
+
150
+ | Category | Skills |
151
+ |----------|--------|
152
+ | **Git** | `/commit` (`/c`), `/amend`, `/push` (`/p`), `/pull`, `/pr`, `/changelog`, `/branch`, `/stash`, `/unstash` |
153
+ | **Testing** | `/test` (`/t`), `/test-fix`, `/coverage`, `/e2e`, `/mock` |
154
+ | **Documentation** | `/docs` (`/d`), `/readme`, `/explain` (`/e`), `/api-docs`, `/translate` |
155
+ | **Refactoring** | `/refactor` (`/r`), `/types`, `/optimize` (`/o`), `/cleanup`, `/modernize`, `/migrate`, `/split`, `/rename` |
156
+ | **Debugging** | `/debug` (`/b`), `/fix` (`/f`), `/security`, `/profile`, `/log` |
157
+ | **Deployment** | `/build`, `/deploy`, `/release`, `/publish` |
158
+ | **Code Generation** | `/component`, `/api`, `/model`, `/hook`, `/service`, `/page`, `/form`, `/crud` |
159
+ | **DevOps** | `/docker`, `/ci`, `/env`, `/k8s`, `/terraform`, `/nginx`, `/monitor` |
160
+
161
+ **Shortcuts:** Many skills have single-letter shortcuts (shown in parentheses).
162
+
163
+ **Skill Parameters:** Many skills accept parameters:
164
+ ```
165
+ /component UserCard # Generate component named UserCard
166
+ /api users method=POST # Generate POST endpoint for users
167
+ /migrate "React 18" # Migrate to React 18
168
+ /model User fields=name,email # Generate User model with fields
169
+ ```
170
+
171
+ **Skill Chaining:** Run multiple skills in sequence with `+`:
172
+ ```
173
+ /commit+push # Commit then push
174
+ /test+commit+push # Test, commit if pass, then push
175
+ /build+deploy # Build then deploy
176
+ ```
177
+
178
+ **Search Skills:**
179
+ ```
180
+ /skills docker # Find skills related to docker
181
+ /skills testing # Find testing-related skills
182
+ ```
183
+
184
+ **Custom Skills:** Create your own skills:
185
+ ```
186
+ /skill create my-workflow # Creates template in ~/.codeep/skills/
187
+ /skill delete my-workflow # Delete custom skill
188
+ /skill help commit # Show skill details
189
+ ```
190
+
191
+ Custom skill example (`~/.codeep/skills/my-workflow.json`):
192
+ ```json
193
+ {
194
+ "name": "my-workflow",
195
+ "description": "My custom workflow",
196
+ "shortcut": "m",
197
+ "parameters": [
198
+ { "name": "target", "description": "Target environment", "required": true }
199
+ ],
200
+ "steps": [
201
+ { "type": "command", "content": "npm run build" },
202
+ { "type": "confirm", "content": "Deploy to ${target}?" },
203
+ { "type": "agent", "content": "Deploy the application to ${target}" },
204
+ { "type": "notify", "content": "Deployed to ${target}!" }
205
+ ]
206
+ }
207
+ ```
208
+
209
+ ### Self-Verification
210
+ After making changes, the agent automatically:
211
+ 1. Runs **build** to check for compilation errors
212
+ 2. Runs **tests** to ensure nothing is broken
213
+ 3. Runs **type checking** for TypeScript/PHP projects
214
+ 4. If errors found → automatically tries to fix them (up to 3 attempts)
215
+ 5. Reports final verification status
216
+
217
+ **Supported project types:**
218
+
219
+ | Language | Build | Test | Type Check |
220
+ |----------|-------|------|------------|
221
+ | **Node.js/TypeScript** | npm/yarn/pnpm/bun run build | npm test, vitest, jest | tsc --noEmit |
222
+ | **Python** | - | pytest | - |
223
+ | **Go** | go build | go test | - |
224
+ | **Rust** | cargo build | cargo test | - |
225
+ | **PHP/Laravel** | composer run build | phpunit, artisan test | php -l (syntax) |
226
+
227
+ ### Security Features
228
+ - API keys stored securely (macOS Keychain / Linux Secret Service)
229
+ - Per-project permissions (read-only or read-write)
230
+ - Input validation and sanitization
231
+ - Configurable rate limiting
232
+ - Agent sandboxed to project directory
233
+ - Dangerous commands blocked (rm -rf /, sudo, etc.)
234
+ - Confirmation mode for destructive actions
235
+
236
+ ## Installation
237
+
238
+ ### Option 1: curl (Quickest)
239
+
240
+ ```bash
241
+ curl -fsSL https://raw.githubusercontent.com/VladoIvankovic/Codeep/main/install.sh | bash
242
+ ```
243
+
244
+ **Custom installation directory:**
245
+ ```bash
246
+ curl -fsSL https://raw.githubusercontent.com/VladoIvankovic/Codeep/main/install.sh | INSTALL_DIR=~/.local/bin bash
247
+ ```
248
+
249
+ **Specific version:**
250
+ ```bash
251
+ curl -fsSL https://raw.githubusercontent.com/VladoIvankovic/Codeep/main/install.sh | VERSION=1.0.0 bash
252
+ ```
253
+
254
+ ### Option 2: Homebrew (macOS/Linux)
255
+
256
+ ```bash
257
+ brew tap VladoIvankovic/codeep
258
+ brew install codeep
259
+ ```
260
+
261
+ **Update:**
262
+ ```bash
263
+ brew upgrade codeep
264
+ ```
265
+
266
+ ### Option 3: npm
267
+
268
+ ```bash
269
+ npm install -g codeep
270
+ ```
271
+
272
+ **Update:**
273
+ ```bash
274
+ npm update -g codeep
275
+ ```
276
+
277
+ ### Option 4: Manual Binary
278
+
279
+ Download the latest binary for your platform from [GitHub Releases](https://github.com/VladoIvankovic/Codeep/releases):
280
+
281
+ | Platform | Binary |
282
+ |----------|--------|
283
+ | macOS Apple Silicon (M1/M2/M3/M4) | `codeep-macos-arm64` |
284
+ | macOS Intel | `codeep-macos-x64` |
285
+ | Linux x86_64 | `codeep-linux-x64` |
286
+
287
+ ```bash
288
+ # Example for macOS Apple Silicon:
289
+ curl -fsSL https://github.com/VladoIvankovic/Codeep/releases/latest/download/codeep-macos-arm64 -o codeep
290
+ chmod +x codeep
291
+ sudo mv codeep /usr/local/bin/
292
+ ```
293
+
294
+ ## Quick Start
295
+
296
+ ```bash
297
+ # Navigate to your project directory
298
+ cd /path/to/your/project
299
+
300
+ # Start Codeep
301
+ codeep
302
+
303
+ # On first run, enter your API key
304
+ # Get one at: https://z.ai/subscribe?ic=NXYNXZOV14
305
+ ```
306
+
307
+ After installation, `codeep` is available globally in your terminal. Simply run it from any project directory to start coding with AI assistance.
308
+
309
+ ## Commands
310
+
311
+ ### General
312
+
313
+ | Command | Description |
314
+ |---------|-------------|
315
+ | `/help` | Show help and available commands |
316
+ | `/status` | Show current configuration status |
317
+ | `/version` | Show version and current provider/model |
318
+ | `/update` | Check for updates |
319
+ | `/clear` | Clear chat history and start new session |
320
+ | `/exit` | Quit application |
321
+
322
+ ### AI Configuration
323
+
324
+ | Command | Description |
325
+ |---------|-------------|
326
+ | `/provider` | Switch AI provider (Z.ai, MiniMax) |
327
+ | `/model` | Switch AI model |
328
+ | `/protocol` | Switch API protocol (OpenAI/Anthropic) |
329
+ | `/lang` | Set response language (12 languages supported) |
330
+ | `/settings` | Adjust temperature, max tokens, timeout, rate limits |
331
+
332
+ ### Session Management
333
+
334
+ | Command | Description |
335
+ |---------|-------------|
336
+ | `/sessions` | List and load saved sessions |
337
+ | `/sessions delete <name>` | Delete a specific session |
338
+ | `/rename <name>` | Rename current session |
339
+ | `/search <term>` | Search through chat history |
340
+ | `/export` | Export chat to MD/JSON/TXT format |
341
+
342
+ ### Code & Files
343
+
344
+ | Command | Description |
345
+ |---------|-------------|
346
+ | `/apply` | Apply file changes from AI response |
347
+ | `/copy [n]` | Copy code block to clipboard (n = block number, -1 = last) |
348
+
349
+ ### Agent Mode
350
+
351
+ | Command | Description |
352
+ |---------|-------------|
353
+ | `/agent <task>` | Run agent for a specific task (manual mode) |
354
+ | `/agent-dry <task>` | Preview what agent would do without executing |
355
+ | `/agent-stop` | Stop a running agent |
356
+ | `/undo` | Undo the last agent action |
357
+ | `/undo-all` | Undo all actions from current session |
358
+ | `/history` | Show recent agent sessions |
359
+ | `/changes` | Show all file changes from current session |
360
+
361
+ ### Git Integration
362
+
363
+ | Command | Description |
364
+ |---------|-------------|
365
+ | `/diff` | Review unstaged git changes |
366
+ | `/diff --staged` | Review staged git changes |
367
+ | `/commit` | Generate commit message for staged changes |
368
+ | `/git-commit [msg]` | Commit current changes with message |
369
+
370
+ ### Context Persistence
371
+
372
+ | Command | Description |
373
+ |---------|-------------|
374
+ | `/context-save` | Save current conversation for later |
375
+ | `/context-load` | Load previously saved conversation |
376
+ | `/context-clear` | Clear saved context for this project |
377
+
378
+ ### Code Review & Learning
379
+
380
+ | Command | Description |
381
+ |---------|-------------|
382
+ | `/review` | Run code review on changed files |
383
+ | `/review <file>` | Review specific file |
384
+ | `/learn` | Learn preferences from project files |
385
+ | `/learn status` | Show learned preferences |
386
+ | `/learn rule <text>` | Add a custom coding rule |
387
+
388
+ ### Skills
389
+
390
+ | Command | Description |
391
+ |---------|-------------|
392
+ | `/skills` | List all available skills |
393
+ | `/skills <query>` | Search skills by keyword |
394
+ | `/skills stats` | Show skill usage statistics |
395
+ | `/skill <name>` | Execute a skill (e.g., `/skill commit`) |
396
+ | `/skill <name> <params>` | Execute skill with parameters |
397
+ | `/skill help <name>` | Show skill details and steps |
398
+ | `/skill create <name>` | Create a new custom skill |
399
+ | `/skill delete <name>` | Delete a custom skill |
400
+ | `/c`, `/t`, `/d`, etc. | Skill shortcuts |
401
+ | `/commit+push` | Skill chaining (run multiple skills) |
402
+
403
+ ### Authentication
404
+
405
+ | Command | Description |
406
+ |---------|-------------|
407
+ | `/login` | Login with API key |
408
+ | `/logout` | Logout (choose which provider) |
409
+
410
+ ## Keyboard Shortcuts
411
+
412
+ | Key | Action |
413
+ |-----|--------|
414
+ | `Enter` | Submit message |
415
+ | `↑` / `↓` | Navigate input history |
416
+ | `Ctrl+L` | Clear chat (same as `/clear`) |
417
+ | `Escape` | Cancel current request |
418
+
419
+ ## Supported Languages
420
+
421
+ Codeep can respond in 12 languages:
422
+
423
+ | Code | Language |
424
+ |------|----------|
425
+ | `auto` | Auto-detect (matches user's language) |
426
+ | `en` | English |
427
+ | `zh` | Chinese (中文) |
428
+ | `es` | Spanish (Español) |
429
+ | `hi` | Hindi (हिन्दी) |
430
+ | `ar` | Arabic (العربية) |
431
+ | `pt` | Portuguese (Português) |
432
+ | `fr` | French (Français) |
433
+ | `de` | German (Deutsch) |
434
+ | `ja` | Japanese (日本語) |
435
+ | `ru` | Russian (Русский) |
436
+ | `hr` | Croatian (Hrvatski) |
437
+
438
+ ## Syntax Highlighting
439
+
440
+ Code blocks are automatically highlighted for:
441
+
442
+ - Python
443
+ - JavaScript / TypeScript
444
+ - Java
445
+ - Go
446
+ - Rust
447
+ - Bash / Shell
448
+ - PHP
449
+ - HTML / CSS
450
+ - SQL
451
+
452
+ ## Project Permissions
453
+
454
+ When you run Codeep in a project directory for the first time:
455
+
456
+ 1. Codeep asks for permission to access the project
457
+ 2. You can grant:
458
+ - **Read-only** - AI can see and analyze your code
459
+ - **Read + Write** - AI can also suggest file modifications
460
+ 3. Permissions are saved in `.codeep/config.json`
461
+
462
+ With write access enabled:
463
+ - AI can suggest file changes using special code blocks
464
+ - You'll be prompted to approve changes with `Y/n`
465
+ - Use `/apply` to manually apply changes from the last response
466
+
467
+ ## Configuration
468
+
469
+ ### Config Locations
470
+
471
+ | Type | Location |
472
+ |------|----------|
473
+ | Global config | `~/.config/codeep/config.json` |
474
+ | Project config | `.codeep/config.json` |
475
+ | Global sessions | `~/.codeep/sessions/` |
476
+ | Project sessions | `.codeep/sessions/` |
477
+ | Global logs | `~/.codeep/logs/` |
478
+ | Project logs | `.codeep/logs/` |
479
+
480
+ ### Environment Variables
481
+
482
+ | Variable | Description |
483
+ |----------|-------------|
484
+ | `ZAI_API_KEY` | Z.ai API key |
485
+ | `ZHIPUAI_API_KEY` | ZhipuAI API key (alternative) |
486
+ | `MINIMAX_API_KEY` | MiniMax API key |
487
+
488
+ ### Settings (`/settings`)
489
+
490
+ | Setting | Default | Description |
491
+ |---------|---------|-------------|
492
+ | Temperature | 0.7 | Response creativity (0.0 - 2.0) |
493
+ | Max Tokens | 4096 | Maximum response length |
494
+ | API Timeout | 30000ms | Request timeout |
495
+ | API Rate Limit | 30/min | Max API calls per minute |
496
+ | Command Rate Limit | 100/min | Max commands per minute |
497
+ | Agent Mode | Auto | `Auto` = agent runs on every message, `Manual` = use /agent |
498
+ | Agent Confirmation | Dangerous | `Never`, `Dangerous` (default), or `Always` |
499
+ | Agent Auto-Commit | Off | Automatically commit after agent completes |
500
+ | Agent Branch | Off | Create new branch for agent commits |
501
+ | Agent Auto-Verify | On | Automatically run build/test after changes |
502
+ | Agent Max Fix Attempts | 3 | Max attempts to auto-fix errors |
503
+
504
+ ## Usage Examples
505
+
506
+ ### Autonomous Coding (Auto Agent Mode)
507
+
508
+ With write access enabled, just describe what you want:
509
+
510
+ ```
511
+ > add input validation to the login form
512
+ # Agent reads the file, adds validation, writes changes
513
+
514
+ > the tests are failing, fix them
515
+ # Agent runs tests, analyzes errors, fixes code, re-runs tests
516
+
517
+ > refactor src/utils to use async/await instead of callbacks
518
+ # Agent reads files, refactors each one, verifies changes
519
+
520
+ > create a new API endpoint for user preferences
521
+ # Agent creates route file, adds types, updates index
522
+ ```
523
+
524
+ ### Code Review
525
+ ```
526
+ > /diff --staged
527
+ # AI reviews your staged changes and provides feedback
528
+ ```
529
+
530
+ ### Manual Agent Mode
531
+ ```
532
+ > /agent add a dark mode toggle to settings
533
+ # Explicitly runs agent for this task
534
+
535
+ > /agent-dry reorganize the folder structure
536
+ # Shows what agent would do without making changes
537
+ ```
538
+
539
+ ### Basic Chat (when agent mode is manual or read-only)
540
+ ```
541
+ > Explain what a closure is in JavaScript
542
+ > Look at src/utils/api.ts and explain what it does
543
+ ```
544
+
545
+ ### Session Management
546
+ ```
547
+ > /rename feature-auth-implementation
548
+ Session renamed to: feature-auth-implementation
549
+
550
+ > /search authentication
551
+ # Find all messages mentioning "authentication"
552
+
553
+ > /export
554
+ # Export chat to markdown file
555
+ ```
556
+
557
+ ## Architecture
558
+
559
+ Codeep is built with:
560
+
561
+ - **React + Ink** - Terminal UI framework
562
+ - **TypeScript** - Type-safe codebase
563
+ - **Conf** - Configuration management
564
+ - **Node.js Keychain** - Secure credential storage
565
+
566
+ ## License
567
+
568
+ Apache 2.0
569
+
570
+ ## Contributing
571
+
572
+ Contributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/VladoIvankovic/Codeep).
573
+
574
+ ## Support
575
+
576
+ - **Issues**: [GitHub Issues](https://github.com/VladoIvankovic/Codeep/issues)
@@ -0,0 +1,8 @@
1
+ import { Message } from '../config/index';
2
+ import { ProjectContext } from '../utils/project';
3
+ export declare function setProjectContext(ctx: ProjectContext | null): void;
4
+ export declare function chat(message: string, history?: Message[], onChunk?: (chunk: string) => void, onRetry?: (attempt: number) => void, projectContext?: ProjectContext | null, abortSignal?: AbortSignal): Promise<string>;
5
+ export declare function validateApiKey(apiKey: string, providerId?: string): Promise<{
6
+ valid: boolean;
7
+ error?: string;
8
+ }>;