Skip to content

feat(crush): add installer for Charm's AI coding assistant#1064

Open
ogormans-deptstack wants to merge 7 commits intowebinstall:mainfrom
ogormans-deptstack:feat-crush
Open

feat(crush): add installer for Charm's AI coding assistant#1064
ogormans-deptstack wants to merge 7 commits intowebinstall:mainfrom
ogormans-deptstack:feat-crush

Conversation

@ogormans-deptstack
Copy link
Copy Markdown

@ogormans-deptstack ogormans-deptstack commented Mar 18, 2026

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, and pkg_done_message
  • crush/install.ps1 — Full Windows PowerShell installer following the _example/install.ps1 template (download, extract, move, copy)
  • crush/README.md — Concise cheat sheet following webi conventions
  • crush/SKILL.md — Agent-focused documentation (per coolaj86's request)
  • test/install.sh — Added crush to all 3 test manifest lists

Testing

Shell (install.sh)

  • shellcheck crush/install.sh — passes (SC2034 pragma for webi framework variables)
  • shfmt formatting — compliant (-i 4 -sr -ci -s)
  • prettier — all markdown and JS files formatted

PowerShell (install.ps1)

Tested via Docker container using mcr.microsoft.com/powershell:7.4-alpine-3.20 with the actual Windows x86_64 release zip from GitHub:

=== Crush install.ps1 Test Harness ===
Downloading crush from .../crush_0.51.1_Windows_x86_64.zip
Installing crush
Unpacking .../crush_0.51.1_Windows_x86_64.zip
Install Location: .../crush-v0.51.1/bin/crush.exe
Copying into '.../bin/crush.exe' from '.../crush-v0.51.1/bin/crush.exe'
--- install.ps1 completed successfully ---

=== Verification ===
  [PASS] Binary in versioned opt dir
  [PASS] Binary copied to bin dir
  [PASS] Download cached
  [INFO] Binary size: 63 MB

=== ALL CHECKS PASSED ===

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
  • Filters: .tar.gz/.zip + underscore naming + no nightly + no sbom
  • Verified: 10 normalized releases with correct darwin/linux/freebsd/windows/android coverage

Addresses Review Feedback

  • @detox-24: Fixed crush-*crush_* underscore glob in both install.sh and install.ps1 ✅
  • @detox-24: Restored full install.ps1 template boilerplate (was causing silent Windows failure) ✅
  • @detox-24: Added completions + manpage extraction from release archive ✅
  • @coolaj86: Added SKILL.md ✅

Implementation Notes

  • Goreleaser archive structure: crush_VERSION_OS_arch/{crush,completions/,manpages/,LICENSE.md,README.md}
  • Completions installed to standard XDG locations (bash-completion, zsh site-functions, fish completions)
  • Manpage installed to ~/.local/share/man/man1/

Related

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 github.js helper returns already-normalized releases (one per asset),
so filtering must happen at all.releases level, not rel.assets.

Additionally, filter to only goreleaser binary archives (with underscores)
to exclude the source tarball (crush-VERSION.tar.gz).
@coolaj86
Copy link
Copy Markdown
Member

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.

Add comprehensive agent-focused documentation including:
- When to use crush vs alternatives
- LSP integration guide
- MCP extension configuration
- Session management workflows
- Key bindings and troubleshooting
- Comparison table with OpenCode and Cursor

Addresses maintainer feedback from PR review.
@ogormans-deptstack
Copy link
Copy Markdown
Author

✅ Added crush/SKILL.md with comprehensive agent-focused documentation including:

  • When to use crush vs alternatives (OpenCode, Cursor)
  • LSP integration guide with language server setup
  • MCP (Model Context Protocol) extension configuration
  • Session management workflows
  • Key bindings reference
  • Troubleshooting guide
  • Comparison tables

Also proactively added opencode/SKILL.md to PR #1063 following the same pattern.

The SKILL.md files are designed to help AI agents understand when and how to use these tools effectively. Ready for review! 🎉

Comment thread crush/install.sh Outdated

# mv ./crush-*/* "$HOME/.local/opt/crush-v0.50.1/bin/"
# (goreleaser puts binaries in a subdirectory)
mv ./crush-*/"$pkg_cmd_name" "$pkg_src_cmd"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crush/install.ps1 Outdated

# 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 {
Copy link
Copy Markdown
Member

@detox-24 detox-24 Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

@detox-24 detox-24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installers have a minor path issue, kindly fix it.

- Crush releases use underscore format: crush_VERSION_OS_arch/
- Changed glob pattern from crush-*/ to crush_*/
- Addresses feedback from @detox-24
@ogormans-deptstack
Copy link
Copy Markdown
Author

Fixed in commit 21ed585

Thanks @detox-24 for catching this!

Changes:

  • Updated subdirectory glob pattern from crush-*/ to crush_*/
  • Crush releases use underscore format: crush_VERSION_OS_arch/ (not hyphens)
  • Updated comment to clarify the correct format

The install.sh now correctly navigates the goreleaser subdirectory structure. Tested locally - mv command finds the binary correctly! 🎉

@detox-24
Copy link
Copy Markdown
Member

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.md

Crush provides completions and a man-page file packed within the releases.
Now webi won't handle shell configs and man-pages, which are clearly out of our scope.

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 :) ]

@detox-24
Copy link
Copy Markdown
Member

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 ps1 installer. It would be nice to have them back.

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.
- install.sh: add shellcheck pragma, move set -e/-u to top level,
  trim pkg_done_message to single line
- releases.js: simplify filter to 4 conditions (tar.gz/zip + underscore
  + no nightly + no sbom), remove redundant extension checks
- README.md: rewrite to match webi cheat-sheet style (~75 lines),
  fix tagline from marketing copy to functional description,
  document new completion/manpage file paths
- SKILL.md: include prettier formatting fixes
- test/install.sh: add crush to all 3 test manifest lists (P0 per
  CONTRIBUTING.md)
- Tested: shellcheck clean, shfmt compliant, prettier formatted,
  releases.js returns correct OS/arch/ext for all platforms
@ogormans-deptstack
Copy link
Copy Markdown
Author

Pushed two commits addressing all outstanding feedback:

9f96f6d — install.ps1 rewrite + completions/manpage support

  • @detox-24: Rewrote install.ps1 from scratch following the _example/install.ps1 template. The old version was missing the download/extract/copy boilerplate which caused the silent failure you found. Also fixed crush-*crush_* glob.
  • Added completions (bash/zsh/fish) and manpage extraction to install.sh from the goreleaser archive, following the pattern from sd and yq.

344baee — polish for merge

  • Added shellcheck pragma, ran all formatters (prettier, shfmt, shellcheck all clean)
  • Simplified releases.js filter (4 conditions, removed redundant extension checks)
  • Rewrote README.md to match webi cheat-sheet conventions (~75 lines, practical tasks)
  • Added crush to test/install.sh manifest (all 3 lists)

Testing: Validated the install.ps1 end-to-end in a Docker container (mcr.microsoft.com/powershell:7.4-alpine-3.20) against the actual Windows x86_64 release zip — all checks passed. See updated PR description for full test output.

@detox-24 re: your suggestion about printing post-install instructions for completions — I went with a minimal pkg_done_message since the goreleaser-style tools in the repo don't typically use verbose output. The completion/manpage paths are documented in the README instead. Let me know if you'd prefer more detail printed at install time.

Ready for re-review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants