Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Former Member
4 years agoPersistent op run Rather Than Manually Calling it
This is kind of a far out there suggestion, and so I know unlikely, but one challenge with op run when protecting secrets with it is remembering to use it. For example, I am protecting my Linode AP...
Former Member
4 years agoHey @alexclst,
Thank you for trying out the CLI beta. We really appreciate it.
One way that may help to no longer forget adding op run before any linode-cli command is to make an alias:
alias linode-cli="op run -- linode-cli"
You can store your Linode API token environment variable in a file (e.g. in ~/.op/linode-cli and then the alias would be like this:
alias linode-cli="op run --env-file ~/.op/linode-cli -- linode-cli"
You can add this to your terminal's profile so that the alias works for all terminals that will be opened:
For Bash
Open a new terminal and open up
.bash_profile:
nano .bash_profile
Add the alias at the end of the file:
alias linode-cli="op run --env-file ~/.op/linode-cli -- linode-cli"
Save the file with 'control+o', then exit with 'control+x'.
Refresh the shell environment:
source ~/.bash_profile
For Zsh
Open a new terminal and open up
.bash_profile:
nano .zshrc
Add the alias at the end of the file:
alias linode-cli="op run --env-file ~/.op/linode-cli -- linode-cli"
Save the file with 'control+o', then exit with 'control+x'.
Refresh the shell environment:
source ~/.zshrc
Does this suggestion work for you? Let us know and we're glad to help you out more!
Feel free to reach out to us with any other feedback that you have to improve the CLI as well!