Skip to content

E 362 enhance config object to store multiple api keys#14

Merged
nainglinnkhant merged 12 commits into
mainfrom
e-362-enhance-config-object-to-store-multiple-api-keys
Jul 9, 2025
Merged

E 362 enhance config object to store multiple api keys#14
nainglinnkhant merged 12 commits into
mainfrom
e-362-enhance-config-object-to-store-multiple-api-keys

Conversation

@nainglinnkhant

Copy link
Copy Markdown
Contributor

No description provided.

@joeldierkes joeldierkes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread packages/cli/src/utils/config.ts Outdated
const config = loadConfig();

// If it's already a valid API key, return it
if (nameOrKey.startsWith("mxb_")) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@nainglinnkhant
nainglinnkhant force-pushed the e-362-enhance-config-object-to-store-multiple-api-keys branch from b1f905b to db673f7 Compare July 7, 2025 22:19

if (!proceed) {
console.log(chalk.yellow(" Sync cancelled by user"));
console.log(chalk.yellow(" Sync cancelled by user"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super Nitpick: Should we remove the symbol here, since all other cancellations have no symbol too ?

@danielwasmus
danielwasmus self-requested a review July 8, 2025 10:08

@danielwasmus danielwasmus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nainglinnkhant
nainglinnkhant force-pushed the e-362-enhance-config-object-to-store-multiple-api-keys branch from 295f60f to 00c1641 Compare July 8, 2025 10:27
@nainglinnkhant
nainglinnkhant merged commit 9d44751 into main Jul 9, 2025
3 checks passed
@nainglinnkhant
nainglinnkhant deleted the e-362-enhance-config-object-to-store-multiple-api-keys branch July 9, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants