👋 Hello! I'm Dmitry
Full Stack Web-Developer
and Product Manager
Blog

Automate workflow and have helper scripts 😲

Wednesday, April 22, 2020
Automate workflow and have helper scripts 😲

When using *NIX you have an option of creating usefull CLI aliases. Under Windows it can be done by creating batch files in globally accessed folder. Here are some of my batch files that you might find usefull.

Dependencies

You should have VS Code and ImageMagick installed. Also get ffmpeg binaries. Don't forget to add binaries paths to Windows Environment Path variable.

Installation

Clone repo to c:\bin\cmds

git clone https://github.com/ossipov/cmds.git c:\bin\cmds

Edit User's Windows Environment variables:

Press Win + S, type env, choose — "Edit Environment Variables for your account"

Add new variable:

Variable name: cmds
Variable value: c:\bin\cmds

Add to Path variable: %cmds%
Don't forget to restart your terminal

Available cmds

+ file_name — create empty file and open it in VSCode
++ dir_name — create new directory and cd into it
- file_name — remove file
-- dir_name — remove directory and all files recursively
l — lists all folders and files in directory
hosts — edit hosts file
hs — homestead alias that you can run from any directory
hsconf — edit homestead config
sshconf — edit ssh config
win1251 — Sets the active code page to Windows-1251
utf8 — Sets the active code page to utf8
newpsd file_name — create new psd file
newai file_name — create new ai file
concatavi — concatenate all *.avi files in a directory
h264mp4 — put all *.h264 inside *.mp4
resize 800x600 — resizes all jpg files in a directory
optjpg — optimizes all jpg files