Skip to main content
Opsh works with five AI providers: OpenAI, Anthropic, Gemini, OpenRouter, and Ollama. All provider settings live in ~/.opsh/config.json under the provider key. Only the provider named in provider.selected is used at runtime — the others retain their settings so you can switch between them without re-entering credentials.

Setting your provider interactively

The easiest way to configure a provider is through the interactive editor:
  • Run opsh --init in your terminal to open the setup wizard.
  • Type !config inside the Opsh REPL, then choose Provider from the menu.
Both flows let you pick a provider, choose a model, and enter your API key. Your selections are saved to ~/.opsh/config.json immediately.

The provider.selected field

The provider.selected field controls which provider Opsh uses. Set it to one of:

Provider config snippets

Each provider has its own sub-object inside provider. The tabs below show the full structure and default values for each one.
config.json

Default base URLs

You can change baseUrl to point to a compatible proxy or self-hosted endpoint.
API keys are stored as plain text in ~/.opsh/config.json. Restrict access to this file so other users on the system cannot read it: