Configure prima through PRIMA_CLI_ variables instead of an init command - #139
Open
DavertMik wants to merge 1 commit into
Open
Configure prima through PRIMA_CLI_ variables instead of an init command#139DavertMik wants to merge 1 commit into
DavertMik wants to merge 1 commit into
Conversation
DavertMik
force-pushed
the
prima-env-vars
branch
3 times, most recently
from
August 23, 2026 19:58
257b634 to
ab6fe69
Compare
Prima is usually run by a coding agent, in a directory that has no explorbot project and no reason to gain one. It now takes its configuration from the environment: every PRIMA_CLI_ variable mirrors the EXPLORBOT_ one of the same name and wins over it, so prima can be pointed at a different model, vision model or URL without disturbing an explorbot setup on the same machine. The mirror is driven by the EXPLORBOT_ENV_VARS registry rather than a list of its own, so a variable added there is mirrored without touching prima. A vision model is never derived from the main model, so naming only a main model leaves screenshot analysis off. --vision-model sets it for one run, PRIMA_CLI_VISION_MODEL for good. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
DavertMik
force-pushed
the
prima-env-vars
branch
from
August 23, 2026 20:00
ab6fe69 to
71dc053
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prima is usually run by a coding agent, in a directory with no explorbot project and no reason to gain one. It now takes its configuration from the environment.
PRIMA_CLI_* mirrors and overrides EXPLORBOT_*
Every
PRIMA_CLI_variable mirrors theEXPLORBOT_one of the same name and wins over it, so prima can be pointed at a different provider, model or URL without disturbing an explorbot setup on the same machine.The mirror is driven by the
EXPLORBOT_ENV_VARSregistry rather than a list of its own, so a variable added there is mirrored without touching prima — there is a test asserting exactly that. It runs first thing in thePrimaconstructor, before config is read.Verified by hand:
PRIMA_CLI_AI_PROVIDER=groqalone+ EXPLORBOT_AI_PROVIDER=openaiPRIMA_CLI_URLvsEXPLORBOT_URLPRIMA_CLI_wins--urlflag vsPRIMA_CLI_URLProvider API keys are deliberately not mirrored —
OPENROUTER_API_KEYand friends are provider-standard names, not explorbot variables.No init command
Asked for a model it does not have, prima printed explorbot's message, which recommends
explorbot init— a command prima does not ship. It now prints where to put the variables instead, and writes nothing:~/.claude/settings.jsonenvblock first, since an agent is who runs primaexportset -gx, checked against real fish becauseexporterrors thereBoth the
configpath and thecheckenvelope path were confirmed to carry the message intact.The message is ASCII on purpose.
dedentrenders every non-ASCII character as literal\uXXXXtext, so an em dash would reach the reader as—. There is a test pinning that.boat/prima/README.mdis updated to match — it previously recommendedexplorbot init --global.Tests
6 new tests in
boat/prima/tests/env.test.ts. 1043 unit and 133 prima tests pass; format and lint clean.Two things found but not fixed here
dedentmangles non-ASCII across the codebase.dedent`a — b → c`yieldsa — b → c, andescapeSpecialCharacters: falsedoes not help. 207 non-ASCII characters sit insidededentblocks across 23 files, mostly prompts:src/ai/pilot.ts(46),src/ai/captain/test-mode.ts(21),src/ai/planner.ts(16),src/ai/rules.ts(14),src/ai/tester.ts(13). Those models are reading—where an em dash was meant. Separate change.test.ymldoes not runboat/prima/tests/. It runstests/unit/andtests/integration/only, so prima's 133 tests — including these — run solely inpublish-prima.ymlat release time. A PR can break prima with CI green.🤖 Generated with Claude Code