Package Exports
- xibecode
- xibecode/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (xibecode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
XibeCode - AI Coding Assistant
Production-ready autonomous coding agent powered by Claude AI
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.
đ¯ Key Features
Core Capabilities
- â Autonomous Agent Loop - AI iteratively works on tasks until completion
- â Smart Context Management - Automatically loads related files (imports, tests, configs)
- â Advanced File Editing - Search/replace, line-range edits, automatic backups
- â Cross-Platform - Works on Windows, macOS, and Linux
- â Beautiful TUI - Real-time progress, colored output, clear visualization
- â Loop Detection - Prevents infinite loops and runaway executions
- â Multiple Edit Methods - Smart edit, line-range edit, insert, revert
File Operations
- đ Read files (whole or partial for large files)
- đ Write files (create or overwrite)
- âī¸ Edit files (search/replace with automatic backups)
- âī¸ Edit specific line ranges
- âŠī¸ Revert to previous versions
- đ Search files with glob patterns
- đ List directories
- đ§ Get intelligent context (related files)
Command Execution
- ⥠Run shell commands
- đ§ Cross-platform command support
- đ Capture stdout/stderr
- â Exit code handling
đĻ Installation
From npm (Recommended)
npm install -g xibecodeFrom Source
git clone https://github.com/yourusername/xibecode
cd xibecode
npm install
npm run build
npm linkđ Quick Start
1. Set up API Key
# Interactive setup
xibecode config
# Or set directly
xibecode config --set-key YOUR_ANTHROPIC_API_KEY
# Or use environment variable
export ANTHROPIC_API_KEY=your_key_here2. Run Your First Task
xibecode run "Create a Python script that prints hello world"3. Try Interactive Chat
xibecode chatđĄ Usage
Run Command (Autonomous Mode)
The main command for autonomous coding tasks:
xibecode run [prompt] [options]Options:
-f, --file <path>- Read prompt from a file-m, --model <model>- AI model to use (default: claude-sonnet-4-5-20250929)-b, --base-url <url>- Custom API base URL-k, --api-key <key>- API key (overrides config)-d, --max-iterations <number>- Maximum iterations (default: 50)-v, --verbose- Show detailed logs
Examples:
# Simple task
xibecode run "Create a REST API with Express"
# From file
xibecode run --file task.txt
# With verbose logging
xibecode run "Fix the bug in app.js" --verbose
# Using specific model
xibecode run "Optimize this code" --model claude-opus-4-5-20251101
# Custom API endpoint
xibecode run "task" --base-url https://custom-api.comChat Command (Interactive Mode)
For quick questions and iterative development:
xibecode chat [options]Options:
-m, --model <model>- AI model to use-b, --base-url <url>- Custom API base URL-k, --api-key <key>- API key
Commands in chat:
tools on/off- Toggle tool executionclear- Clear screenexitorquit- Exit chat
Example:
$ xibecode chat
You: How do I implement JWT authentication?
Assistant: [explains JWT auth]
You: Write the code for it
Assistant: [writes code using tools]
You: Add it to my Express app
Assistant: [modifies app.js]Config Command
Manage your configuration:
# Interactive setup
xibecode config
# Quick operations
xibecode config --set-key YOUR_KEY
xibecode config --set-url https://custom-api.com
xibecode config --set-model claude-opus-4-5-20251101
xibecode config --show
xibecode config --resetđ¨ What Makes XibeCode Different
1. Smart Context Management
XibeCode automatically understands your project:
xibecode run "Add error handling to userController.js"The AI will:
- Read
userController.js - Find and read imported files
- Check for related test files
- Look at config files (package.json, tsconfig.json)
- Make informed edits with full context
2. Advanced File Editing
Three ways to edit files:
Search/Replace (Most Reliable)
{
tool: "edit_file",
path: "app.js",
search: "const port = 3000;",
replace: "const port = process.env.PORT || 3000;"
}Line Range (For Large Files)
{
tool: "edit_lines",
path: "app.js",
start_line: 10,
end_line: 15,
new_content: "// Updated code here"
}Insert (Add New Code)
{
tool: "insert_at_line",
path: "app.js",
line: 5,
content: "const express = require('express');"
}3. Automatic Backups & Revert
Every edit creates a backup. Made a mistake?
xibecode run "Revert app.js to previous version"4. Cross-Platform
Works identically on:
- â Windows (PowerShell)
- â macOS (bash/zsh)
- â Linux (bash)
The AI automatically uses the right commands for your OS.
5. Beautiful Real-Time UI
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â XibeCode AI Agent â
â Autonomous Coding Assistant v1.0.0 â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
đ Task:
Create a REST API with Express
âī¸ Configuration:
Model: claude-sonnet-4-5-20250929
Max Iterations: 50
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Iteration 1/50 (2%) - 0.5s
ââââââââââââââââââââââââââââââ
đ read_file
â package.json
â Success
â 25 lines
đ write_file
â src/server.js
â Success
â File created (45 lines)
đŦ Assistant:
I've created an Express server with the following endpoints...đ ī¸ Advanced Features
Custom API Endpoints
Use with Azure, AWS Bedrock, or custom Claude deployments:
# Via config
xibecode config --set-url https://your-custom-endpoint.com
# Via command
xibecode run "task" --base-url https://your-custom-endpoint.comWorking with Large Files
For files >1000 lines, read in chunks:
xibecode run "Fix the bug around line 500 in large-file.js"The AI will:
- Read lines 450-550 (context around the area)
- Make targeted edit using line numbers
- Verify the change
Project Context Understanding
xibecode run "Understand this project structure and suggest improvements"The AI will use get_context to:
- Map import relationships
- Find test files
- Read configs
- Build a mental model
Error Recovery
If something fails, the AI will:
- Read the error message
- Analyze what went wrong
- Try a different approach
- Can revert changes if needed
đ Usage Examples
Build a Feature
xibecode run "Add user authentication to the Express API:
- POST /auth/register
- POST /auth/login
- JWT token generation
- Middleware to protect routes
- Hash passwords with bcrypt"Fix a Bug
xibecode run "The tests in test/user.test.js are failing.
Debug and fix the issues." --verboseRefactor Code
xibecode run "Refactor src/ to use TypeScript:
- Convert all .js files to .ts
- Add type annotations
- Create types.ts for shared types
- Update tsconfig.json"Generate Tests
xibecode run "Write comprehensive tests for userController.js:
- Test all endpoints
- Test error cases
- Use Jest
- Achieve >80% coverage"âī¸ Configuration
XibeCode stores config in ~/.xibecode/
Available Settings
{
"apiKey": "sk-ant-...", // Your Anthropic API key
"baseUrl": "https://...", // Custom API endpoint (optional)
"model": "claude-sonnet-4-5-...", // Default model
"maxIterations": 50, // Default max iterations
"defaultVerbose": false // Default verbose mode
}Environment Variables
ANTHROPIC_API_KEY=your_key # API key
ANTHROPIC_BASE_URL=https://... # Custom endpoint
XIBECODE_MODEL=claude-opus-4-... # Default modelConfig priority: CLI flags > Environment > Config file
đ Safety Features
- Loop Detection - Stops if AI repeats the same action 3+ times
- Max Iterations - Hard limit on iterations (default: 50)
- Automatic Backups - Every edit is backed up
- Revert Capability - Can undo changes
- Error Recovery - Handles failures gracefully
- Read-Before-Edit - AI reads files before modifying
đ Performance
- Startup: <1 second
- First response: 2-5 seconds (API latency)
- Tool execution: Instant to seconds
- Memory: ~50MB typical
- Context window: 100k tokens (smart management)
đ Comparison
| Feature | XibeCode | Claude Code | Aider |
|---|---|---|---|
| Open Source | â | â | â |
| Custom API URL | â | â | â |
| Smart Context | â | â | â ī¸ |
| File Editing | â Advanced | â | â |
| Cross-Platform | â | â | â |
| Loop Detection | â | â | â |
| Auto Backups | â | â ī¸ | â |
| Beautiful TUI | â | â | â ī¸ |
| Price | Free (your API) | $20/mo | Free |
đ¤ Contributing
Contributions welcome! Please see CONTRIBUTING.md
đ License
MIT
đ Credits
Built with:
Inspired by Claude Code and Aider
Made with â¤ī¸ for developers who love AI-assisted coding