opcode icon indicating copy to clipboard operation
opcode copied to clipboard

Multiple sets of environment variables are available for you to choose from.

Open hujingnb opened this issue 8 months ago • 3 comments

Hello, thank you for developing the tool. It's very useful.

I have different Claude API service providers, so I need to switch between them. I think this is not just my need.

Can multiple sets of environment variables be provided, with each set allowing for a custom batch of environment variables? In this way, when switching service providers, only the selection of environment variables is required.

hujingnb avatar Mar 29 '26 07:03 hujingnb

Yes, I also want to run other local models like LM Studio and Ollama. Even though the environment variables have been configured, it's not running. The application only allows two ANTHROPIC models.

nasa8x avatar Apr 15 '26 04:04 nasa8x

I found Emdash.sh (https://github.com/generalaction/emdash) to be a similar project that handles everything.

nasa8x avatar Apr 27 '26 09:04 nasa8x

One design detail worth considering: make these named provider profiles and bind a profile to each session, rather than copying the selected variables into one global environment. Otherwise switching provider A can mutate or restart sessions already using B, and stale variables are easy to leak across launches.

MultiCC uses the per-session model: each CLI session keeps its own provider, endpoint, and model plus an isolated environment (including CODEX_HOME where applicable), so different Anthropic- or OpenAI-compatible providers can run concurrently. This may be a useful reference implementation.

For opcode, a minimal shape could be ProviderProfile { id, name, env } plus providerProfileId on each session. Materialize the variables only when spawning that session, and never rewrite the parent process environment. That would also leave room for LM Studio and Ollama adapters without special-casing each one in the profile UI.

lsjwzh avatar Sep 04 '26 03:09 lsjwzh