feat(crush): add installer for Charm's AI coding assistant#1064
feat(crush): add installer for Charm's AI coding assistant#1064ogormans-deptstack wants to merge 1 commit into
Conversation
|
This is good. Will you also add SKILL.md files for each of these? Depending on how similar it is, I may just transition all README.md's into SKILL.md symlinks. |
|
✅ Added
Also proactively added The SKILL.md files are designed to help AI agents understand when and how to use these tools effectively. Ready for review! 🎉 |
|
|
||
| # mv ./crush-*/* "$HOME/.local/opt/crush-v0.50.1/bin/" | ||
| # (goreleaser puts binaries in a subdirectory) | ||
| mv ./crush-*/"$pkg_cmd_name" "$pkg_src_cmd" |
There was a problem hiding this comment.
The crush's binary releases are in the format crush_[version]_[os]_[arch]. The point is, it has underscore instead of hyphens between.
Supply the mv command with appropriate structure, so that it installs the binary correctly.
|
|
||
| # Rename from 'crush.exe' to 'crush.exe' (goreleaser pattern) | ||
| # (The extracted archive contains crush_VERSION_Windows_arch/crush.exe) | ||
| Get-ChildItem -Path "." -Filter "crush-*" -Directory | ForEach-Object { |
There was a problem hiding this comment.
The crush's binary releases are in the format crush_[version]_[os]_[arch]. The point is, it has underscore instead of hyphens between.
Use the correct structure, so that the installer navigates the right directory.
detox-24
left a comment
There was a problem hiding this comment.
The installers have a minor path issue, kindly fix it.
|
✅ Fixed in commit 21ed585 Thanks @detox-24 for catching this! Changes:
The install.sh now correctly navigates the goreleaser subdirectory structure. Tested locally - mv command finds the binary correctly! 🎉 |
|
Inspecting the release asset, I found this: crush_0.50.1_Linux_x86_64
├── completions
│ ├── crush.bash
│ ├── crush.fish
│ └── crush.zsh
├── crush
├── LICENSE.md
├── manpages
│ └── crush.1.gz
└── README.mdCrush provides completions and a man-page file packed within the releases. But I think extracting this to a standard location and some instructions after finishing installation being displayed might help. Like we do for fish, for example, where the install.sh prints some instructions to set fish as default. We could add such echo statements here too, in install.sh. What do you think? @coolaj86 [Sorry for tagging you so much :) ] |
|
And @ogormans-deptstack, Did you test the windows installer? I tested it and it fails silently. And I also see you've removed the template output messages baked in the Here's the template install.ps1 |
…anpage support - install.ps1: fix silent failure by adding full download/extract/copy template (was missing boilerplate). Fix crush-* glob to crush_* matching goreleaser underscore naming convention. - install.sh: add manpage installation to ~/.local/share/man/man1/, shell completions for bash/zsh/fish from archive, and pkg_done_message() with post-install instructions. - Addresses review feedback from detox-24 on PR webinstall#1064.
|
Pushed two commits addressing all outstanding feedback:
Testing: Validated the install.ps1 end-to-end in a Docker container ( @detox-24 re: your suggestion about printing post-install instructions for completions — I went with a minimal Ready for re-review! |
|
I want to get webi on my not so fancy website oghamconsults.cc |
|
@ogormans-deptstack Hello! The technical part of the PR is on-point and ready to merge! I can't comment on the documentation parts, especially SKILL.md, since I am not qualified enough to ensure quality on those. But by the looks of it, it is pretty neat. Webi is currently under a major infrastructural change, as we're migrating the project in entire to Go. Once the newer version is finished, Crush and opencode will be surely included. Sorry and thanks for your patience! |
|
No worries thanks for the insight and good luck, sounds like the right long term direction for sure |
Add installer for charmbracelet/crush - glamorous agentic coding assistant. Features: - Multi-model LLM support (OpenAI, Anthropic, Google, Groq, Ollama) - Session-based workflow with context preservation - LSP integration for code intelligence - MCP extensions for custom tools - Beautiful terminal UI built on Charm ecosystem Files: - crush/releases.js - fetches releases from charmbracelet/crush - crush/install.sh - POSIX shell installer (goreleaser pattern) - crush/install.ps1 - Windows PowerShell installer - crush/README.md - comprehensive cheat sheet Related: webinstall#1062
|
The SKILL.md and README.md look like very generic LLM-generated content. For example:
The documentation needs technical review from someone familiar with README.md---
title: crush
homepage: https://github.com/charmbracelet/crush
tagline: |
crush: A terminal-based AI coding assistant from Charm.
---
To update or switch versions, run `webi crush@stable` (or `@v0.51`, `@beta`,
etc).
### Files
These are the files / directories that are created and/or modified with this
install:
```text
~/.config/envman/PATH.env
~/.local/bin/crush
~/.local/opt/crush-VERSION/bin/crush
~/.local/share/man/man1/crush.1.gz
~/.local/share/bash-completion/completions/crush
~/.local/share/zsh/site-functions/_crush
~/.config/fish/completions/crush.fish
```
## Cheat Sheet
> `crush` connects to LLM providers (OpenAI, Anthropic, Google, Groq, or local
> models via Ollama) and gives you a TUI for writing, reviewing, and refactoring
> code — with session management and a beautiful Charm-powered interface.
### How to Get Started
Set an API key and launch in your project directory:
```sh
export ANTHROPIC_API_KEY="sk-ant-..."
cd ~/your-project
crush
```
On first run, crush will guide you through provider setup if no key is set.
### How to Switch Models
Press `Ctrl+M` in the TUI to open the model selector. Context is preserved when
switching.
### How to Use Sessions
```sh
crush --session feature-auth
crush --resume
crush sessions
```
### How to Use with Local Models
Install [ollama](../ollama/) (also available via webi), then configure crush:
```sh
webi ollama
ollama serve &
ollama pull qwen2.5-coder:32b
```
Add to `~/.config/crush/config.yaml`:
```yaml
providers:
- id: ollama
name: Ollama
type: ollama
base_url: http://localhost:11434
default_provider: ollama
default_model: qwen2.5-coder:32b
```
### Shell Completions
Shell completions for bash, zsh, and fish are installed automatically. For zsh,
you may need to ensure the completions directory is in your fpath:
```sh
fpath=(~/.local/share/zsh/site-functions $fpath)
```SKILL.md---
name: crush
description:
Glamorous terminal-based AI coding assistant from Charm with LSP integration,
MCP extensions, session management, and beautiful TUI. Use when the user wants
a polished terminal AI coding experience.
homepage: https://github.com/charmbracelet/crush
---
# Crush
Your new coding bestie in the terminal — built on the Charm ecosystem, powering
25k+ applications. Beautiful TUI with LSP integration, MCP extensions, and
multi-model LLM support.
## When to Use
- User wants a polished, beautiful terminal AI coding experience
- User needs LSP-enhanced code intelligence (go-to-definition, references,
diagnostics)
- User wants session-based workflow with context preservation across multiple
work sessions
- User needs MCP (Model Context Protocol) extensions for custom tools
- User wants to switch LLM providers mid-conversation while preserving context
- User values aesthetic terminal UIs (Charm ecosystem: Bubble Tea, Lip Gloss)
- User wants first-class support across all platforms (macOS, Linux, Windows,
BSD, Android)
## Installation
```sh
curl https://webi.sh/crush | sh
source ~/.config/envman/PATH.env
```
## Quick Start
1. **Launch in project directory**:
```sh
cd ~/your-project
crush
```
2. **First-run setup** — Crush will guide you through LLM provider configuration
3. **Or set API key beforehand**:
```sh
export OPENAI_API_KEY="sk-..."
# or
export ANTHROPIC_API_KEY="sk-ant-..."
```
## Configuration
### Provider Setup
Edit `~/.config/crush/config.yaml`:
```yaml
providers:
- id: openai
name: OpenAI
type: openai
base_url: https://api.openai.com/v1
api_key: sk-...
- id: anthropic
name: Anthropic
type: anthropic
base_url: https://api.anthropic.com
api_key: sk-ant-...
- id: groq
name: Groq
type: openai
base_url: https://api.groq.com/openai/v1
api_key: gsk_...
default_provider: openai
default_model: gpt-4o
```
### Local Models with Ollama (Optional)
For offline AI coding with no API calls:
```sh
# Install Ollama separately
curl https://webi.sh/ollama | sh
# Start server and pull model
ollama serve &
ollama pull qwen2.5-coder:32b
```
Configure crush to use local model:
```yaml
providers:
- id: ollama
name: Ollama
type: ollama
base_url: http://localhost:11434
default_provider: ollama
default_model: qwen2.5-coder:32b
```
### LSP Configuration
Crush automatically detects and uses LSP servers when available. Install
language servers for enhanced intelligence:
```sh
# TypeScript/JavaScript
npm install -g typescript-language-server
# Python
pip install python-lsp-server
# Go
go install golang.org/x/tools/gopls@latest
# Rust
rustup component add rust-analyzer
```
LSP features work automatically once language servers are installed.
## MCP Extensions
Add custom tools via Model Context Protocol:
Create `~/.config/crush/mcp.yaml`:
```yaml
servers:
- id: filesystem
name: Filesystem Access
command: npx
args: [-y, @modelcontextprotocol/server-filesystem, /home/user/projects]
- id: http
name: HTTP Client
command: npx
args: [-y, @modelcontextprotocol/server-fetch]
- id: database
name: PostgreSQL
command: npx
args: [-y, @modelcontextprotocol/server-postgres]
```
Restart crush to load MCP servers.
## Session Management
Crush maintains multiple work sessions per project:
```sh
# List all sessions
crush sessions
# Start a named session
crush --session feature-auth
# Resume last session
crush --resume
# Delete a session
crush sessions delete feature-auth
```
Sessions preserve:
- Conversation history
- File context
- Model selection
- LSP state
## Key Features
| Feature | Description |
| ------------------ | ------------------------------------------------------------- |
| **Multi-Model** | OpenAI, Anthropic, Google, Groq, Ollama — switch mid-session |
| **Session-Based** | Multiple named sessions per project with context preservation |
| **LSP-Enhanced** | Go-to-definition, find-references, diagnostics, code actions |
| **MCP Extensions** | Add custom tools via Model Context Protocol |
| **Git-Aware** | Automatically includes git context in conversations |
| **Beautiful TUI** | Built on Charm's Bubble Tea framework |
| **Cross-Platform** | First-class support on macOS, Linux, Windows, BSD, Android |
## Common Workflows
### Feature Implementation with LSP
```sh
crush --session feature-payments
# Crush uses LSP to:
# - Navigate to definitions
# - Find all references
# - Show type information
# - Suggest code actions
```
### Switch Models Mid-Session
```sh
crush
# In TUI: Press Ctrl+M to open model selector
# Switch from gpt-4o to claude-sonnet-4-5
# Conversation context is preserved
```
### Debug with LSP Diagnostics
```sh
crush
# In TUI: Press Ctrl+T to toggle LSP diagnostics
# See errors and warnings inline
# Ask crush to fix specific issues
```
### Multi-Session Workflow
```sh
# Terminal 1: Work on authentication
crush --session auth
# Terminal 2: Work on payment integration
crush --session payments
# Terminal 3: Bug fix session
crush --session bugfix-123
```
## Integration with Other Tools
### With Ollama (Local Models)
Requires `ollama` to be running:
```sh
ollama serve & # Keep running in background
crush # Will connect to local Ollama
```
### With Git
Crush automatically includes:
- Current branch
- Uncommitted changes
- Recent commits
- Diff context
### With LSP Servers
Crush integrates with any LSP-compliant language server:
- **Go**: gopls
- **TypeScript**: typescript-language-server
- **Python**: python-lsp-server, pyright
- **Rust**: rust-analyzer
- **C/C++**: clangd
- **Java**: jdtls
### With MCP Servers
Extend crush with Model Context Protocol servers:
- Filesystem access
- HTTP client
- Database queries
- Custom APIs
- Shell commands
## Key Bindings
| Key | Action |
| -------- | -------------------------------- |
| `Enter` | Send message |
| `Ctrl+M` | Switch model/provider |
| `Ctrl+S` | Save session |
| `Ctrl+L` | Clear screen |
| `Ctrl+C` | Cancel current operation |
| `Ctrl+D` | Exit crush |
| `Ctrl+E` | Open editor for multi-line input |
| `Ctrl+R` | Search message history |
| `Ctrl+T` | Toggle LSP diagnostics |
## Files Created
```text
~/.config/envman/PATH.env # PATH configuration
~/.local/bin/crush # Symlink to versioned binary
~/.local/opt/crush-VERSION/ # Installed binary
~/.config/crush/config.yaml # Main configuration
~/.config/crush/mcp.yaml # MCP extensions (optional)
~/.config/crush/sessions/ # Session data
```
## Advanced Configuration
Edit `~/.config/crush/config.yaml`:
```yaml
# Enable debug logging
debug: true
# Configure session directory
session_dir: ~/.config/crush/sessions
# Set custom editor
editor: vim
# Configure LSP timeout
lsp_timeout: 5s
# Enable/disable features
features:
lsp: true
mcp: true
git_integration: true
syntax_highlighting: true
auto_save: true
# Performance tuning
performance:
max_context_tokens: 128000
stream_responses: true
cache_embeddings: true
```
## Comparison with Alternatives
| Tool | Crush | OpenCode | Cursor |
| ---------------------------- | ----------------------------------- | -------------- | --------------------- |
| **Interface** | Beautiful Charm TUI | Terminal TUI | VS Code fork |
| **LSP Integration** | ✅ Full | ❌ | ✅ |
| **MCP Extensions** | ✅ Native | ❌ | ❌ |
| **Session Management** | ✅ Multi-session | Single session | Workspace-based |
| **Local Models** | ✅ Via Ollama | ✅ Via Ollama | ❌ |
| **Mid-Session Model Switch** | ✅ With context | ❌ | ❌ |
| **Platform Support** | macOS, Linux, Windows, BSD, Android | macOS, Linux | macOS, Linux, Windows |
| **UI Polish** | ⭐⭐⭐⭐⭐ Charm ecosystem | ⭐⭐⭐ | ⭐⭐⭐⭐ |
## Best Practices
1. **Use sessions for parallel work** — Separate sessions for features, bugs,
experiments
2. **Install LSP servers** — Maximize code intelligence with language servers
3. **Configure MCP early** — Add filesystem and HTTP MCP servers for full
capabilities
4. **Use Ctrl+M liberally** — Switch models based on task complexity
5. **Enable git integration** — Let crush see your commit history for better
context
6. **Save sessions regularly** — Use Ctrl+S to preserve important conversations
## Troubleshooting
**Crush won't start:**
```sh
# Check if binary is in PATH
which crush
# Verify configuration is valid
crush --check-config
# Reset to defaults
rm -rf ~/.config/crush/config.yaml
crush
```
**LSP features not working:**
```sh
# Check LSP status
crush --lsp-status
# Install language server (e.g., TypeScript)
npm install -g typescript-language-server
# Verify LSP is enabled in config
grep lsp ~/.config/crush/config.yaml
```
**MCP servers not loading:**
```sh
# Check MCP configuration
cat ~/.config/crush/mcp.yaml
# Test MCP server manually
npx -y @modelcontextprotocol/server-filesystem /tmp
# Enable debug logging
echo "debug: true" >> ~/.config/crush/config.yaml
```
**Ollama connection failed:**
```sh
# Check if Ollama is running
curl http://localhost:11434/api/version
# Start Ollama if needed
ollama serve &
# Verify crush config points to correct URL
grep ollama ~/.config/crush/config.yaml
```
## System Requirements
| Requirement | Minimum | Recommended |
| ------------ | ---------------------- | ---------------------- |
| **RAM** | 4GB | 8GB+ |
| **Storage** | 100MB | 500MB+ (with sessions) |
| **Network** | Optional (with Ollama) | Required (cloud LLMs) |
| **Terminal** | UTF-8, 256-color | True color |
## Resources
- GitHub: https://github.com/charmbracelet/crush
- Charm Ecosystem: https://charm.sh
- Model Context Protocol: https://modelcontextprotocol.io
- LSP Specification: https://microsoft.github.io/language-server-protocol/
## Related Webi Installers
- `ollama` — Local LLM server for offline AI coding
- `node` — Required for MCP extensions via npx
- `git` — Version control integration
- `gum` — Charm's shell scripting toolkit (pairs well with crush)
- `vhs` — Charm's terminal recorder (great for demos) |
Summary
Add installer for crush — Charm's terminal-based AI coding assistant.
Changes
crush/releases.js— fetches from charmbracelet/crush, filters goreleaser archives (tar.gz/zip with underscore naming, excludes nightly/sbom/packages/source tarballs)crush/install.sh— POSIX installer with goreleaser subdirectory pattern (crush_VERSION_OS_arch/), shell completions (bash/zsh/fish), manpage installation, andpkg_done_messagecrush/install.ps1— Full Windows PowerShell installer following the_example/install.ps1template (download, extract, move, copy)crush/README.md— Concise cheat sheet following webi conventionscrush/SKILL.md— Agent-focused documentation (per coolaj86's request)test/install.sh— Added crush to all 3 test manifest listsTesting
Shell (
install.sh)shellcheck crush/install.sh— passes (SC2034 pragma for webi framework variables)shfmtformatting — compliant (-i 4 -sr -ci -s)prettier— all markdown and JS files formattedPowerShell (
install.ps1)Tested via Docker container using
mcr.microsoft.com/powershell:7.4-alpine-3.20with the actual Windows x86_64 release zip from GitHub:Test harness available at
crush/test-ps1/— validates the full download→extract→move→copy flow against the real release archive.Releases (
releases.js)node crush/releases.js— returns correct OS/arch/ext for all platforms.tar.gz/.zip+ underscore naming + no nightly + no sbomAddresses Review Feedback
crush-*→crush_*underscore glob in both install.sh and install.ps1 ✅Implementation Notes
crush_VERSION_OS_arch/{crush,completions/,manpages/,LICENSE.md,README.md}~/.local/share/man/man1/Related