Skip to content

Conversation

@quu-ack
Copy link
Contributor

@quu-ack quu-ack commented Nov 19, 2025

Why

I'm personally having issues with writing permissions on my Mac so I couldn't set up my dev profile by editing the json file.
I quickly improved the bp profile command so I could continue testing my google calendar integration

Content

  • bp profile add - Add a new profile with credentials
  • bp profile delete (alias: rm) - Delete an existing profile

Also add a --dev flag to automatically use the dev API URL api.botpress.dev

@quu-ack quu-ack requested review from a team as code owners November 19, 2025 13:47
@quu-ack quu-ack force-pushed the quack/bp-profile-add branch from 24238ec to 48e0c17 Compare November 19, 2025 13:49
}

const token = await this.globalCache.sync('token', this.argv.token, async (previousToken) => {
const prompted = await this.prompt.text('Enter your Personal Access Token', {
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: I don't know if this is something we can do, but it could be nice to hide the token with stars or make the text invisible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it may be on purpose - this is how it's done in login-command - even if a this.prompt.password() actually exists
@franklevasseur may have more context

Copy link
Contributor

Choose a reason for hiding this comment

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

The token is stored in clear text in the global cache anyway, so it wouldn't be much more secure hiding it

return prompted
})

// Validate credentials by testing login
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: I feel like this comment is not necessary since the code is self-descriptive

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah i wasn't sure it was descriptive enough so I added a comment to reduce friction for other devs, but I can remove it

}
}

export type AddProfileCommandDefinition = typeof commandDefinitions.profiles.subcommands.add
Copy link
Contributor

Choose a reason for hiding this comment

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

chore: A similar operation is already available using bp login. I don't mind if you add the command to the profile commands, but you should reuse the code if possible

Copy link
Contributor Author

@quu-ack quu-ack Nov 21, 2025

Choose a reason for hiding this comment

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

Yeah I think Fleur wanted to thing about it to define what would be in the login scope and what would be in the profile scope
So I'm still waiting on his input regarding this

positional: true,
idx: 0,
},
dev: {
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: We don't want to expose the staging environment to all users. If you want to have a 'dev' command, create a profile with the right apiUrl

Copy link
Contributor Author

@quu-ack quu-ack Nov 21, 2025

Choose a reason for hiding this comment

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

Yes I had the discussion with @Math-Fauch and I agree with your analyze

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.

4 participants