Skip to content

feat: add interactive prompt to put command; chore: update inquirer to only minimally required packages#8

Merged
phoenix-ru merged 1 commit intomainfrom
feat/add-interactive-prompt-to-put-command
Feb 20, 2026
Merged

feat: add interactive prompt to put command; chore: update inquirer to only minimally required packages#8
phoenix-ru merged 1 commit intomainfrom
feat/add-interactive-prompt-to-put-command

Conversation

@phoenix-ru
Copy link
Copy Markdown
Member

@phoenix-ru phoenix-ru commented Feb 16, 2026

Closes N/A

This PR adds an interactive prompt to the put command so that sensitive data can be entered
without saving anything to shell history or exposing to bystanders.

image

Checklist:

  • issue number linked above after pound (#)
    • replace "Closes " with "Contributes to" or other if this PR does not close the issue
  • manually checked my feature / checking not applicable
  • wrote tests / testing not applicable
  • attached screenshots / screenshot not applicable

chore: update inquirer to only minimally required packages
Comment thread src/commands/put.ts
// Value can be prompted interactively to avoid saving
// sensitive data in shell history
let value = argValue ?? await promptPassword({ message: 'Value to store:', mask: true })
if (typeof value !== 'string') {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this guard will never trigger since the promptPassword is Promise<String>. A empty password is may accepted -> value = "".

Solution: We could use a validate function on the prompt.

const value = argValue ?? await promptPassword({
  message: 'Value to store:',
  mask: true,
  validate: v => v !== '' || 'Value is required',
})

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is actually intended 🙂

You can see validate being used when empty string is unacceptable:

validate: v => v !== '' || 'Key is required',

Here, however, I can see a usecase of someone adding an empty string value parameter. Would you agree with that or do you think that it never makes sense?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@phoenix-ru Makes sense!

But do you think we should leave the guard if (typeof value !== ‘string’) { in there? It should never trigger, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, it should never, but it's there for the sanity sake mostly in case inquirer ever returns undefined or other bad value

@phoenix-ru phoenix-ru merged commit 582df9b into main Feb 20, 2026
1 check passed
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.

2 participants