Skip to content

Commit 96616a4

Browse files
author
Frederik Wystup
committed
feat(ai): add Crush multi-model AI coding agent to toolset
This commit introduces Crush, a new multi-model AI coding agent that enhances the existing suite of AI tools. The Crush tool supports in-session model switching, session management for context preservation, and LSP integration for improved code understanding. Key changes include: - Installation of the Crush CLI via npm in the Dockerfile. - Updated setup scripts to include Crush in the initialization process. - Addition of detailed documentation outlining Crush's features, setup instructions, and usage examples. These updates aim to provide developers with more flexibility in managing AI interactions, allowing them to switch between multiple models seamlessly while maintaining contextual awareness across sessions.
1 parent c9ba5b1 commit 96616a4

4 files changed

Lines changed: 204 additions & 16 deletions

File tree

code-server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
3838
RUN pip3 install --break-system-packages aider-chat
3939

4040
# Install Node.js AI tools (first install most tools, then OpenAI Codex separately)
41-
RUN npm install -g @google/gemini-cli @anthropic-ai/claude-code @qwen-code/qwen-code@latest
41+
RUN npm install -g @google/gemini-cli @anthropic-ai/claude-code @qwen-code/qwen-code@latest @charmland/crush
4242

4343
# Install OpenAI Codex with environment variables to use system ripgrep
4444
ENV VSCODE_RIPGREP_BINARY_PATH=/usr/bin/rg

code-server/setup-scripts/workspace-init.sh

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ echo " • Gemini CLI - Google's AI coding assistant (pre-installed)"
105105
echo " • Claude Code - Anthropic's AI coding tool (pre-installed)"
106106
echo " • Qwen Code - AI workflow automation tool (pre-installed)"
107107
echo " • OpenAI Codex - OpenAI's coding assistant (pre-installed)"
108+
echo " • Crush - Multi-model AI coding agent (pre-installed)"
108109
echo ""
109110
echo "⚡ Setup Commands:"
110111
echo " • setup_ai_tools - See all AI tool setup instructions"
111-
echo " • setup_opencode, setup_aider, setup_gemini, setup_claude, setup_qwen, setup_codex"
112+
echo " • setup_opencode, setup_aider, setup_gemini, setup_claude, setup_qwen, setup_codex, setup_crush"
112113
echo ""
113114
echo "📁 Current Directory: $(pwd)"
114115
if [ -d ".git" ]; then
@@ -119,7 +120,7 @@ fi
119120
echo ""
120121
echo "🔄 Update Commands:"
121122
echo " • update_aider (pip3)"
122-
echo " • sudo update_gemini, sudo update_claude, sudo update_qwen, sudo update_codex (npm)"
123+
echo " • sudo update_gemini, sudo update_claude, sudo update_qwen, sudo update_codex, sudo update_crush (npm)"
123124
echo " • update_opencode (downloads and installs latest version)"
124125
echo ""
125126
echo "💡 Pro Tips:"
@@ -181,6 +182,16 @@ echo "✅ OpenAI Codex CLI updated successfully!"
181182
UPDATE_CODEX_EOF
182183
chmod +x /usr/local/bin/update_codex
183184

