E 362 enhance config object to store multiple api keys#14
Conversation
joeldierkes
left a comment
There was a problem hiding this comment.
Since we support multiple api keys and can set a default we should think about problems that could arise. I could imagine that a user is not always aware of the currently used api key and which org it belongs to. How about adding a default "Operating in organization ..." when a command is executed?
| const config = loadConfig(); | ||
|
|
||
| // If it's already a valid API key, return it | ||
| if (nameOrKey.startsWith("mxb_")) { |
There was a problem hiding this comment.
Let's also have a utils function for.startsWith("mxb_") since it's easier to change in the future that way?
| export function setupGlobalOptions(program: Command): void { | ||
| program | ||
| .option("--api-key <key>", "API key for authentication") | ||
| .option("--api-key <key>", "API key name or actual key for authentication") |
There was a problem hiding this comment.
Tbh I am not completly sure if I like this. The option suggest that --api-key is an api key. How about a second option --api-key-name that is mutially exclusive with --api-key or something?
- Use console.error instead of console.log for error logs - Use "✗" symbol instead of "Error:" text in error logs
b1f905b to
db673f7
Compare
|
|
||
| if (!proceed) { | ||
| console.log(chalk.yellow("❌ Sync cancelled by user")); | ||
| console.log(chalk.yellow("✗ Sync cancelled by user")); |
There was a problem hiding this comment.
Super Nitpick: Should we remove the symbol here, since all other cancellations have no symbol too ?
295f60f to
00c1641
Compare
No description provided.