Repository navigation
Install Grok through mise's first-party registry - #7247
haydenmckay wants to merge 2 commits into
Conversation
mise now ships a grok backend, so the lazy stub and default-agent installer can use `mise use -g grok` like claude and codex. The npm package name made that fail unless you pasted a custom tool definition, which is how people ended up on the x.ai curl installer instead.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR migrates Grok CLI installation to mise’s first-party grok backend, adds a migration to clean up legacy Grok installs, and updates docs/tests/UI text to match.
Changes:
- Switch Grok installation from
npm:@xai-official/grokto mise registrygrok - Add a migration to install Grok via mise and remove legacy wrappers / installer artifacts
- Update manual, menu copy, and shell tests to reflect the new Grok install path
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/shell.d/default-agent-test.sh | Updates assertions and adds coverage for the new Grok registry migration behavior |
| migrations/1786956325.sh | New migration to install Grok via mise registry and remove legacy Grok wrapper / agent symlink |
| manual/17-ai.md | Updates Grok CLI documentation to recommend mise registry path and warn against the curl installer |
| install/user/mise.sh | Switches default Grok install to omarchy-mise-install grok |
| default/omarchy/omarchy-menu.jsonc | Clarifies “Grok Bot” is a desktop chat app, not the CLI |
| bin/omarchy-default-agent | Removes explicit npm package mapping for Grok |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| agent_target=$(readlink -f "$HOME/.local/bin/agent" || true) | ||
| if [[ $agent_target == "$HOME/.grok/"* ]]; then |
There was a problem hiding this comment.
Taken. readlink -f misses the leftover once ~/.grok/bin is gone; the migration now uses the raw readlink target (and the test covers a dangling link).
| @@ -0,0 +1,19 @@ | |||
| echo "Install Grok through mise's first-party registry" | |||
There was a problem hiding this comment.
Leaving this. Omarchy migrations are required to start with an echo describing the change — that line is the progress output in omarchy update, same as migrations/1785846769.sh.
| if [[ ! -f $HOME/.local/state/omarchy/preinstalls-removed ]]; then | ||
| omarchy-mise-install grok | ||
| elif [[ -f $HOME/.local/bin/grok ]] && grep -Fq 'npm:@xai-official/grok' "$HOME/.local/bin/grok"; then | ||
| rm -f "$HOME/.local/bin/grok" | ||
| fi | ||
|
|
||
| # The website installer also drops an `agent` symlink into ~/.local/bin. | ||
| if [[ -L $HOME/.local/bin/agent ]]; then | ||
| agent_target=$(readlink -f "$HOME/.local/bin/agent" || true) | ||
| if [[ $agent_target == "$HOME/.grok/"* ]]; then | ||
| rm -f "$HOME/.local/bin/agent" |
There was a problem hiding this comment.
Leaving this. Nearby migrations inline $HOME/.local/... paths; extracting locals in a 20-line one-shot does not match that style.
readlink -f fails once ~/.grok/bin is gone, so the migration would leave the leftover ~/.local/bin/agent link in place.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (2)
migrations/1786956325.sh:19
- This migration is sourced, so
agent_targetbecomes a global variable in the caller’s shell environment and can accidentally clobber an existing variable. Consider using a more uniquely-scoped name (e.g. prefixing withomarchy_), and/orunsetit after use to avoid leaking state from the migration.
if [[ -L $HOME/.local/bin/agent ]]; then
agent_target=$(readlink "$HOME/.local/bin/agent" || true)
if [[ $agent_target == "$HOME/.grok/"* || $agent_target == *'/.grok/'* ]]; then
rm -f "$HOME/.local/bin/agent"
migrations/1786956325.sh:18
- The migration repeats long, specific filesystem paths inline. Defining variables like
preinstalls_removed_file=\"$HOME/.local/state/omarchy/preinstalls-removed\"andgrok_wrapper=\"$HOME/.local/bin/grok\"would reduce duplication and make future edits less error-prone (e.g., if the state/bin locations change).
if [[ ! -f $HOME/.local/state/omarchy/preinstalls-removed ]]; then
omarchy-mise-install grok
elif [[ -f $HOME/.local/bin/grok ]] && grep -Fq 'npm:@xai-official/grok' "$HOME/.local/bin/grok"; then
rm -f "$HOME/.local/bin/grok"
fi
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
migrations/1786956325.sh:17
- The
agentsymlink cleanup can miss relative symlink targets like.grok/bin/agentbecause the match only covers$HOME/.grok/...or paths containing/.grok/. Consider normalizing the target to an absolute path (e.g., via a non-resolving normalization likerealpath -m), or broadening the pattern to also match targets containing.grok/without requiring a leading slash.
if [[ -L $HOME/.local/bin/agent ]]; then
agent_target=$(readlink "$HOME/.local/bin/agent" || true)
if [[ $agent_target == "$HOME/.grok/"* || $agent_target == *'/.grok/'* ]]; then
rm -f "$HOME/.local/bin/agent"
fi
|
Hit another path of the same fight on Omarchy 4.0.1-1, still on the shipped The stub is After that, mise can hold the 1.0.13 package while Switching to first-party #7101 is the inverse (Omarchy |
|
Another data point for this, on Omarchy 4.0.3-1 / mise 2026.9.1. The stale canonical binary @shawnyeager described happens even when nothing fails:
Switching locally to the first-party tool ( |
Why
Omarchy already treats Grok like Claude and Codex: a lazy mise stub in
~/.local/bin/grok, plus Setup → Defaults → Agent → Grok. First run ofgrokis supposed to download the CLI. That is the install path. There is no Install → AI row for coding-agent CLIs on purpose (Crush was removed from that menu).This PR is not “add Grok because it was missing.” Typing
grokis the intended fix for “I want the Grok CLI.”What is wrong:
Wrong mise package name. The stub and
omarchy-default-agent grokcalledmise use -g npm:@xai-official/grok. mise now has a first-partygrokbackend (http:grok).mise use -g groktherefore does not install the same tool Omarchy wired up. Anyone following mise/xAI docs pastes a custom HTTP tool definition, or runs the website installer.The x.ai
curl | bashinstaller fights Omarchy. It writes~/.grok/bin, prepends that onPATH, and overwrites~/.local/bin/grok(plus anagentsymlink). After that, mise is no longer whatgrokruns. Easy to hit if you look at x.ai instead of typinggrok.Grok Bot is easy to mistake for the CLI. Install → AI only offers Grok Bot (desktop chat). Someone looking for “install Grok” will pick that, decide it is the wrong thing, and leave the menu for the website. The CLI was never in that list.
Observed sequence on a 4.0 machine (for context, not the bug report): Install → AI → Grok Bot → uninstall →
curl -fsSL https://x.ai/cli/install.sh | bash→ thengrok.grokwas never tried first. A failed firstgrokis not what we are fixing.What
omarchy-mise-install grok(first-party mise package, same shape asclaude/codex)omarchy default agent grokinstallsgrok, notnpm:@xai-official/grok~/.local/bin/agentsymlinkgrokor pick the default agent; skip the website installerCoding agents stay out of Install → AI. Deploy path is still
grokor Setup → Defaults → Agent → Grok.Tests
test/shell.d/default-agent-test.shtest/shell.d/menu-test.sh./test/cli