File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,10 @@ function builder(argv: Argv): Argv<Options> {
79
79
80
80
/** Yargs command handler for the command. */
81
81
async function handler ( options : Arguments < Options > ) {
82
+ const apiKey = options . apiKey || DEFAULT_API_KEY ;
83
+
82
84
assert (
83
- options . apiKey ,
85
+ apiKey ,
84
86
[
85
87
'No API key configured. A Gemini API key must be set as the `GEMINI_API_KEY` environment ' +
86
88
'variable, or passed in using the `--api-key` flag.' ,
@@ -89,7 +91,7 @@ async function handler(options: Arguments<Options>) {
89
91
) ;
90
92
91
93
const fixedContents = await fixFilesWithAI (
92
- options . apiKey ,
94
+ apiKey ,
93
95
options . files ,
94
96
options . error ,
95
97
options . model ,
Original file line number Diff line number Diff line change @@ -72,15 +72,16 @@ function builder(argv: Argv): Argv<Options> {
72
72
. option ( 'apiKey' , {
73
73
type : 'string' ,
74
74
alias : 'a' ,
75
- default : DEFAULT_API_KEY ,
76
75
description : 'API key used when making calls to the Gemini API' ,
77
76
} ) ;
78
77
}
79
78
80
79
/** Yargs command handler for the command. */
81
80
async function handler ( options : Arguments < Options > ) {
81
+ const apiKey = options . apiKey || DEFAULT_API_KEY ;
82
+
82
83
assert (
83
- options . apiKey ,
84
+ apiKey ,
84
85
[
85
86
'No API key configured. A Gemini API key must be set as the `GEMINI_API_KEY` environment ' +
86
87
'variable, or passed in using the `--api-key` flag.' ,
@@ -98,7 +99,7 @@ async function handler(options: Arguments<Options>) {
98
99
process . exit ( 1 ) ;
99
100
}
100
101
101
- const ai = new GoogleGenAI ( { apiKey : options . apiKey } ) ;
102
+ const ai = new GoogleGenAI ( { apiKey} ) ;
102
103
const progressBar = new SingleBar ( { } , Presets . shades_grey ) ;
103
104
const failures : { name : string ; error : string } [ ] = [ ] ;
104
105
const running = new Set < Promise < void > > ( ) ;
You can’t perform that action at this time.
0 commit comments