-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(cli): bp profile add, delete and dev #14554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
24238ec to
48e0c17
Compare
| } | ||
|
|
||
| const token = await this.globalCache.sync('token', this.argv.token, async (previousToken) => { | ||
| const prompted = await this.prompt.text('Enter your Personal Access Token', { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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 credentialsbp profile delete(alias:rm) - Delete an existing profileAlso add a --dev flag to automatically use the dev API URL
api.botpress.dev