forked from cline/cline
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
API key from Env Var support #6178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
suprjinx
wants to merge
60
commits into
RooCodeInc:main
Choose a base branch
from
suprjinx:add_api_key_env_vars
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 56 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
8d5d4f8
First cut on different UI
suprjinx 9391ede
WIP for passing process environment to webview components
suprjinx fa0504f
Set process env in react html as script, instead of trying to pass me…
suprjinx 39a1edb
Fix logic for activating apiKeyEnvVar
suprjinx 91725fd
Add new ApiKey component and use with Anthropic
suprjinx 742ca14
Add apiKeyUseEnvVar to all providers supporting api key
suprjinx 4fb7ed7
Merge branch 'main' into add_api_key_env_vars
suprjinx 891af6d
Fix merge errors
suprjinx 488ac44
Add unit tests for components/settings/ApiKey.tsx and api/index.ts
suprjinx 910028d
Fix lint issues
suprjinx 436025f
Merge branch 'main' into add_api_key_env_vars
suprjinx e17c2e6
Add support for "balance display" used by OpenRouter and Requesty pro…
suprjinx 7e518b1
Fix additional unused vars
suprjinx 78598db
Fix new lint complaints after removing unused func
suprjinx 2f5e00f
Add missing translation to non-EN locales
suprjinx 60002d8
Fix last lint complaint
suprjinx 2b6b2ea
Fix missing imports
suprjinx f154eb2
One more lint fix
suprjinx 674055c
Fix code scanner complaint re: potential prototype-pollution
suprjinx 88d587f
Fix OpenAINative api key translation keys
suprjinx 1ea534c
Merge branch 'main' into add_api_key_env_vars
suprjinx 5706600
PR suggestions to make "use env var" property more general; use
suprjinx 6f8b0d9
Fix tsc compile issue
suprjinx f9c6a51
Switch to "ENV_VAR_EXISTS" map of known API keys, instead of writing
suprjinx 2ff6dec
Place a map of know api keys -> bool in webview for checking existence
suprjinx 895b505
Merge branch 'main' into add_api_key_env_vars
suprjinx 11fe352
fix typo with chutes provider; remove redundant `balanceDisplay` and
suprjinx 08e7d73
Merge branch 'main' into add_api_key_env_vars
suprjinx 0879bcd
Remove unused `env` property for ApiOptions
suprjinx 0231f6f
Merge branch 'main' into add_api_key_env_vars
suprjinx 0707083
Merge branch 'main' into add_api_key_env_vars
suprjinx e711534
Fix merge conflict
suprjinx 6f7cace
Remove unused import from merge
suprjinx ce8186d
Remove translations help function
suprjinx 010300c
Merge branch 'main' into add_api_key_env_vars
suprjinx 91206b1
Fix formatting in test file; fix OllamaHandler reference
suprjinx 1076c2a
Merge branch 'main' into add_api_key_env_vars
suprjinx 8dd02bc
Fix merge error
suprjinx 6b82ada
Fix merge error
suprjinx c0f82d8
Fix merge error
suprjinx 8868930
Fix merge error
suprjinx 86fd178
Merge branch 'main' into add_api_key_env_vars
suprjinx b39fdb9
Remove unneeded but failing test case
suprjinx bfe5486
Merge branch 'main' into add_api_key_env_vars
suprjinx 2fd04c5
Fix merge conflict
suprjinx b2ef23c
Merge branch 'main' into add_api_key_env_vars
suprjinx 6b32481
Change DEEP_SEEK_API_KEY -> DEEPSEEK_API_KEY
suprjinx 09dad33
Change OPEN_ROUTER_API_KEY -> OPENROUTER_API_KEY
suprjinx 2391628
Fix index.spec.ts header
suprjinx 95fbe97
Update validate function for ConfigUseEnvVar on existing providers
suprjinx 5ec88ba
Additional providers having apikey
suprjinx 4736894
Remove unused imports and defs since using ApiKey component
suprjinx cc85602
Use constants instead of hard-coded strings in buildApiHandler; fix
suprjinx d6f301f
Fix Chutes translation key
suprjinx 5048312
Merge branch 'main' into add_api_key_env_vars
suprjinx 4597469
Fixing MOONSHOOT->MOONSHOT plus remove extra space
suprjinx 142412c
Merge branch 'RooCodeInc:main' into add_api_key_env_vars
suprjinx 564cc9a
Fix formatting
suprjinx 3823e1b
Update existing api key validations and add missing ones
suprjinx 7b24b89
trigger GitHub actions
suprjinx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /** | ||
| * API key environment variable names organized by provider | ||
| */ | ||
| export const API_KEYS = { | ||
| ANTHROPIC: "ANTHROPIC_API_KEY", | ||
| OPENAI: "OPENAI_API_KEY", | ||
| OPEN_ROUTER: "OPENROUTER_API_KEY", | ||
| GLAMA: "GLAMA_API_KEY", | ||
| GEMINI: "GEMINI_API_KEY", | ||
| MISTRAL: "MISTRAL_API_KEY", | ||
| DEEP_SEEK: "DEEPSEEK_API_KEY", | ||
| UNBOUND: "UNBOUND_API_KEY", | ||
| REQUESTY: "REQUESTY_API_KEY", | ||
| XAI: "XAI_API_KEY", | ||
| GROQ: "GROQ_API_KEY", | ||
| CHUTES: "CHUTES_API_KEY", | ||
| LITELLM: "LITELLM_API_KEY", | ||
| CEREBRAS: "CEREBRAS_API_KEY", | ||
| DEEP_INFRA: "DEEPINFRA_API_KEY", | ||
| DOUBAO: "DOUBAO_API_KEY", | ||
| FEATHERLESS: "FEATHERLESS_API_KEY", | ||
| FIREWORKS: "FIREWORKS_API_KEY", | ||
| HUGGING_FACE: "HUGGINGFACE_API_KEY", | ||
| IO_INTELLIGENCE: "IOINTELLIGENCE_API_KEY", | ||
| MOONSHOT: "MOONSHOT_API_KEY", | ||
| SAMBA_NOVA: "SAMBANOVA_API_KEY", | ||
| VERCEL: "VERCEL_API_KEY", | ||
| ZAI: "ZAI_API_KEY", | ||
| } as const | ||
|
|
||
| /** | ||
| * Array of all API key environment variable names | ||
| */ | ||
| export const API_KEY_ENV_VAR_NAMES = Object.values(API_KEYS) | ||
|
|
||
| /** | ||
| * Type for API key environment variable names | ||
| */ | ||
| export type ApiKeyEnvVar = (typeof API_KEYS)[keyof typeof API_KEYS] |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.