Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>SwissknifeNew to Visual Studio Code? Get it now.

Swissknife

Luis Fontes

|
10,657 installs
| (6) | Free
The developers swissknife. Do conversions and generations right out of vs code. Extendable with user scripts
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Swissknife

Available in the Visual Studio Marketplace

Banner

Swissknife is the developers' toolbox. It provides a set of features (scripts) to convert data in the editor, like converting to hex, base64 or to generate new data like current timestamps or random strings, etc.

Main Features

  • Generators and converters available in the form of scripts
  • Extendable with custom scripts
  • Local webserver with request logging
  • File Explorer decorators (and custom decorators)

Demo

Some of the available scripts

Base64 decode Base64 encode Binary To Text
Bip39 Mnemonic CSV to Markdown Count characters
Count words Date to Timestamp Generate Password
HTML Encode (ALL) Hex decode Hex encode
Hex to RGB Identify hash JWT Decode
Join lines Local DateTime Lorem Ipsum
Markdown to HTML Md5 hash New Swissknife Script (JS)
New Swissknife Script (TS) Password strength Pick random
Quoted Printable Decode RGB To Hex RSA Key pair
Random String Request to fetch SHA1 hash
SHA256 hash SHA512 hash Self Signed Certificate
Sort Lines Start Local HTTP Server Start Local HTTPS Server
Stop HTTP Server Text To Binary Text to String
Timestamp to Date To Camel Case To Lower Case
To Morse code To Upper Case UTC DateTime
UUIDv4 Unicode decode Unicode encode (js format)
Unix/Linux Permission To Human Readable Url Decode Url Encode
Url Encode (All Characters) Url Shorten Url Unshorten (url expand)

Usage

You can invoke the dedicated command pallete with ctrl+shift+9 for windows or cmd+shift+9 for mac (when focusing the editor)

The conversions will only use the selected text by default. If no text is selected the entire content of the editor will be used. It supports multi selection and will run the script for each selection individually

On top of the scripts provided swissknife now offers two new features:

  • Copy relative file path with line number - right click on a line in the editor and select "Copy file path with line". Ex output: app/src/android/java/com/myorg/app/ui/File.kt#83
  • Ability to check/uncheck files/folders in the explorer. Right click on a file and select "Toggle: Check File" or "Toggle: Check Folder". A '✓' will show up, identifying that you checked the file/folder

Macbook Touchbar Support

You can also invoke the swissknife extension directly from the macbook's touchbar

Scripts Details

Identify Hash

The outcome of the operation may return multiple values, as a hashes from different algorithms have the same output format. Still we organize the hashes from top down by most relevant.

HTTP(S) Server

The servers log all requests received into the "Output" window of VSCode (You can show it by going to view -> Output in the menu). Then on the right of the window (where usually has the value "Tasks"), filter by "Swissknife Server"

Privacy Note

One of the main purposes of this extension is to stop pasting data, or trusting generated data from random websites. The extension avoids doing external web requests or logging data, for privacy. But there are some operations where external requests are needed:

  • Url Unshorten - This one really needs to do the request to the short url, so it can get the redirect (full) url. But keep in mind that the full url is never reached, the extension does not follow the redirect.

Writing Scripts

You can quite easily create your own scripts, without the need to dig through the code of the extension. Just create a file and drop it in the "Scripts" folder.

Check how to do it here

Decorators

You can use decorators to identify files in the explorer. You can create custom decorators and guess what, emojis are allowed. You can copy them from here.

Due to a limitation in vscode extension system AFAIK, I can't allow users to extend the menu with their own decorators, so you always need to go through the "Custom" option to use other decorators

Decorators

Future Plans

  • Create unit tests, specially for the scripts
  • Start doing proper error handlings
  • Create a place for user contributed scripts
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2022 Microsoft