Skip to content

Commit

Permalink
Merge branch 'develop' into env-variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b authored Jan 20, 2025
2 parents 0ffcab9 + fe862ab commit 022c483
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
1 change: 1 addition & 0 deletions apps/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
- Profile name creation now supports \_ and - characters
- Polished the README file
- Support to specify environment name and description while creating a project
- Profile creation prompts users for all values if no option is set and shows default values

## Patches

Expand Down
40 changes: 34 additions & 6 deletions apps/cli/src/commands/profile/create.profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,52 @@ export default class CreateProfile extends BaseCommand {
}> {
let { name, apiKey, baseUrl, setDefault, enableMetrics } = options

if (!name) {
if (
!name &&
!apiKey &&
!baseUrl &&
setDefault == null &&
enableMetrics == null
) {
name = await text({
message: 'Enter the name of the profile',
placeholder: 'work'
})
}

if (!apiKey) {
apiKey = await text({
message: 'Enter the API key for the profile',
placeholder: 'ks_************'
})
}

if (!enableMetrics === undefined) {
baseUrl =
(await text({
message: `Enter the base URL for the keyshade server (default: ${API_BASE_URL})`,
placeholder: API_BASE_URL
})) || API_BASE_URL

setDefault = await confirm({
message: 'Set the profile as the default profile?',
initialValue: false
})

enableMetrics = await confirm({
message: 'Should keyshade collect anonymous metrics for development?'
message: 'Should keyshade collect anonymous metrics for development?',
initialValue: false
})
} else {
if (!name) {
name = await text({
message: 'Enter the name of the profile',
placeholder: 'work'
})
}

if (!apiKey) {
apiKey = await text({
message: 'Enter the API key for the profile',
placeholder: 'ks_************'
})
}
}

const inputSchema = z.object({
Expand Down

0 comments on commit 022c483

Please sign in to comment.