> For the complete documentation index, see [llms.txt](https://notes.eliasnorrby.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.eliasnorrby.com/bash/credentials-on-command-line.md).

# Hiding credentials on the command line

Some commands require sensitive information to be passed on the command line. If we don't want these to show up in the command history, we can use `read` with the `-s` flag to store secret values in variables:

```bash
read -p "PASSWORD: " -s mypass
cmd login --creds user:${mypass}
```
