Skip to content

feat: allow API base URL override via flag or env var - #1

Merged
outofcoffee merged 1 commit into
mainfrom
worktree-api-base-url
Jun 22, 2026
Merged

feat: allow API base URL override via flag or env var#1
outofcoffee merged 1 commit into
mainfrom
worktree-api-base-url

Conversation

@outofcoffee

Copy link
Copy Markdown
Collaborator

Override the provider API base URL for any provider via a command-line flag or environment variable.

Summary

  • Add --base-url/-b flag to oc-config add to set options.baseURL for any provider
  • Add OC_CONFIG_BASE_URL env var as an alternative override
  • Override applies to every provider, including those with no base URL in the catalogue, and wins over the catalogue's static and per-provider (OLLAMA_BASE_URL, etc.) base URLs
  • Add tests covering the flag, the env var, their precedence, and end-to-end config writing
  • Document the new override in the README and the llama.cpp guides

Implementation details

Precedence is resolved as flag → OC_CONFIG_BASE_URL → catalogue defaults. The flag value is threaded through buildProviderBlock, which falls back to the env var (via the existing resolve function) when the flag is empty, then sets options.baseURL last so it overrides both the static options.baseURL and any per-provider optionsFromEnv mapping.

Add a general --base-url/-b flag and OC_CONFIG_BASE_URL environment
variable that set options.baseURL for any provider, overriding the
catalogue's static and per-provider base URLs. The flag wins over the
env var, which wins over the catalogue defaults.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@outofcoffee outofcoffee added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 22, 2026
@outofcoffee
outofcoffee merged commit 3486d59 into main Jun 22, 2026
1 check passed
@outofcoffee
outofcoffee deleted the worktree-api-base-url branch June 22, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant