xibecode 0.3.5 โ 0.4.3
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/LICENSE +201 -0
- package/README.md +255 -904
- package/dist/commands/chat.d.ts +1 -0
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +106 -8
- package/dist/commands/chat.js.map +1 -1
- package/dist/core/modes.d.ts +302 -14
- package/dist/core/modes.d.ts.map +1 -1
- package/dist/core/modes.js +81 -9
- package/dist/core/modes.js.map +1 -1
- package/dist/core/session-bridge.d.ts +105 -0
- package/dist/core/session-bridge.d.ts.map +1 -0
- package/dist/core/session-bridge.js +243 -0
- package/dist/core/session-bridge.js.map +1 -0
- package/dist/core/tools.d.ts +359 -0
- package/dist/core/tools.d.ts.map +1 -1
- package/dist/core/tools.js +631 -1
- package/dist/core/tools.js.map +1 -1
- package/dist/index.js +42 -35
- package/dist/index.js.map +1 -1
- package/dist/tools/browser.d.ts +112 -0
- package/dist/tools/browser.d.ts.map +1 -1
- package/dist/tools/browser.js +396 -13
- package/dist/tools/browser.js.map +1 -1
- package/dist/tools/test-generator.d.ts +157 -0
- package/dist/tools/test-generator.d.ts.map +1 -0
- package/dist/tools/test-generator.js +893 -0
- package/dist/tools/test-generator.js.map +1 -0
- package/dist/webui/server.d.ts +96 -0
- package/dist/webui/server.d.ts.map +1 -0
- package/dist/webui/server.js +2132 -0
- package/dist/webui/server.js.map +1 -0
- package/package.json +30 -14
- package/webui-dist/assets/index-BlYSY3Lp.js +338 -0
- package/webui-dist/assets/index-BlYSY3Lp.js.map +1 -0
- package/webui-dist/assets/index-DS6Gij8T.css +32 -0
- package/webui-dist/assets/xterm-BUw9jMN8.js +10 -0
- package/webui-dist/assets/xterm-BUw9jMN8.js.map +1 -0
- package/webui-dist/assets/xterm-addon-fit-CMYoGiLV.js +2 -0
- package/webui-dist/assets/xterm-addon-fit-CMYoGiLV.js.map +1 -0
- package/webui-dist/assets/xterm-addon-web-links-mCwMW5Oc.js +2 -0
- package/webui-dist/assets/xterm-addon-web-links-mCwMW5Oc.js.map +1 -0
- package/webui-dist/index.html +15 -0
package/README.md
CHANGED
|
@@ -1,1025 +1,376 @@
|
|
|
1
|
-
# XibeCode
|
|
2
|
-
|
|
3
|
-
> **Production-ready autonomous coding agent powered by Claude AI**
|
|
4
|
-
|
|
5
|
-
XibeCode is a professional CLI tool that brings autonomous AI coding capabilities to your terminal. Like Claude Code, but open-source, customizable, and with advanced context management.
|
|
6
|
-
|
|
7
|
-
## ๐ What's New in v0.1.8
|
|
8
|
-
|
|
9
|
-
**v0.1.8:**
|
|
10
|
-
|
|
11
|
-
- ๐ **Learn from Docs** - `/learn <name> <url>` scrapes documentation sites and auto-generates skills
|
|
12
|
-
- ๐ท๏ธ **Smart Crawling** - Follows internal links, scrapes up to 25 pages, extracts clean text
|
|
13
|
-
- ๐ง **Auto-Skill Generation** - Creates skill files in `.xibecode/skills/` from scraped docs
|
|
14
|
-
- ๐ **Progress Feedback** - Real-time progress as pages are fetched
|
|
15
|
-
|
|
16
|
-
**v0.1.7:**
|
|
17
|
-
|
|
18
|
-
- ๐ **Skills System** - Activate specialized AI workflows with `/skill` command
|
|
19
|
-
- ๐งน **5 Built-in Skills** - refactor-clean-code, debug-production, write-tests, security-audit, optimize-performance
|
|
20
|
-
- ๐ **Custom Skills** - Create your own skills in `.xibecode/skills/` (markdown with YAML frontmatter)
|
|
21
|
-
- ๐ฏ **Smart Skill Injection** - Active skills inject specialized instructions into AI's system prompt
|
|
22
|
-
- ๐ **Status Bar Display** - See active skill in status bar
|
|
23
|
-
|
|
24
|
-
**v0.1.6:**
|
|
25
|
-
|
|
26
|
-
- ๐ **Codebase Search** - New `grep_code` tool using ripgrep (grep fallback) for lightning-fast code search across your project
|
|
27
|
-
- ๐ **Web Search** - New `web_search` tool powered by DuckDuckGo โ free, no API key required
|
|
28
|
-
- ๐ **URL Fetching** - New `fetch_url` tool to read any webpage as clean text (HTML auto-stripped)
|
|
29
|
-
- ๐ง **Project Memory** - Persistent `.xibecode/memory.md` that saves project knowledge across sessions
|
|
30
|
-
- ๐ฏ **Verified Edit Tool** - `verified_edit` with old content verification prevents hallucinated edits
|
|
31
|
-
- ๐ก๏ธ **Safer Editing by Default** - AI uses `verified_edit` as primary editing method with smart fallbacks
|
|
32
|
-
|
|
33
|
-
**Previous Updates:**
|
|
34
|
-
|
|
35
|
-
- ๐งช **Test Integration** - Auto-detect & run tests (Vitest, Jest, pytest, Go test)
|
|
36
|
-
- ๐ **Git Awareness** - Create checkpoints, check status, revert changes safely
|
|
37
|
-
- ๐ก๏ธ **Safety Controls** - Dry-run mode, risk assessment, command blocking
|
|
38
|
-
- ๐ **Plugin System** - Extend XibeCode with custom tools
|
|
39
|
-
- ๐ฆ **Smart Package Manager** - Prefers pnpm โ bun โ npm
|
|
40
|
-
- ๐ง **Enhanced Reasoning** - Advanced problem-solving, pattern recognition, and error handling
|
|
41
|
-
- ๐ก **MCP Integration** - Connect to external MCP servers for extended capabilities
|
|
42
|
-
|
|
43
|
-
## ๐ฏ Key Features
|
|
44
|
-
|
|
45
|
-
### Core Capabilities
|
|
46
|
-
|
|
47
|
-
- โ
**Autonomous Agent Loop** - AI iteratively works on tasks until completion
|
|
48
|
-
- โ
**Smart Context Management** - Automatically loads related files (imports, tests, configs)
|
|
49
|
-
- โ
**Advanced File Editing** - Search/replace, line-range edits, automatic backups
|
|
50
|
-
- โ
**Cross-Platform** - Works on Windows, macOS, and Linux
|
|
51
|
-
- โ
**Beautiful TUI** - Real-time progress, colored output, clear visualization
|
|
52
|
-
- โ
**Loop Detection** - Prevents infinite loops and runaway executions
|
|
53
|
-
- โ
**Multiple Edit Methods** - Smart edit, line-range edit, insert, revert
|
|
54
|
-
|
|
55
|
-
### ๐ New Features
|
|
56
|
-
|
|
57
|
-
- โ
**Web Search** - Search the web from within the AI (DuckDuckGo, free, no API key)
|
|
58
|
-
- โ
**Codebase Search** - Ripgrep-powered code search across your entire project
|
|
59
|
-
- โ
**URL Fetching** - Read any webpage as clean text for research
|
|
60
|
-
- โ
**Project Memory** - Persist project knowledge across sessions in `.xibecode/memory.md`
|
|
61
|
-
- โ
**Verified Editing** - Content-verified file edits that prevent AI mistakes
|
|
62
|
-
- โ
**Test Integration** - Auto-detect and run tests (Vitest, Jest, pytest, Go test)
|
|
63
|
-
- โ
**Git Awareness** - Check status, create checkpoints, revert changes safely
|
|
64
|
-
- โ
**Dry-Run Mode** - Preview changes without making them
|
|
65
|
-
- โ
**Safety Controls** - Risk assessment and command blocking for dangerous operations
|
|
66
|
-
- โ
**Plugin System** - Extend XibeCode with custom tools and workflows
|
|
67
|
-
|
|
68
|
-
### ๐ Skills System
|
|
69
|
-
|
|
70
|
-
XibeCode includes a **skills system** that activates specialized AI workflows for common tasks:
|
|
71
|
-
|
|
72
|
-
**Built-in Skills:**
|
|
73
|
-
|
|
74
|
-
- `refactor-clean-code` - Clean code principles & SOLID patterns
|
|
75
|
-
- `debug-production` - Systematic debugging workflow
|
|
76
|
-
- `write-tests` - Comprehensive testing with 80%+ coverage
|
|
77
|
-
- `security-audit` - OWASP Top 10 security checks
|
|
78
|
-
- `optimize-performance` - Performance profiling & optimization
|
|
79
|
-
|
|
80
|
-
**Usage:**
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
# In chat mode
|
|
84
|
-
/skill list # Show all skills
|
|
85
|
-
/skill refactor-clean-code # Activate a skill
|
|
86
|
-
/skill off # Deactivate current skill
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
When a skill is active, the AI follows specialized instructions and best practices for that domain. Create custom skills in `.xibecode/skills/` (markdown files with YAML frontmatter).
|
|
90
|
-
|
|
91
|
-
### File Operations
|
|
1
|
+
# XibeCode
|
|
92
2
|
|
|
93
|
-
-
|
|
94
|
-
- ๐ Write files (create or overwrite)
|
|
95
|
-
- โ๏ธ Edit files (search/replace with automatic backups)
|
|
96
|
-
- ๐ฏ Verified edits (content verification before applying)
|
|
97
|
-
- โ๏ธ Edit specific line ranges
|
|
98
|
-
- โฉ๏ธ Revert to previous versions
|
|
99
|
-
- ๐ Search files with glob patterns
|
|
100
|
-
- ๐ Grep codebase with ripgrep
|
|
101
|
-
- ๐ List directories
|
|
102
|
-
- ๐ง Get intelligent context (related files)
|
|
3
|
+
AI-powered autonomous coding assistant for your terminal and browser.
|
|
103
4
|
|
|
104
|
-
|
|
5
|
+
[](https://www.anishkumar.tech/donate)
|
|
6
|
+
[](https://www.npmjs.com/package/xibecode)
|
|
105
7
|
|
|
106
|
-
|
|
107
|
-
- ๐ Fetch and read any URL as text
|
|
108
|
-
- ๐ง Project memory persistence
|
|
8
|
+
## Overview
|
|
109
9
|
|
|
110
|
-
|
|
10
|
+
XibeCode is a CLI agent that can read and edit code, run commands, and iterate on tasks from your terminal using LLMs. It now includes a **WebUI** for a browser-based experience, **AI-powered test generation**, and **multi-model support** for both Anthropic and OpenAI models.
|
|
111
11
|
|
|
112
|
-
|
|
113
|
-
- ๐ง Cross-platform command support
|
|
114
|
-
- ๐ Capture stdout/stderr
|
|
115
|
-
- โ
Exit code handling
|
|
12
|
+
## What's New in v0.4.0
|
|
116
13
|
|
|
117
|
-
|
|
14
|
+
- **TUI-WebUI Sync** - Real-time bidirectional sync between terminal and browser
|
|
15
|
+
- **Slash Commands** - Type `/` in WebUI to switch between 13 agent modes
|
|
16
|
+
- **File References** - Type `@` to browse and reference project files
|
|
17
|
+
- **Custom Model Support** - Use any OpenAI-compatible API endpoint
|
|
18
|
+
- **Tool Execution Display** - See tool calls and results in real-time
|
|
19
|
+
- **Markdown Rendering** - Rich text formatting in chat responses
|
|
20
|
+
- **Minimalistic Design** - Clean, terminal-style interface
|
|
118
21
|
|
|
119
|
-
|
|
22
|
+
## Installation
|
|
120
23
|
|
|
121
24
|
```bash
|
|
122
25
|
npm install -g xibecode
|
|
123
26
|
```
|
|
124
27
|
|
|
125
|
-
|
|
28
|
+
From source:
|
|
126
29
|
|
|
127
30
|
```bash
|
|
128
31
|
git clone https://github.com/iotserver24/xibecode
|
|
129
32
|
cd xibecode
|
|
130
|
-
|
|
131
|
-
|
|
33
|
+
pnpm install
|
|
34
|
+
pnpm run build
|
|
132
35
|
npm link
|
|
133
36
|
```
|
|
134
37
|
|
|
135
|
-
##
|
|
136
|
-
|
|
137
|
-
### 1. Set up API Key
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
# Interactive setup
|
|
141
|
-
xibecode config
|
|
142
|
-
|
|
143
|
-
# Or set directly
|
|
144
|
-
xibecode config --set-key YOUR_ANTHROPIC_API_KEY
|
|
38
|
+
## Requirements
|
|
145
39
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
```
|
|
40
|
+
- Node.js 18+
|
|
41
|
+
- API key from Anthropic or OpenAI
|
|
149
42
|
|
|
150
|
-
|
|
43
|
+
## Quick Start
|
|
151
44
|
|
|
152
45
|
```bash
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
### 3. Try Interactive Chat
|
|
46
|
+
# Configure once
|
|
47
|
+
xibecode config --set-key YOUR_API_KEY
|
|
157
48
|
|
|
158
|
-
|
|
49
|
+
# Interactive terminal mode
|
|
159
50
|
xibecode chat
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## ๐ก Usage
|
|
163
|
-
|
|
164
|
-
### Run Command (Autonomous Mode)
|
|
165
|
-
|
|
166
|
-
The main command for autonomous coding tasks:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
xibecode run [prompt] [options]
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**Options:**
|
|
173
|
-
|
|
174
|
-
- `-f, --file <path>` - Read prompt from a file
|
|
175
|
-
- `-m, --model <model>` - AI model to use (default: claude-sonnet-4-5-20250929)
|
|
176
|
-
- `-b, --base-url <url>` - Custom API base URL
|
|
177
|
-
- `-k, --api-key <key>` - API key (overrides config)
|
|
178
|
-
- `-d, --max-iterations <number>` - Maximum iterations (default: 50)
|
|
179
|
-
- `-v, --verbose` - Show detailed logs
|
|
180
|
-
- `--dry-run` - Preview changes without making them
|
|
181
|
-
- `--changed-only` - Focus only on git-changed files
|
|
182
|
-
|
|
183
|
-
**Examples:**
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
# Simple task
|
|
187
|
-
xibecode run "Create a REST API with Express"
|
|
188
|
-
|
|
189
|
-
# From file
|
|
190
|
-
xibecode run --file task.txt
|
|
191
|
-
|
|
192
|
-
# With verbose logging
|
|
193
|
-
xibecode run "Fix the bug in app.js" --verbose
|
|
194
|
-
|
|
195
|
-
# Using specific model
|
|
196
|
-
xibecode run "Optimize this code" --model claude-opus-4-5-20251101
|
|
197
|
-
|
|
198
|
-
# Custom API endpoint
|
|
199
|
-
xibecode run "task" --base-url https://custom-api.com
|
|
200
|
-
|
|
201
|
-
# New in v2.0: Dry-run mode
|
|
202
|
-
xibecode run "Refactor authentication" --dry-run
|
|
203
|
-
|
|
204
|
-
# Focus on git-changed files only
|
|
205
|
-
xibecode run "Fix linting errors" --changed-only
|
|
206
|
-
|
|
207
|
-
# Run tests after making changes
|
|
208
|
-
xibecode run "Add validation and run tests to verify"
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Chat Command (Interactive Mode)
|
|
212
|
-
|
|
213
|
-
For quick questions and iterative development:
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
xibecode chat [options]
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
**Options:**
|
|
220
|
-
|
|
221
|
-
- `-m, --model <model>` - AI model to use
|
|
222
|
-
- `-b, --base-url <url>` - Custom API base URL
|
|
223
|
-
- `-k, --api-key <key>` - API key
|
|
224
|
-
|
|
225
|
-
**Commands in chat:**
|
|
226
|
-
|
|
227
|
-
- `tools on/off` - Toggle tool execution
|
|
228
|
-
- `clear` - Clear screen
|
|
229
|
-
- `exit` or `quit` - Exit chat
|
|
230
|
-
|
|
231
|
-
**Example:**
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
$ xibecode chat
|
|
235
|
-
|
|
236
|
-
You: How do I implement JWT authentication?
|
|
237
|
-
Assistant: [explains JWT auth]
|
|
238
|
-
|
|
239
|
-
You: Write the code for it
|
|
240
|
-
Assistant: [writes code using tools]
|
|
241
|
-
|
|
242
|
-
You: Add it to my Express app
|
|
243
|
-
Assistant: [modifies app.js]
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
### Config Command
|
|
247
|
-
|
|
248
|
-
Manage your configuration:
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
# Interactive setup
|
|
252
|
-
xibecode config
|
|
253
|
-
|
|
254
|
-
# Quick operations
|
|
255
|
-
xibecode config --set-key YOUR_KEY
|
|
256
|
-
xibecode config --set-url https://custom-api.com
|
|
257
|
-
xibecode config --set-model claude-opus-4-5-20251101
|
|
258
|
-
xibecode config --show
|
|
259
|
-
xibecode config --reset
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
## ๐จ What Makes XibeCode Different
|
|
263
|
-
|
|
264
|
-
### 1. **Smart Context Management**
|
|
265
|
-
|
|
266
|
-
XibeCode automatically understands your project:
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
xibecode run "Add error handling to userController.js"
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
The AI will:
|
|
273
|
-
|
|
274
|
-
- Read `userController.js`
|
|
275
|
-
- Find and read imported files
|
|
276
|
-
- Check for related test files
|
|
277
|
-
- Look at config files (package.json, tsconfig.json)
|
|
278
|
-
- Make informed edits with full context
|
|
279
|
-
|
|
280
|
-
### 2. **Advanced File Editing**
|
|
281
|
-
|
|
282
|
-
Four ways to edit files, with verified_edit as the recommended default:
|
|
283
|
-
|
|
284
|
-
#### Verified Edit (DEFAULT - Most Reliable) ๐ฏ
|
|
285
|
-
|
|
286
|
-
```javascript
|
|
287
|
-
// AI reads the file first, then provides old content for verification
|
|
288
|
-
{
|
|
289
|
-
tool: "verified_edit",
|
|
290
|
-
path: "app.js",
|
|
291
|
-
start_line: 5,
|
|
292
|
-
end_line: 5,
|
|
293
|
-
old_content: "const port = 3000;",
|
|
294
|
-
new_content: "const port = process.env.PORT || 3000;"
|
|
295
|
-
}
|
|
296
|
-
// If old_content doesn't match โ edit is REJECTED and actual content is returned
|
|
297
|
-
// AI can then re-read and retry with correct content
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
#### Search/Replace (Fallback)
|
|
301
|
-
|
|
302
|
-
```javascript
|
|
303
|
-
{
|
|
304
|
-
tool: "edit_file",
|
|
305
|
-
path: "app.js",
|
|
306
|
-
search: "const port = 3000;",
|
|
307
|
-
replace: "const port = process.env.PORT || 3000;"
|
|
308
|
-
}
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
#### Line Range (For Large Files)
|
|
312
|
-
|
|
313
|
-
```javascript
|
|
314
|
-
{
|
|
315
|
-
tool: "edit_lines",
|
|
316
|
-
path: "app.js",
|
|
317
|
-
start_line: 10,
|
|
318
|
-
end_line: 15,
|
|
319
|
-
new_content: "// Updated code here"
|
|
320
|
-
}
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
#### Insert (Add New Code)
|
|
324
|
-
|
|
325
|
-
```javascript
|
|
326
|
-
{
|
|
327
|
-
tool: "insert_at_line",
|
|
328
|
-
path: "app.js",
|
|
329
|
-
line: 5,
|
|
330
|
-
content: "const express = require('express');"
|
|
331
|
-
}
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
### 3. **Automatic Backups & Revert**
|
|
335
|
-
|
|
336
|
-
Every edit creates a backup. Made a mistake?
|
|
337
|
-
|
|
338
|
-
```bash
|
|
339
|
-
xibecode run "Revert app.js to previous version"
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
### 4. **Cross-Platform**
|
|
343
|
-
|
|
344
|
-
Works identically on:
|
|
345
|
-
|
|
346
|
-
- โ
Windows (PowerShell)
|
|
347
|
-
- โ
macOS (bash/zsh)
|
|
348
|
-
- โ
Linux (bash)
|
|
349
|
-
|
|
350
|
-
The AI automatically uses the right commands for your OS.
|
|
351
|
-
|
|
352
|
-
### 5. **Beautiful Real-Time UI**
|
|
353
|
-
|
|
354
|
-
```
|
|
355
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
356
|
-
โ XibeCode AI Agent โ
|
|
357
|
-
โ Autonomous Coding Assistant v0.1.5 โ
|
|
358
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
359
|
-
|
|
360
|
-
๐ Task:
|
|
361
|
-
Create a REST API with Express
|
|
362
|
-
|
|
363
|
-
โ๏ธ Configuration:
|
|
364
|
-
Model: claude-sonnet-4-5-20250929
|
|
365
|
-
Max Iterations: 50
|
|
366
|
-
|
|
367
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
368
|
-
|
|
369
|
-
Iteration 1/50 (2%) - 0.5s
|
|
370
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
371
|
-
|
|
372
|
-
๐ read_file
|
|
373
|
-
โ package.json
|
|
374
|
-
โ Success
|
|
375
|
-
โ 25 lines
|
|
376
|
-
|
|
377
|
-
๐ write_file
|
|
378
|
-
โ src/server.js
|
|
379
|
-
โ Success
|
|
380
|
-
โ File created (45 lines)
|
|
381
|
-
|
|
382
|
-
๐ฌ Assistant:
|
|
383
|
-
I've created an Express server with the following endpoints...
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
## ๐ ๏ธ Advanced Features
|
|
387
|
-
|
|
388
|
-
### Custom API Endpoints
|
|
389
|
-
|
|
390
|
-
Use with Azure, AWS Bedrock, or custom Claude deployments:
|
|
391
|
-
|
|
392
|
-
```bash
|
|
393
|
-
# Via config
|
|
394
|
-
xibecode config --set-url https://your-custom-endpoint.com
|
|
395
|
-
|
|
396
|
-
# Via command
|
|
397
|
-
xibecode run "task" --base-url https://your-custom-endpoint.com
|
|
398
|
-
```
|
|
399
51
|
|
|
400
|
-
|
|
52
|
+
# Open WebUI in browser (recommended for beginners)
|
|
53
|
+
xibecode ui --open
|
|
401
54
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
```bash
|
|
405
|
-
xibecode run "Fix the bug around line 500 in large-file.js"
|
|
55
|
+
# Autonomous run
|
|
56
|
+
xibecode run "Create an Express API with auth"
|
|
406
57
|
```
|
|
407
58
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
1. Read lines 450-550 (context around the area)
|
|
411
|
-
2. Make targeted edit using line numbers
|
|
412
|
-
3. Verify the change
|
|
59
|
+
## Main Commands
|
|
413
60
|
|
|
414
|
-
###
|
|
61
|
+
### `xibecode ui`
|
|
62
|
+
**NEW** - Start the WebUI in your browser.
|
|
415
63
|
|
|
416
64
|
```bash
|
|
417
|
-
xibecode
|
|
65
|
+
xibecode ui # Start on localhost:3847
|
|
66
|
+
xibecode ui --open # Auto-open browser
|
|
67
|
+
xibecode ui -p 8080 # Custom port
|
|
418
68
|
```
|
|
419
69
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
-
|
|
423
|
-
-
|
|
424
|
-
-
|
|
425
|
-
-
|
|
426
|
-
|
|
427
|
-
### Error Recovery
|
|
70
|
+
Features:
|
|
71
|
+
- **Dashboard** - Project stats, git status, test runner info
|
|
72
|
+
- **Chat Interface** - Real-time streaming responses
|
|
73
|
+
- **Visual Diff** - Colorized git diff viewer
|
|
74
|
+
- **AI Test Generator** - Generate tests with one click
|
|
75
|
+
- **Multi-Model Selector** - Switch models instantly
|
|
76
|
+
- **Configuration Panel** - Manage API keys and settings
|
|
428
77
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
1. Read the error message
|
|
432
|
-
2. Analyze what went wrong
|
|
433
|
-
3. Try a different approach
|
|
434
|
-
4. Can revert changes if needed
|
|
435
|
-
|
|
436
|
-
## ๐งช Test Integration
|
|
437
|
-
|
|
438
|
-
XibeCode automatically detects and runs your project tests:
|
|
78
|
+
### `xibecode run`
|
|
79
|
+
Autonomous coding workflow.
|
|
439
80
|
|
|
440
81
|
```bash
|
|
441
|
-
|
|
442
|
-
xibecode run "Fix the
|
|
443
|
-
|
|
444
|
-
# Run tests after changes
|
|
445
|
-
xibecode run "Add validation to User model and ensure all tests pass"
|
|
82
|
+
xibecode run "Build a REST API with Express"
|
|
83
|
+
xibecode run "Fix the TypeScript errors" --verbose
|
|
84
|
+
xibecode run --file task.txt
|
|
446
85
|
```
|
|
447
86
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
-
|
|
451
|
-
-
|
|
452
|
-
-
|
|
87
|
+
Options:
|
|
88
|
+
- `-f, --file <path>` prompt from file
|
|
89
|
+
- `-m, --model <model>` model override
|
|
90
|
+
- `--mode <mode>` initial agent mode
|
|
91
|
+
- `-b, --base-url <url>` custom API URL
|
|
92
|
+
- `-k, --api-key <key>` API key override
|
|
93
|
+
- `--provider <provider>` `anthropic` or `openai`
|
|
94
|
+
- `-d, --max-iterations <number>` default `150` (`0` = unlimited)
|
|
95
|
+
- `-v, --verbose`
|
|
96
|
+
- `--dry-run`
|
|
97
|
+
- `--changed-only`
|
|
453
98
|
|
|
454
|
-
|
|
99
|
+
### `xibecode chat`
|
|
100
|
+
Interactive terminal chat + tool use.
|
|
455
101
|
|
|
456
|
-
|
|
457
|
-
-
|
|
102
|
+
Options:
|
|
103
|
+
- `-m, --model <model>`
|
|
104
|
+
- `-b, --base-url <url>`
|
|
105
|
+
- `-k, --api-key <key>`
|
|
106
|
+
- `--provider <provider>`
|
|
107
|
+
- `--theme <theme>`
|
|
108
|
+
- `--session <id>`
|
|
458
109
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
```bash
|
|
462
|
-
xibecode run "Refactor the authentication module:
|
|
463
|
-
1. Read the current code
|
|
464
|
-
2. Make improvements
|
|
465
|
-
3. Run tests to verify
|
|
466
|
-
4. Fix any test failures
|
|
467
|
-
5. Repeat until all tests pass"
|
|
468
|
-
```
|
|
110
|
+
### `xibecode config`
|
|
111
|
+
Manage saved config:
|
|
469
112
|
|
|
470
|
-
|
|
113
|
+
- `--set-key`, `--set-url`, `--set-model`
|
|
114
|
+
- `--show`, `--reset`
|
|
115
|
+
- MCP helpers: `--list-mcp-servers`, `--add-mcp-server`, `--remove-mcp-server`
|
|
471
116
|
|
|
472
|
-
|
|
117
|
+
### `xibecode mcp`
|
|
118
|
+
MCP server management:
|
|
473
119
|
|
|
474
|
-
|
|
120
|
+
- `add`, `list`, `remove`, `file`, `edit`, `init`, `reload`
|
|
121
|
+
- `search`, `install`, `login` (Smithery integration)
|
|
475
122
|
|
|
476
|
-
|
|
477
|
-
xibecode run "Show me the current git status"
|
|
478
|
-
```
|
|
123
|
+
## Core Features
|
|
479
124
|
|
|
480
|
-
|
|
125
|
+
- **Autonomous multi-step agent loop** - Completes complex tasks automatically
|
|
126
|
+
- **Smart context gathering** - Understands related files and imports
|
|
127
|
+
- **Verified and line-based editing** - Reliable code modifications
|
|
128
|
+
- **Dry-run mode** - Preview changes safely before applying
|
|
129
|
+
- **Git-aware workflows** - `--changed-only`, checkpoints, and reverts
|
|
130
|
+
- **Test runner integration** - Auto-detects Vitest, Jest, pytest, Go test
|
|
131
|
+
- **MCP server integration** - Extend capabilities with external tools
|
|
132
|
+
- **Skill system** - Built-in + custom markdown skills
|
|
133
|
+
- **Session-aware chat** - Persistent conversation history
|
|
134
|
+
- **Themed terminal UI** - Beautiful, customizable interface
|
|
481
135
|
|
|
482
|
-
|
|
483
|
-
- Staged/unstaged/untracked files
|
|
484
|
-
- Clean/dirty state
|
|
485
|
-
- Commits ahead/behind upstream
|
|
136
|
+
## WebUI
|
|
486
137
|
|
|
487
|
-
|
|
138
|
+
The WebUI provides a browser-based interface that syncs in real-time with the terminal.
|
|
488
139
|
|
|
489
140
|
```bash
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
The AI will:
|
|
494
|
-
|
|
495
|
-
- Get list of modified files with `get_git_changed_files`
|
|
496
|
-
- Focus edits only on those files
|
|
497
|
-
- More efficient for large codebases
|
|
498
|
-
|
|
499
|
-
### Create Safe Checkpoints
|
|
141
|
+
# Start with both TUI and WebUI
|
|
142
|
+
xibecode chat
|
|
500
143
|
|
|
501
|
-
|
|
502
|
-
xibecode run "Refactor the database layer (create checkpoint first)"
|
|
144
|
+
# WebUI opens automatically at http://localhost:3847
|
|
503
145
|
```
|
|
504
146
|
|
|
505
|
-
|
|
147
|
+
### TUI-WebUI Sync
|
|
506
148
|
|
|
507
|
-
|
|
508
|
-
-
|
|
509
|
-
-
|
|
149
|
+
When you run `xibecode chat`, both interfaces are connected:
|
|
150
|
+
- Messages sent from **TUI** appear in **WebUI** (marked with "TUI")
|
|
151
|
+
- Messages sent from **WebUI** are processed by **TUI**
|
|
152
|
+
- Streaming responses show in both simultaneously
|
|
153
|
+
- Tool executions display in real-time
|
|
510
154
|
|
|
511
|
-
|
|
155
|
+
### Slash Commands (`/`)
|
|
512
156
|
|
|
513
|
-
|
|
514
|
-
// The AI executes:
|
|
515
|
-
create_git_checkpoint({
|
|
516
|
-
message: "before refactoring database layer",
|
|
517
|
-
strategy: "stash" // or "commit"
|
|
518
|
-
})
|
|
157
|
+
Type `/` in the input to open the command palette:
|
|
519
158
|
|
|
520
|
-
|
|
159
|
+
**Commands:**
|
|
521
160
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
161
|
+
| Command | Description |
|
|
162
|
+
|---------|-------------|
|
|
163
|
+
| `/clear` | Clear chat messages |
|
|
164
|
+
| `/help` | Show available commands |
|
|
165
|
+
| `/diff` | Show git diff |
|
|
166
|
+
| `/status` | Show git status |
|
|
167
|
+
| `/test` | Run project tests |
|
|
168
|
+
| `/format` | Format code in project |
|
|
169
|
+
| `/reset` | Reset chat session |
|
|
170
|
+
| `/files` | List project files |
|
|
531
171
|
|
|
532
|
-
|
|
533
|
-
xibecode run "Prepare this branch for code review:
|
|
534
|
-
- Run tests
|
|
535
|
-
- Fix any linting errors
|
|
536
|
-
- Generate a summary of changes"
|
|
537
|
-
```
|
|
172
|
+
**Modes:**
|
|
538
173
|
|
|
539
|
-
|
|
174
|
+
| Mode | Icon | Description |
|
|
175
|
+
|------|------|-------------|
|
|
176
|
+
| `/mode agent` | ๐ค | Autonomous coding (default) |
|
|
177
|
+
| `/mode plan` | ๐ | Analyze without modifying |
|
|
178
|
+
| `/mode tester` | ๐งช | Testing and QA |
|
|
179
|
+
| `/mode debugger` | ๐ | Bug investigation |
|
|
180
|
+
| `/mode security` | ๐ | Security analysis |
|
|
181
|
+
| `/mode review` | ๐ | Code review |
|
|
182
|
+
| `/mode team_leader` | ๐ | Coordinate team |
|
|
183
|
+
| `/mode architect` | ๐๏ธ | System design |
|
|
184
|
+
| `/mode engineer` | ๐ ๏ธ | Implementation |
|
|
185
|
+
| `/mode seo` | ๐ | SEO optimization |
|
|
186
|
+
| `/mode product` | ๐ฅ | Product strategy |
|
|
187
|
+
| `/mode data` | ๐ | Data analysis |
|
|
188
|
+
| `/mode researcher` | ๐ | Deep research |
|
|
540
189
|
|
|
541
|
-
###
|
|
190
|
+
### File References (`@`)
|
|
542
191
|
|
|
543
|
-
|
|
192
|
+
Type `@` to browse and reference files:
|
|
193
|
+
- Shows project files and folders
|
|
194
|
+
- Filter by typing after `@`
|
|
195
|
+
- Select to include file path in message
|
|
196
|
+
- Helps AI understand which files to work with
|
|
544
197
|
|
|
545
|
-
|
|
546
|
-
xibecode run "Refactor the auth module" --dry-run
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
In dry-run mode:
|
|
550
|
-
|
|
551
|
-
- All file operations show what *would* happen
|
|
552
|
-
- No actual changes are made
|
|
553
|
-
- Git operations are simulated
|
|
554
|
-
- Perfect for testing complex tasks
|
|
555
|
-
|
|
556
|
-
**Example output:**
|
|
557
|
-
|
|
558
|
-
```
|
|
559
|
-
[DRY RUN] Would replace lines 15-20 with 8 new lines
|
|
560
|
-
[DRY RUN] Would write 150 lines to src/auth/index.ts
|
|
561
|
-
[DRY RUN] Would create stash checkpoint: "before auth refactor"
|
|
562
|
-
```
|
|
198
|
+
### Settings Panel
|
|
563
199
|
|
|
564
|
-
|
|
200
|
+
Click the โ๏ธ Settings button to configure:
|
|
201
|
+
- **Provider** - Anthropic, OpenAI, or Custom
|
|
202
|
+
- **Model** - Select from available models
|
|
203
|
+
- **Custom Model ID** - For custom/local models
|
|
204
|
+
- **API Key** - Your provider API key
|
|
205
|
+
- **Base URL** - Custom API endpoint (for local LLMs)
|
|
206
|
+
- **Session Info** - Working directory, git branch
|
|
565
207
|
|
|
566
|
-
|
|
208
|
+
### Features
|
|
567
209
|
|
|
568
|
-
|
|
210
|
+
- **Markdown Rendering** - Code blocks, bold, italic, lists, links
|
|
211
|
+
- **Tool Execution** - Shows each tool call with status (running/done/failed)
|
|
212
|
+
- **Thinking Indicator** - Spinner while AI is processing
|
|
213
|
+
- **Responsive Design** - Works on mobile and desktop
|
|
214
|
+
- **Real-time Streaming** - See responses as they're generated
|
|
569
215
|
|
|
570
|
-
|
|
571
|
-
- Force push to git
|
|
572
|
-
- Destructive shell commands
|
|
573
|
-
- Reverting to checkpoints
|
|
216
|
+
## AI Test Generation
|
|
574
217
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
- Fork bombs
|
|
578
|
-
- Deleting root/home directories
|
|
579
|
-
- Direct disk writes
|
|
580
|
-
- Extremely dangerous commands
|
|
581
|
-
|
|
582
|
-
**Example:**
|
|
218
|
+
XibeCode can automatically generate comprehensive test suites for your code:
|
|
583
219
|
|
|
584
220
|
```bash
|
|
585
|
-
|
|
221
|
+
# Via CLI (in chat mode)
|
|
222
|
+
> generate tests for src/utils/helpers.ts
|
|
586
223
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
224
|
+
# Via WebUI
|
|
225
|
+
1. Go to "Test Generator" tab
|
|
226
|
+
2. Enter file path
|
|
227
|
+
3. Select framework (auto-detected)
|
|
228
|
+
4. Click "Generate Tests"
|
|
590
229
|
```
|
|
591
230
|
|
|
592
|
-
###
|
|
593
|
-
|
|
594
|
-
XibeCode suggests safer alternatives for risky commands:
|
|
595
|
-
|
|
596
|
-
- `rm -rf` โ "Use `mv` to move files first"
|
|
597
|
-
- `git push --force` โ "Use `git push --force-with-lease`"
|
|
598
|
-
- `npm install` โ "Use `pnpm install` or `bun install`"
|
|
599
|
-
|
|
600
|
-
## ๐ Plugin System
|
|
601
|
-
|
|
602
|
-
Extend XibeCode with custom tools and domain-specific logic:
|
|
603
|
-
|
|
604
|
-
### Create a Plugin
|
|
605
|
-
|
|
606
|
-
```javascript
|
|
607
|
-
// my-plugin.js
|
|
608
|
-
export default {
|
|
609
|
-
name: 'my-custom-plugin',
|
|
610
|
-
version: '1.0.0',
|
|
611
|
-
description: 'Adds custom tools for my workflow',
|
|
612
|
-
|
|
613
|
-
registerTools() {
|
|
614
|
-
return [
|
|
615
|
-
{
|
|
616
|
-
schema: {
|
|
617
|
-
name: 'deploy_to_staging',
|
|
618
|
-
description: 'Deploy the app to staging environment',
|
|
619
|
-
input_schema: {
|
|
620
|
-
type: 'object',
|
|
621
|
-
properties: {
|
|
622
|
-
branch: { type: 'string', description: 'Branch to deploy' }
|
|
623
|
-
},
|
|
624
|
-
required: ['branch']
|
|
625
|
-
}
|
|
626
|
-
},
|
|
627
|
-
async handler(input) {
|
|
628
|
-
// Your custom logic here
|
|
629
|
-
return { success: true, deployed: true, branch: input.branch };
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
];
|
|
633
|
-
},
|
|
634
|
-
|
|
635
|
-
initialize() {
|
|
636
|
-
console.log('My plugin loaded!');
|
|
637
|
-
}
|
|
638
|
-
};
|
|
639
|
-
```
|
|
231
|
+
### Features
|
|
640
232
|
|
|
641
|
-
|
|
233
|
+
- **Multi-framework support** - Vitest, Jest, Mocha, pytest, Go test
|
|
234
|
+
- **Code analysis** - Understands functions, classes, types
|
|
235
|
+
- **Edge case generation** - Null checks, empty strings, boundaries
|
|
236
|
+
- **Mock setup** - Automatic mock configuration
|
|
237
|
+
- **Type checking tests** - Verifies return types
|
|
238
|
+
- **Error handling tests** - Tests for exceptions
|
|
642
239
|
|
|
643
|
-
|
|
644
|
-
# Via config
|
|
645
|
-
xibecode config --show
|
|
240
|
+
### Example Output
|
|
646
241
|
|
|
647
|
-
|
|
648
|
-
{
|
|
649
|
-
|
|
650
|
-
"/path/to/my-plugin.js",
|
|
651
|
-
"./local-plugin.js"
|
|
652
|
-
]
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
# Or use directly
|
|
656
|
-
xibecode run "Deploy to staging"
|
|
657
|
-
```
|
|
242
|
+
```typescript
|
|
243
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
244
|
+
import { calculateTotal } from '../utils/helpers';
|
|
658
245
|
|
|
659
|
-
|
|
246
|
+
describe('calculateTotal', () => {
|
|
247
|
+
it('should execute calculateTotal successfully', () => {
|
|
248
|
+
expect(calculateTotal([])).toBeDefined();
|
|
249
|
+
});
|
|
660
250
|
|
|
661
|
-
|
|
251
|
+
it('should return correct type from calculateTotal', () => {
|
|
252
|
+
expect(typeof calculateTotal([])).toBe('number');
|
|
253
|
+
});
|
|
662
254
|
|
|
663
|
-
|
|
255
|
+
it('should handle empty array', () => {
|
|
256
|
+
expect(calculateTotal([])).toBe(0);
|
|
257
|
+
});
|
|
664
258
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
handler: async (input) => {
|
|
670
|
-
// Run database migration
|
|
671
|
-
}
|
|
672
|
-
}];
|
|
673
|
-
}
|
|
259
|
+
it('should handle errors in calculateTotal', () => {
|
|
260
|
+
expect(() => calculateTotal(undefined)).toThrow();
|
|
261
|
+
});
|
|
262
|
+
});
|
|
674
263
|
```
|
|
675
264
|
|
|
676
|
-
|
|
265
|
+
## Browser Testing (Playwright)
|
|
677
266
|
|
|
678
|
-
|
|
679
|
-
registerTools() {
|
|
680
|
-
return [{
|
|
681
|
-
schema: { name: 'query_internal_api', ... },
|
|
682
|
-
handler: async (input) => {
|
|
683
|
-
// Call internal company API
|
|
684
|
-
}
|
|
685
|
-
}];
|
|
686
|
-
}
|
|
687
|
-
```
|
|
267
|
+
XibeCode includes comprehensive browser automation and testing capabilities:
|
|
688
268
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
269
|
+
- **Screenshots** - Capture webpage screenshots
|
|
270
|
+
- **Console Logs** - Collect browser console output
|
|
271
|
+
- **Visual Regression** - Compare screenshots against baselines
|
|
272
|
+
- **Accessibility Audits** - Check WCAG compliance
|
|
273
|
+
- **Performance Metrics** - Measure Core Web Vitals (FCP, LCP, CLS, TTI)
|
|
274
|
+
- **Responsive Testing** - Test across multiple viewports
|
|
275
|
+
- **Network Monitoring** - Capture all network requests
|
|
276
|
+
- **E2E Tests** - Execute Playwright test files
|
|
692
277
|
|
|
693
278
|
```bash
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
- POST /auth/login
|
|
697
|
-
- JWT token generation
|
|
698
|
-
- Middleware to protect routes
|
|
699
|
-
- Hash passwords with bcrypt"
|
|
700
|
-
```
|
|
279
|
+
# Example: Test performance
|
|
280
|
+
xibecode run "Measure the performance of http://localhost:3000"
|
|
701
281
|
|
|
702
|
-
|
|
282
|
+
# Example: Check accessibility
|
|
283
|
+
xibecode run "Run an accessibility audit on the homepage"
|
|
703
284
|
|
|
704
|
-
|
|
705
|
-
xibecode run "
|
|
706
|
-
Debug and fix the issues." --verbose
|
|
285
|
+
# Example: Visual regression test
|
|
286
|
+
xibecode run "Take a screenshot and compare against baseline"
|
|
707
287
|
```
|
|
708
288
|
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
```bash
|
|
712
|
-
xibecode run "Refactor src/ to use TypeScript:
|
|
713
|
-
- Convert all .js files to .ts
|
|
714
|
-
- Add type annotations
|
|
715
|
-
- Create types.ts for shared types
|
|
716
|
-
- Update tsconfig.json"
|
|
717
|
-
```
|
|
718
|
-
|
|
719
|
-
### Generate Tests
|
|
720
|
-
|
|
721
|
-
```bash
|
|
722
|
-
xibecode run "Write comprehensive tests for userController.js:
|
|
723
|
-
- Test all endpoints
|
|
724
|
-
- Test error cases
|
|
725
|
-
- Use Jest
|
|
726
|
-
- Achieve >80% coverage"
|
|
727
|
-
```
|
|
728
|
-
|
|
729
|
-
## โ๏ธ Configuration
|
|
730
|
-
|
|
731
|
-
XibeCode stores config in `~/.xibecode/`
|
|
732
|
-
|
|
733
|
-
### Available Settings
|
|
734
|
-
|
|
735
|
-
```javascript
|
|
736
|
-
{
|
|
737
|
-
"apiKey": "sk-ant-...", // Your Anthropic API key
|
|
738
|
-
"baseUrl": "https://...", // Custom API endpoint (optional)
|
|
739
|
-
"model": "claude-sonnet-4-5-...", // Default model
|
|
740
|
-
"maxIterations": 50, // Default max iterations
|
|
741
|
-
"defaultVerbose": false, // Default verbose mode
|
|
742
|
-
|
|
743
|
-
// New in v2.0
|
|
744
|
-
"preferredPackageManager": "pnpm", // Package manager: "pnpm", "bun", or "npm"
|
|
745
|
-
"enableDryRunByDefault": false, // Enable dry-run mode by default
|
|
746
|
-
"gitCheckpointStrategy": "stash", // Git checkpoint: "stash" or "commit"
|
|
747
|
-
"testCommandOverride": "", // Custom test command (optional)
|
|
748
|
-
"plugins": [], // Array of plugin paths
|
|
749
|
-
|
|
750
|
-
// Latest version
|
|
751
|
-
"mcpServers": {} // MCP server configurations (object-based)
|
|
752
|
-
}
|
|
753
|
-
```
|
|
289
|
+
## Configuration
|
|
754
290
|
|
|
755
291
|
### Environment Variables
|
|
756
292
|
|
|
757
293
|
```bash
|
|
758
|
-
ANTHROPIC_API_KEY=
|
|
759
|
-
|
|
760
|
-
XIBECODE_MODEL=claude-
|
|
294
|
+
ANTHROPIC_API_KEY=sk-ant-... # Anthropic API key
|
|
295
|
+
OPENAI_API_KEY=sk-... # OpenAI API key
|
|
296
|
+
XIBECODE_MODEL=claude-sonnet-4-5-20250929 # Default model
|
|
761
297
|
```
|
|
762
298
|
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
## ๐ก MCP Integration (Model Context Protocol)
|
|
766
|
-
|
|
767
|
-
XibeCode supports the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), enabling connection to external servers that provide additional tools, resources, and capabilities.
|
|
768
|
-
|
|
769
|
-
### What is MCP?
|
|
770
|
-
|
|
771
|
-
MCP is an open protocol that standardizes how applications provide context to LLMs. With MCP, you can:
|
|
772
|
-
|
|
773
|
-
- **Extend Tools**: Add tools from external servers (databases, APIs, etc.)
|
|
774
|
-
- **Access Resources**: Read data from external sources
|
|
775
|
-
- **Use Prompt Templates**: Leverage pre-built prompts from servers
|
|
299
|
+
### Config File
|
|
776
300
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
#### File-Based Configuration (Easiest - Recommended)
|
|
780
|
-
|
|
781
|
-
Edit the MCP servers configuration file directly:
|
|
782
|
-
|
|
783
|
-
```bash
|
|
784
|
-
# Show file path
|
|
785
|
-
xibecode mcp file
|
|
786
|
-
|
|
787
|
-
# Open file in your editor
|
|
788
|
-
xibecode mcp edit
|
|
789
|
-
|
|
790
|
-
# Or edit manually
|
|
791
|
-
nano ~/.xibecode/mcp-servers.json
|
|
792
|
-
```
|
|
793
|
-
|
|
794
|
-
**File Format** (`~/.xibecode/mcp-servers.json`):
|
|
301
|
+
Located at `~/.xibecode/config.json`:
|
|
795
302
|
|
|
796
303
|
```json
|
|
797
304
|
{
|
|
798
|
-
"
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
"github": {
|
|
804
|
-
"command": "mcp-server-github",
|
|
805
|
-
"args": ["--token", "YOUR_TOKEN"],
|
|
806
|
-
"env": {
|
|
807
|
-
"GITHUB_TOKEN": "your_token_here"
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
}
|
|
305
|
+
"apiKey": "sk-ant-...",
|
|
306
|
+
"model": "claude-sonnet-4-5-20250929",
|
|
307
|
+
"provider": "anthropic",
|
|
308
|
+
"maxIterations": 50,
|
|
309
|
+
"theme": "default"
|
|
811
310
|
}
|
|
812
311
|
```
|
|
813
312
|
|
|
814
|
-
|
|
313
|
+
### Available Models
|
|
815
314
|
|
|
816
|
-
|
|
315
|
+
| Model | Provider | Best For |
|
|
316
|
+
|-------|----------|----------|
|
|
317
|
+
| `claude-sonnet-4-5-20250929` | Anthropic | General coding (default) |
|
|
318
|
+
| `claude-opus-4-5-20251101` | Anthropic | Complex reasoning |
|
|
319
|
+
| `claude-haiku-4-5-20251015` | Anthropic | Fast responses |
|
|
320
|
+
| `gpt-4o` | OpenAI | General coding |
|
|
321
|
+
| `gpt-4o-mini` | OpenAI | Fast responses |
|
|
322
|
+
| `o1-preview` | OpenAI | Complex reasoning |
|
|
817
323
|
|
|
818
|
-
|
|
819
|
-
# Create default file with examples
|
|
820
|
-
xibecode mcp init
|
|
324
|
+
## API
|
|
821
325
|
|
|
822
|
-
|
|
823
|
-
xibecode mcp reload
|
|
824
|
-
|
|
825
|
-
# Show file path and status
|
|
826
|
-
xibecode mcp file
|
|
827
|
-
```
|
|
828
|
-
|
|
829
|
-
#### Commands
|
|
326
|
+
XibeCode provides a REST API when running the WebUI:
|
|
830
327
|
|
|
831
328
|
```bash
|
|
832
|
-
#
|
|
833
|
-
xibecode
|
|
834
|
-
# or
|
|
835
|
-
xibecode mcp edit
|
|
836
|
-
|
|
837
|
-
# List all configured servers
|
|
838
|
-
xibecode mcp list
|
|
839
|
-
|
|
840
|
-
# Remove a server (or edit file manually)
|
|
841
|
-
xibecode mcp remove filesystem
|
|
842
|
-
|
|
843
|
-
# Show file path
|
|
844
|
-
xibecode mcp file
|
|
845
|
-
|
|
846
|
-
# Reload after editing
|
|
847
|
-
xibecode mcp reload
|
|
848
|
-
```
|
|
329
|
+
# Start the server
|
|
330
|
+
xibecode ui
|
|
849
331
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
#
|
|
332
|
+
# API endpoints
|
|
333
|
+
GET /api/health # Health check
|
|
334
|
+
GET /api/config # Get configuration
|
|
335
|
+
PUT /api/config # Update configuration
|
|
336
|
+
GET /api/models # List available models
|
|
337
|
+
GET /api/project # Get project info
|
|
338
|
+
GET /api/git/status # Get git status
|
|
339
|
+
GET /api/git/diff # Get git diff
|
|
340
|
+
POST /api/files/list # List directory contents
|
|
341
|
+
POST /api/files/read # Read file contents
|
|
342
|
+
POST /api/session/create # Create chat session
|
|
343
|
+
POST /api/tests/generate # Generate tests for file
|
|
344
|
+
POST /api/tests/analyze # Analyze file for testable code
|
|
345
|
+
POST /api/tests/run # Run project tests
|
|
857
346
|
```
|
|
858
347
|
|
|
859
|
-
|
|
348
|
+
## Project Structure
|
|
860
349
|
|
|
861
|
-
```bash
|
|
862
|
-
xibecode config
|
|
863
|
-
# Select "๐ก Manage MCP Servers" โ "โ Add MCP Server"
|
|
864
350
|
```
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
```bash
|
|
877
|
-
# Open the config file
|
|
878
|
-
xibecode mcp edit
|
|
879
|
-
|
|
880
|
-
# Add your server to the file using the new format:
|
|
881
|
-
{
|
|
882
|
-
"mcpServers": {
|
|
883
|
-
"filesystem": {
|
|
884
|
-
"command": "mcp-server-filesystem",
|
|
885
|
-
"args": ["--root", "/path/to/files"]
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
}
|
|
351
|
+
xibecode/
|
|
352
|
+
โโโ src/
|
|
353
|
+
โ โโโ core/ # Agent, tools, context
|
|
354
|
+
โ โโโ commands/ # CLI commands
|
|
355
|
+
โ โโโ utils/ # Config, git, safety
|
|
356
|
+
โ โโโ tools/ # Test generator, browser
|
|
357
|
+
โ โโโ webui/ # WebUI server
|
|
358
|
+
โ โโโ index.ts # CLI entry point
|
|
359
|
+
โโโ site/ # Documentation site
|
|
360
|
+
โโโ tests/ # Test suites
|
|
889
361
|
```
|
|
890
362
|
|
|
891
|
-
|
|
363
|
+
## Project Docs
|
|
892
364
|
|
|
893
|
-
|
|
365
|
+
- `CHANGELOG.md` โ release history
|
|
366
|
+
- `FEATURES.md` โ feature deep dive
|
|
367
|
+
- `PUBLISHING.md` โ npm release process
|
|
894
368
|
|
|
895
|
-
|
|
896
|
-
# In chat mode, view MCP servers and tools
|
|
897
|
-
xibecode chat
|
|
898
|
-
> /mcp
|
|
899
|
-
```
|
|
369
|
+
## Support
|
|
900
370
|
|
|
901
|
-
|
|
371
|
+
- [GitHub Issues](https://github.com/iotserver24/xibecode/issues)
|
|
372
|
+
- [Donate](https://www.anishkumar.tech/donate)
|
|
902
373
|
|
|
903
|
-
|
|
374
|
+
## License
|
|
904
375
|
|
|
905
|
-
-
|
|
906
|
-
- **@modelcontextprotocol/server-github** - GitHub API integration
|
|
907
|
-
- **@modelcontextprotocol/server-postgres** - PostgreSQL database access
|
|
908
|
-
- **@modelcontextprotocol/server-slack** - Slack integration
|
|
909
|
-
- **Custom servers** - Build your own with the MCP SDK
|
|
910
|
-
|
|
911
|
-
### Example: Adding GitHub MCP Server
|
|
912
|
-
|
|
913
|
-
```bash
|
|
914
|
-
# Install the GitHub MCP server
|
|
915
|
-
npm install -g @modelcontextprotocol/server-github
|
|
916
|
-
|
|
917
|
-
# Open the config file to add the server
|
|
918
|
-
xibecode mcp edit
|
|
919
|
-
# Edit the file and add:
|
|
920
|
-
# {
|
|
921
|
-
# "mcpServers": {
|
|
922
|
-
# "github": {
|
|
923
|
-
# "command": "mcp-server-github",
|
|
924
|
-
# "args": ["--token", "YOUR_GITHUB_TOKEN"]
|
|
925
|
-
# }
|
|
926
|
-
# }
|
|
927
|
-
# }
|
|
928
|
-
|
|
929
|
-
# Reload servers
|
|
930
|
-
xibecode mcp reload
|
|
931
|
-
|
|
932
|
-
# Now XibeCode can use GitHub tools
|
|
933
|
-
xibecode chat
|
|
934
|
-
> Create an issue in my repo about the bug we just found
|
|
935
|
-
```
|
|
936
|
-
|
|
937
|
-
## ๐ง Enhanced AI Capabilities
|
|
938
|
-
|
|
939
|
-
XibeCode includes advanced reasoning capabilities that enable it to:
|
|
940
|
-
|
|
941
|
-
### Systematic Problem Solving
|
|
942
|
-
|
|
943
|
-
- **Problem Decomposition**: Breaks complex tasks into manageable steps
|
|
944
|
-
- **Hypothesis-Driven Development**: Forms and tests hypotheses systematically
|
|
945
|
-
- **Root Cause Analysis**: Traces issues to their source, not just symptoms
|
|
946
|
-
- **Pattern Recognition**: Identifies design patterns and anti-patterns
|
|
947
|
-
|
|
948
|
-
### Advanced Context Awareness
|
|
949
|
-
|
|
950
|
-
- **Project Structure Understanding**: Maps dependencies and data flows
|
|
951
|
-
- **Change Impact Analysis**: Considers downstream effects before modifications
|
|
952
|
-
- **Historical Context**: Uses git history to understand code evolution
|
|
953
|
-
- **Cross-File Dependencies**: Tracks relationships between files
|
|
954
|
-
|
|
955
|
-
### Coding Best Practices
|
|
956
|
-
|
|
957
|
-
- **SOLID Principles**: Applies proper software design principles
|
|
958
|
-
- **Error Handling**: Structured error classification and recovery strategies
|
|
959
|
-
- **Performance Optimization**: Data structure selection and algorithm analysis
|
|
960
|
-
- **Security Best Practices**: Input validation, secure defaults, proper authentication
|
|
961
|
-
|
|
962
|
-
### Multi-Step Planning
|
|
963
|
-
|
|
964
|
-
- **Task Breakdown**: Decomposes large features into atomic steps
|
|
965
|
-
- **Dependency Mapping**: Identifies prerequisites and execution order
|
|
966
|
-
- **Milestone Definition**: Sets intermediate validation points
|
|
967
|
-
- **Rollback Planning**: Plans for failure scenarios and recovery
|
|
968
|
-
|
|
969
|
-
## ๐ Safety Features
|
|
970
|
-
|
|
971
|
-
- **Loop Detection** - Stops if AI repeats the same action 3+ times
|
|
972
|
-
- **Max Iterations** - Hard limit on iterations (default: 50)
|
|
973
|
-
- **Automatic Backups** - Every edit is backed up
|
|
974
|
-
- **Revert Capability** - Can undo changes
|
|
975
|
-
- **Error Recovery** - Handles failures gracefully
|
|
976
|
-
- **Read-Before-Edit** - AI reads files before modifying
|
|
977
|
-
|
|
978
|
-
## ๐ Performance
|
|
979
|
-
|
|
980
|
-
- **Startup**: <1 second
|
|
981
|
-
- **First response**: 2-5 seconds (API latency)
|
|
982
|
-
- **Tool execution**: Instant to seconds
|
|
983
|
-
- **Memory**: ~50MB typical
|
|
984
|
-
- **Context window**: 100k tokens (smart management)
|
|
985
|
-
|
|
986
|
-
## ๐ Comparison
|
|
987
|
-
|
|
988
|
-
| Feature | XibeCode | Claude Code | Aider |
|
|
989
|
-
|---------|----------|-------------|-------|
|
|
990
|
-
| Open Source | โ
| โ | โ
|
|
|
991
|
-
| Custom API URL | โ
| โ | โ
|
|
|
992
|
-
| Smart Context | โ
| โ
| โ ๏ธ |
|
|
993
|
-
| File Editing | โ
Advanced | โ
| โ
|
|
|
994
|
-
| Cross-Platform | โ
| โ
| โ
|
|
|
995
|
-
| Loop Detection | โ
| โ
| โ |
|
|
996
|
-
| Auto Backups | โ
| โ ๏ธ | โ |
|
|
997
|
-
| Beautiful TUI | โ
| โ
| โ ๏ธ |
|
|
998
|
-
| Price | Free (your API) | $20/mo | Free |
|
|
999
|
-
|
|
1000
|
-
## ๐ค Contributing
|
|
1001
|
-
|
|
1002
|
-
Contributions welcome! Please see CONTRIBUTING.md
|
|
1003
|
-
|
|
1004
|
-
## ๐ License
|
|
1005
|
-
|
|
1006
|
-
MIT
|
|
1007
|
-
|
|
1008
|
-
## ๐ Credits
|
|
1009
|
-
|
|
1010
|
-
Built with:
|
|
1011
|
-
|
|
1012
|
-
- [@anthropic-ai/sdk](https://www.npmjs.com/package/@anthropic-ai/sdk)
|
|
1013
|
-
- [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/sdk)
|
|
1014
|
-
- [Commander.js](https://github.com/tj/commander.js/)
|
|
1015
|
-
- [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/)
|
|
1016
|
-
- [Chalk](https://github.com/chalk/chalk)
|
|
1017
|
-
- [fast-glob](https://github.com/mrmlnc/fast-glob)
|
|
1018
|
-
|
|
1019
|
-
Inspired by [Claude Code](https://www.anthropic.com/news/claude-code) and [Aider](https://github.com/paul-gauthier/aider)
|
|
1020
|
-
|
|
1021
|
-
---
|
|
1022
|
-
|
|
1023
|
-
**Made with โค๏ธ for developers who love AI-assisted coding**
|
|
1024
|
-
|
|
1025
|
-
# XibeCode
|
|
376
|
+
Apache-2.0
|