Skip to content

feat(cli): improve CLI agent and command handling#12126

Open
KaiveYoung wants to merge 1 commit intoRooCodeInc:mainfrom
KaiveYoung:feat/cli-improvements
Open

feat(cli): improve CLI agent and command handling#12126
KaiveYoung wants to merge 1 commit intoRooCodeInc:mainfrom
KaiveYoung:feat/cli-improvements

Conversation

@KaiveYoung
Copy link
Copy Markdown

@KaiveYoung KaiveYoung commented Apr 16, 2026

This PR adds --base-url (-b) CLI flag support for the Roo-Code CLI, enabling users to connect to OpenAI-compatible APIs and custom API endpoints. It also adds openai as a supported provider.

Key changes:

  • Added -b, --base-url <url> CLI option to specify a custom base URL for LLM providers
  • Added openai to the list of supported providers (anthropic, openai-native, openai, gemini, openrouter, vercel-ai-gateway)
  • Updated getProviderSettings() in provider.ts to handle baseUrl for all applicable providers:
    • openai: openAiBaseUrl, openAiApiKey, openAiModelId
    • openai-native: openAiNativeBaseUrl
    • gemini: googleGeminiBaseUrl
    • openrouter: openRouterBaseUrl
  • Updated apps/cli/README.md with the new flag documentation

Design choices:

  • The baseUrl parameter is passed through the ExtensionHostOptions interface to maintain consistency with existing provider settings
  • Default providers map to their respective base URL configurations, while custom URLs can be overridden via the CLI flag

Test Procedure

  1. Lint check: Run pnpm lint from the project root - all checks pass
  2. CLI flag test:
    # Test with OpenAI-compatible API
    cd apps/cli && pnpm start -b https://api.openai.com/v1 -k $OPENAI_API_KEY --provider openai -m gpt-4o
    
    # Test with local LLM server (e.g., Ollama)
    cd apps/cli && pnpm start -b http://localhost:11434/v1 --provider openai -m llama3

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. Enhancement New feature or request labels Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant