Cloak allows you to hide/show environment keys, to avoid accidentally sharing them with everyone who sees your screen.
MIT License
Cloak hides/shows your secrets in environment files, to avoid accidentally sharing them with everyone who sees your screen.
Cloak can be useful if you:
Cloak
Let's see Cloak in action!
.env
fileF1
to open the command paletteCloak
Cloak: Hide Secrets
Now enjoy exploring the rest of the features explained in the docs!
Property | Description |
---|---|
cloak.hideComments | Specifies whether comments will be affected |
cloak.environmentKeys | Specifies the scopes for the environment keys that will be affected |
cloak.environmentComments | Specifies the scopes for the environment file comments that will be affected |
Command | Description |
---|---|
cloak.restoreDefaultScopes | Restore the default TextMateRules scopes |
cloak.hideSecrets | Hide the secrets |
cloak.showSecrets | Show the secrets |
cloak.toggleSecrets | Hide/Show the secrets (opposite of current effect) |
Please refer to the issues list and feel free to grab one and contribute!
here are the really important aspects of Cloak:
Cloak uses TextMateRules scopes to match syntax found in the VS Code editor. When it finds a match, these values can be hidden or shown.
Only TextMateRule scopes apply. This means that if those scopes do not exist for a specific key or secret you want to hide, it cannot be done with cloak. You can determine if the scope you are looking for will work by using the Developer: Inspect Editor Tokens and Scope command from the command palette, then selecting the key and seeing the scope.
If you want to add or modify the scopes that apply to your secrets, you may change them in the settings.json for VS Code. Find the setting for cloak.environmentKeys
and modify as needed. If you ever need to revert to the defaults, choose the command Cloak: Restore default scopes
.
Cloak writes to VS Code's log output. You can open the output panel and select "Cloak" to see the log. This can be helpful when reporting issues.
See the CHANGELOG latest changes.
.env
files?Not currently. Cloak relies on the TextMateRules and scopes that VS Code supports. These currently only support known scopes, and there is no way I could find that would narrow down the contents of specific files. If this changes, or if you have ideas, please consider proposing a Pull Request.
If you want to try the extension out start by cloning this repo, cd
into the folder, and then run npm install
.
Then you can run the debugger for the launch configuration Run Extension
. Set breakpoints, step through the code, and enjoy!
Inspiration comes in many forms. These folks and teams have contributed either through ideas, issues, pull requests, or guidance. Thank you!
Thanks to John Lindquist and Wes Bos for the inspiration.
The VS Code team and their incredibly helpful guide for creating extensions
Here are some great examples for extensions from the VS Code team
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!