185+
# Update Crush (requires sudo)
186+
cat > /usr/local/bin/update_crush << 'UPDATE_CRUSH_EOF'
187+
#!/bin/bash
188+
echo "🔄 Updating Crush..."
189+
echo "💡 Note: Run with sudo if you get permission errors"
190+
npm update -g @charmland/crush
191+
echo "✅ Crush updated successfully!"
192+
UPDATE_CRUSH_EOF
193+
chmod +x /usr/local/bin/update_crush
194+
184195
# Update OpenCode SST
185196
cat > /usr/local/bin/update_opencode << 'UPDATE_OPENCODE_EOF'
186197
#!/bin/bash
@@ -381,6 +392,34 @@ setup_codex() {
381392
echo " - Auth docs: https://github.com/openai/codex/blob/main/docs/authentication.md"
382393
}
383394
395+
# Setup Crush
396+
setup_crush() {
397+
echo "🤖 Setting up Crush..."
398+
echo ""
399+
echo "Crush is already installed!"
400+
echo ""
401+
echo "To get started:"
402+
echo "1. Run: crush"
403+
echo "2. Configure your preferred AI provider via environment variables:"
404+
echo " • ANTHROPIC_API_KEY for Anthropic Claude"
405+
echo " • OPENAI_API_KEY for OpenAI"
406+
echo " • GEMINI_API_KEY for Google Gemini"
407+
echo " • GROQ_API_KEY for Groq"
408+
echo " • OPENROUTER_API_KEY for OpenRouter"
409+
echo ""
410+
echo "💡 Features:"
411+
echo " - Multi-model AI support with in-session switching"
412+
echo " - Session-based context management"
413+
echo " - LSP integration for code understanding"
414+
echo " - MCP support for extensibility"
415+
echo " - Cross-platform terminal interface"
416+
echo " - Permission control for tool execution"
417+
echo ""
418+
echo "📚 Learn more:"
419+
echo " - GitHub: https://github.com/charmbracelet/crush"
420+
echo " - Docs: https://github.com/charmbracelet/crush#readme"
421+
}
422+
384423
# Setup all AI tools
385424
setup_ai_tools() {
386425
echo "🚀 XaresAICoder AI Tools Setup"
@@ -422,6 +461,12 @@ setup_ai_tools() {
422461
echo "6️⃣ OpenAI Codex CLI"
423462
setup_codex
424463
echo ""
464+
echo "----------------------------------------"
465+
echo ""
466+
467+
echo "7️⃣ Crush"
468+
setup_crush
469+
echo ""
425470
echo "=============================="
426471
echo ""
427472
echo "✅ All AI tools are ready!"
@@ -433,6 +478,7 @@ setup_ai_tools() {
433478
echo " • Claude Code: Agentic coding with deep codebase understanding"
434479
echo " • Qwen Code: AI workflow automation and code exploration"
435480
echo " • OpenAI Codex: OpenAI's terminal-based coding assistant"
481+
echo " • Crush: Multi-model AI with session management and LSP integration"
436482
echo ""
437483
echo "🔌 VS Code Extensions (install from marketplace):"
438484
echo " • Continue: AI code completion and chat"
@@ -678,7 +724,7 @@ EXTENSIONS_EOF
678724
}
679725
680726
# Export all functions
681-
export -f setup_empty_project setup_opencode setup_aider setup_gemini setup_claude setup_qwen setup_codex setup_ai_tools
727+
export -f setup_empty_project setup_opencode setup_aider setup_gemini setup_claude setup_qwen setup_codex setup_crush setup_ai_tools
682728
EOF
683729

684730
echo "Workspace initialization setup completed."

docs/AI_TOOLS.md

Lines changed: 140 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ XaresAICoder provides a curated selection of AI coding assistants that work seam
2222
- **Continue** - AI code completion and chat
2323
- **Cline (Claude Dev)** - AI file editing and automation
2424

25-
**⌨️ Command Line Tools** - Terminal-based AI assistants
25+
**⌨️ Command Line Tools** - Terminal-based AI assistants
2626
- **OpenCode SST** - Multi-model AI with project analysis
2727
- **Aider** - AI pair programming with git integration
2828
- **Gemini CLI** - Google's AI for code generation
2929
- **Claude Code** - Anthropic's agentic coding tool
3030
- **Qwen Code** - AI workflow automation and code exploration
3131
- **OpenAI Codex CLI** - OpenAI's terminal-based coding assistant
32+
- **Crush** - Multi-model AI with session management
3233

3334
## VS Code Extensions
3435

@@ -392,6 +393,129 @@ mode = "workspace-write"
392393
policy = "untrusted"
393394
```
394395

396+
### Crush - Multi-Model AI Coding Agent
397+
398+
**Best for**: Multi-model flexibility, session-based workflows, cross-platform terminal coding
399+
400+
#### Features
401+
- ✅ **Multi-Model Support** - Switch between OpenAI, Anthropic, Google, Groq, OpenRouter
402+
- ✅ **Session Management** - Maintain multiple work contexts per project
403+
- ✅ **In-Session Switching** - Change models without losing conversation context
404+
- ✅ **LSP Integration** - Enhanced code understanding via Language Server Protocol
405+
- ✅ **MCP Extensibility** - Model Context Protocol support for custom tools
406+
- ✅ **Cross-Platform** - Works on all major operating systems
407+
- ✅ **Permission Control** - Approve or whitelist tool executions
408+
- ✅ **Configuration Files** - Project-specific and global settings support
409+
410+
#### Setup
411+
412+
##### Quick Setup
413+
```bash
414+
# Use the built-in setup command
415+
setup_crush
416+
```
417+
418+
##### Manual Setup
419+
```bash
420+
# Crush is pre-installed via npm
421+
422+
# Set your preferred API key (choose one or more)
423+
export ANTHROPIC_API_KEY=your_key_here
424+
export OPENAI_API_KEY=your_key_here
425+
export GEMINI_API_KEY=your_key_here
426+
export GROQ_API_KEY=your_key_here
427+
export OPENROUTER_API_KEY=your_key_here
428+
```
429+
430+
#### Usage
431+
```bash
432+
# Start interactive session
433+
crush
434+
435+
# Start or resume named session
436+
crush --session my-feature
437+
438+
# List all sessions
439+
crush --list-sessions
440+
441+
# Switch models mid-session (type in Crush)
442+
/model claude-3-5-sonnet
443+
/model gpt-4
444+
/model gemini-pro
445+
446+
# Use specific model from start
447+
crush --model anthropic/claude-3-5-sonnet-20241022
448+
```
449+
450+
#### Configuration
451+
452+
Create `.crush.json` in your project root or `~/.config/crush/crush.json` globally:
453+
454+
```json
455+
{
456+
"model": "anthropic/claude-3-5-sonnet-20241022",
457+
"temperature": 0.7,
458+
"tools": {
459+
"allowed": ["read_file", "write_file", "run_command"]
460+
},
461+
"lsp": {
462+
"enabled": true
463+
},
464+
"sessions": {
465+
"auto_save": true,
466+
"max_history": 100
467+
}
468+
}
469+
```
470+
471+
#### Example Session
472+
```bash
473+
$ crush
474+
🎀 Crush v1.0.0
475+
Using model: claude-3-5-sonnet
476+
477+
> Analyze this codebase and suggest improvements
478+
479+
[Crush analyzes files using LSP and provides suggestions]
480+
481+
> /model gpt-4
482+
Switched to model: gpt-4
483+
484+
> Implement the suggested changes
485+
[Crush makes changes with GPT-4 context preserved]
486+
487+
> /save improvement-session
488+
Session saved: improvement-session
489+
```
490+
491+
#### Key Features Explained
492+
493+
**Session Management**:
494+
- Maintain separate contexts for different features/tasks
495+
- Resume work exactly where you left off
496+
- Share sessions with team members
497+
498+
**Model Switching**:
499+
- Switch between models without losing context
500+
- Use different models for different subtasks
501+
- Cost optimization by using cheaper models when appropriate
502+
503+
**LSP Integration**:
504+
- Understands your code structure via Language Server Protocol
505+
- Better code completion and suggestions
506+
- Intelligent refactoring capabilities
507+
508+
**Permission System**:
509+
```bash
510+
# Approve each tool execution (default)
511+
crush
512+
513+
# Auto-approve all (use with caution)
514+
crush --yolo
515+
516+
# Configure approved tools in .crush.json
517+
```
518+
395519
## Setup Guide
396520

397521
### Quick Setup for All Tools
@@ -447,27 +571,29 @@ which gemini
447571
which claude
448572
which qwen-code
449573
which codex
574+
which crush
450575
451576
# Test API connections
452577
opencode auth status
453578
aider --version
454579
gemini --help
455580
qwen-code --version
456581
codex --version
582+
crush --version
457583
```
458584
459585
## Tool Comparison
460586
461587
### Use Case Matrix
462588
463-
| Task | Continue | Cline | OpenCode | Aider | Gemini | Claude Code | Qwen Code | Codex CLI |
464-
|------|----------|-------|----------|-------|--------|-------------|-----------|-----------|
465-
| **Code Completion** | ⭐⭐⭐ | ⭐ | ⭐ | ⭐ | ⭐⭐ | ⭐ | ⭐ | ⭐⭐ |
466-
| **File Editing** | ⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ |
467-
| **Project Analysis** | ⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ |
468-
| **Git Integration** | ❌ | ⭐ | ❌ | ⭐⭐⭐ | ❌ | ⭐⭐⭐ | ⭐ | ⭐ |
469-
| **Multi-File Ops** | ❌ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ |
470-
| **Learning Curve** | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐ | ⭐⭐ | ⭐⭐⭐ |
589+
| Task | Continue | Cline | OpenCode | Aider | Gemini | Claude Code | Qwen Code | Codex CLI | Crush |
590+
|------|----------|-------|----------|-------|--------|-------------|-----------|-----------|-------|
591+
| **Code Completion** | ⭐⭐⭐ | ⭐ | ⭐ | ⭐ | ⭐⭐ | ⭐ | ⭐ | ⭐⭐ | ⭐⭐ |
592+
| **File Editing** | ⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐ |
593+
| **Project Analysis** | ⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐ |
594+
| **Git Integration** | ❌ | ⭐ | ❌ | ⭐⭐⭐ | ❌ | ⭐⭐⭐ | ⭐ | ⭐ | ⭐ |
595+
| **Multi-File Ops** | ❌ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ |
596+
| **Learning Curve** | ⭐⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐ | ⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ |
471597
472598
### Model Support
473599
@@ -481,6 +607,7 @@ codex --version
481607
| **Claude Code** | ❌ | ✅ | ❌ | ❌ |
482608
| **Qwen Code** | ✅ | ❌ | ❌ | ✅ (Qwen) |
483609
| **Codex CLI** | ✅ | ❌ | ❌ | ❌ |
610+
| **Crush** | ✅ | ✅ | ✅ | ❌ |
484611
485612
## Best Practices
486613
@@ -499,10 +626,11 @@ graph TD
499626
```
500627
501628
**Recommended Combinations**:
502-
- **Beginner**: Continue + OpenCode SST + Codex CLI
503-
- **Intermediate**: Continue + Aider + Gemini CLI + Qwen Code
629+
- **Beginner**: Continue + OpenCode SST + Crush
630+
- **Intermediate**: Continue + Aider + Gemini CLI + Crush
504631
- **Advanced**: All tools based on specific needs
505-
- **Team Lead**: OpenCode SST + Claude Code + Aider + Qwen Code
632+
- **Team Lead**: OpenCode SST + Claude Code + Aider + Crush
633+
- **Multi-Model Focus**: Crush + Continue + OpenCode SST
506634
- **Performance Focus**: Qwen Code + Claude Code + Aider
507635
508636
### 2. Workflow Integration

frontend/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,20 @@ <h3>OpenAI Codex CLI</h3>
573573
<code>codex</code>
574574
</div>
575575
</div>
576+
577+
<div class="tool-card">
578+
<div class="tool-icon">
579+
<svg width="24" height="24" viewBox="0 0 16 16" fill="currentColor">
580+
<path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.75.75 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"/>
581+
</svg>
582+
</div>
583+
<h3>Crush</h3>
584+
<p>Multi-model AI with session management and LSP integration</p>
585+
<div class="tool-commands">
586+
<code>setup_crush</code>
587+
<code>crush</code>
588+
</div>
589+
</div>
576590
</div>
577591

578592
<div class="quick-setup">

0 commit comments

Comments
 (0)