Alpine Linux companion repo for running Google Gemini CLI reliably on BusyBox + musl.
This is not a replacement for the upstream fork. It is the operational layer:
- install Gemini CLI in a user-owned location
- reapply Alpine compatibility patches after reinstalls
- document Alpine-specific failure modes and workarounds
Upstreamable source changes live in:
https://github.com/mekineer-com/gemini-cli
Current scope:
- BusyBox-safe entrypoint
- fast
--version - Alpine PTY preference
- noninteractive shell PTY fix
- auth-startup fix
- faster Alpine startup path
- noninteractive JSON error-output fix
- BusyBox-safe terminal parent detection for
/terminal-setup - no automatic model demotion (fallback disabled by patch default)
User-local install:
./scripts/install-user-local.shInstall a specific version (default is 0.34.0):
GEMINI_CLI_VERSION=0.34.0 ./scripts/install-user-local.shReapply patches after reinstall:
./scripts/reapply-alpine-patches.sh [PREFIX]Patch mode is selected automatically by installed package layout:
- legacy
dist/layout (0.35.x and earlier): full Alpine patch set - bundled
bundle/layout (0.36+): Alpine compatibility subset for the bundled build
Reapply patches and also install diagnostics wrapper/helper:
./scripts/reapply-alpine-patches.sh [PREFIX] --with-diagnosticsInstall diagnostics only (no patch reapply):
./scripts/install-gemini-diagnostics.sh [PREFIX]Read latest diagnostics quickly:
gemini-diag-lastCreate a reproducible diagnostics bundle (latest failing run + artifacts):
gemini-diag-bundleRun a deterministic reliability smoke pass (headless + PTY failure checks):
./scripts/gemini-reliability-smoke.shSmoke history is appended to:
~/.gemini/diagnostics/smoke/history.tsvDebug mode to suppress relaunch/retry-style behavior during repro sessions:
GEMINI_DEBUG_DISABLE_RETRY=1 geminiForce old parent/child relaunch behavior for debugging:
GEMINI_CLI_FORCE_RELAUNCH=true geminiThe upstream Gemini CLI repo is large and active, but Alpine-specific fixes are unlikely to get fast attention. This repo gives Alpine users something immediately usable while the source fork stays PR-ready.
Patch groups and rollback guidance:
- default behavior: no automatic fallback/demotion
- if
gemini-3.xcapacity is exhausted, the turn fails explicitly instead of silently switching models
- quick internal map for upstream
gemini-cliflow and Alpine patch/debug entry points:- see
architecture.md
- see
- Repository license:
- GPL-3.0-only
- Upstream roots acknowledged:
- the operational patching here is derived from Apache-licensed Gemini CLI work
- see
NOTICE - see
licenses/Apache-2.0.txt