This is a ruby plugin which manages tokens on a machine.
I've built a number of utility scripts for interacting with 3rd party services, such as Github, Slack, or CircleCI. These utilities require the use of API tokens. Originally I'd store these tokens in a dotfile, so that they can be shared amongst scripts. However, reading tokens from a file became cumbersome. Now I can easily shell out and read the tokens via the Token Manager
def slack_api_call
slack_token = `token_manager read slack_token`
...
end
- Copy the
main.rb
file to a location on your machine - Symlink the script to
/usr/local/bin
$ ln -s /path/to/main.rb /usr/local/bin/token_manager
Now you can call token_manager
from the command line
$ token_manager add token_name token_value
$ token_manager remove token_name
$ token_manager read token_name
$ token_manager list
-
Tokens are stored in a dotfile in the same directory as the plugin script.
-
tokens are not encrypted when stored.