Skip to content
This repository has been archived by the owner on Jul 30, 2023. It is now read-only.
/ slinky Public archive

Run Bash commands from Windows Command Prompt, natively!

License

Notifications You must be signed in to change notification settings

cpdt/slinky

Repository files navigation

Slinky

Super Link, Yo - Run native Linux commands from your Windows shell!

Using Slinky with vim

Slinky allows you to run Linux commands in the Windows shell - instead of having to open up a Bash Windows implementation whenever you need to bash out some scripts, Slinky lets you run those commands straight from your Windows (or Powershell) command prompt.

Slinky requires an implementation of bash to be installed on your computer. If you're running the Windows 10 Aniversary update or later, you can use the in-built Ubuntu for Windows bash. Otherwise, install an alternate tool such as Git Bash/MSYS Bash or Cygwin.

Install

To install Slinky, run the following command in your Bash environment.

bash <(curl https://raw.githubusercontent.com/cpdt/slinky/master/install.sh)

Usage

In your Bash or Windows shell, run the command below to link a command in the Windows prompt to a Bash command (i.e running the command in the Windows prompt will actually run the Bash command).

$ slink [command name]

Alternatively, you can assign a different name to the Windows command by providing two parameters:

$ slink [windows command] [linux command]

Example 1: Link the curl command so it is runnable from Windows:

C:\> slink curl
C:\> curl ...etc...

Example 2: Link Linux's echo command so it is runnable as do-echo from Windows:

C:\> slink do-echo echo
C:\> do-echo ...etc...

Delete a link

You can delete a link with the rmslink command.

$ rmslink [windows command]

Example 1: Remove a link for the curl command:

C:\> rmslink curl

Example 2: Remove a link between Linux's echo command and the do-echo command on Windows:

C:\> rmslink do-echo

List all links

You can view a list of the Windows command names of all commands with the lsslink command.

$ lsslink

Uninstall Slinky

Tired of being awesome and want to go back to being a regular command-prompt user? The delslink command is for you! This command will, as the name suggests, delete Slinky and all related files from your computer. Slinky links will not be kept around, so if you uninstall Slinky and then re-install, you will need to re-create all of your links.

$ delslink

FAQ

Can I create/remove/list Slinky links from the Bash shell?

Yes - the Slinky commands are actually Bash script files, installed by default in /usr/local/bin. As a result, these commands will be available in the Bash shell as long as this installation directory is in your PATH.

Why does the GIF show vim being opened? Is slinky only for vim users?

Now you're just reading too far into the GIF 😉. Vim is being used simply to demonstrate what Slinky does, but this doesn't mean you can't run slink emacs or slink nano or even slink ed and enjoy your favourite terminal editor on Windows.

License

Slinky is licensed under the MIT license, included in the LICENSE file.