The window's plugin sign-in (StartPluginSignIn) installs the vendor CLI a
plugin signs in through when it is missing: Grok Build, with xAI's
installer or, in the Docker image with no curl, as that installer does
(installGrokBuild). The command line's pluginLogin, which `magpie plugin
login` and `magpie accounts add` take for a plugin or a moved
subscription, never did, so every Grok sign-in method in the container
ended in the plugin's "install Grok Build first". The check is now
provider.PluginCLIMissing / InstallPluginCLI, shared by both, and the
command line installs before the method's questions (not for an API key).
The Docker page (en, zh, ja) says Grok's sign-in installs Grok Build into
/config/home/.grok, and that GROK_BIN_DIR takes one put there by hand.
Run at e98440ae6: gofmt -l (nothing); go vet ./internal/provider
./internal/cli on darwin, GOOS=linux -tags nogui and GOOS=windows (clean);
go vet ./... (darwin, clean); go test -tags nogui ./internal/provider
./internal/cli ./internal/proc in a sandbox HOME with pinned caches (ok).
New TestPluginLoginInstallsItsCLIFirst fails with the install block in
pluginLogin turned off ("a failed install went on: <nil>").
TestInstallPluginCLIInstallsGrokBuild covers the provider side, and
TestGrokPluginSignInInstallsCLI (the window's path) still passes.
Real use: a linux/arm64 build in the official ghcr.io/yetone/magpie image
(OrbStack, own volume), plugin @magpie-community/opencode-grok-auth added,
`magpie plugin login grok` method 1: "Grok Build installed", then xAI's
device link (accounts.x.ai/oauth2/device?user_code=…);
/config/home/.grok/bin/grok -> ../downloads/grok-linux-aarch64. The
sign-in wasn't approved (no SuperGrok account here), so the CPA import
and the requests after it weren't tried. internal/agent (untouched) timed
out at 10 minutes under the machine's load and wasn't rerun.