File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,24 @@ export const getProviderApiKeyError = (provider: string): string => {
3636 }
3737
3838 const { keyName, docsUrl } = config ;
39+ const platform = process . platform ;
40+ let osSpecificInstructions = '' ;
41+
42+ if ( platform === 'win32' ) {
43+ osSpecificInstructions = `- Using the windows command prompt, "setx ${ keyName } =[your-api-key]"` ;
44+ } else if ( platform === 'darwin' || platform === 'linux' ) {
45+ osSpecificInstructions = `- As an environment variable, "export ${ keyName } =[your-api-key]"` ;
46+ } else {
47+ osSpecificInstructions = `- As an environment variable (platform-specific command)` ;
48+ }
3949
4050 return `
4151Error: ${ keyName } environment variable is not set
4252
43- Before using MyCoder with ${ provider } models, you must have a ${ keyName } specified either:
53+ Before using MyCoder with ${ provider } models, you must have a ${ keyName } specified.
4454
45- - As an environment variable, "export ${ keyName } =[your-api-key]" or
55+ You can set it via:
56+ ${ osSpecificInstructions }
4657- In a .env file in the folder you run "mycoder" from
4758
4859For setup instructions, visit: ${ docsUrl }
You can’t perform that action at this time.
0 commit comments