|
1 | | -import chalk from 'chalk'; |
2 | 1 | import { createInterface } from 'readline/promises'; |
| 2 | + |
| 3 | +import chalk from 'chalk'; |
3 | 4 | import { Logger } from 'mycoder-agent'; |
4 | 5 |
|
5 | 6 | import { SharedOptions } from '../options.js'; |
@@ -159,20 +160,20 @@ export const command: CommandModule<SharedOptions, ConfigOptions> = { |
159 | 160 | if (argv.key.includes('API_KEY')) { |
160 | 161 | logger.warn( |
161 | 162 | chalk.yellow( |
162 | | - 'Warning: Storing API keys in configuration is less secure than using environment variables.' |
163 | | - ) |
| 163 | + 'Warning: Storing API keys in configuration is less secure than using environment variables.', |
| 164 | + ), |
164 | 165 | ); |
165 | 166 | logger.warn( |
166 | 167 | chalk.yellow( |
167 | | - 'Your API key will be stored in plaintext in the configuration file.' |
168 | | - ) |
| 168 | + 'Your API key will be stored in plaintext in the configuration file.', |
| 169 | + ), |
169 | 170 | ); |
170 | | - |
| 171 | + |
171 | 172 | // Ask for confirmation |
172 | 173 | const isConfirmed = await confirm( |
173 | | - 'Do you want to continue storing your API key in the configuration?' |
| 174 | + 'Do you want to continue storing your API key in the configuration?', |
174 | 175 | ); |
175 | | - |
| 176 | + |
176 | 177 | if (!isConfirmed) { |
177 | 178 | logger.info('Operation cancelled.'); |
178 | 179 | return; |
@@ -216,22 +217,26 @@ export const command: CommandModule<SharedOptions, ConfigOptions> = { |
216 | 217 | if (argv.all) { |
217 | 218 | // Confirm with the user before clearing all settings |
218 | 219 | const isConfirmed = await confirm( |
219 | | - 'Are you sure you want to clear all configuration settings? This action cannot be undone.' |
| 220 | + 'Are you sure you want to clear all configuration settings? This action cannot be undone.', |
220 | 221 | ); |
221 | | - |
| 222 | + |
222 | 223 | if (!isConfirmed) { |
223 | 224 | logger.info('Operation cancelled.'); |
224 | 225 | return; |
225 | 226 | } |
226 | | - |
| 227 | + |
227 | 228 | // Clear all settings |
228 | 229 | clearAllConfig(); |
229 | | - logger.info('All configuration settings have been cleared. Default values will be used.'); |
| 230 | + logger.info( |
| 231 | + 'All configuration settings have been cleared. Default values will be used.', |
| 232 | + ); |
230 | 233 | return; |
231 | 234 | } |
232 | | - |
| 235 | + |
233 | 236 | if (!argv.key) { |
234 | | - logger.error('Key is required for clear command (or use --all to clear all settings)'); |
| 237 | + logger.error( |
| 238 | + 'Key is required for clear command (or use --all to clear all settings)', |
| 239 | + ); |
235 | 240 | return; |
236 | 241 | } |
237 | 242 |
|
|
0 commit comments