# in your .zshrc or .bashrc: function npm-do { (PATH=$(npm bin):$PATH; eval $@;) } # restart zsh of course # inside your project directory: npm-do tsc --init npm-do figlet hi # or whatever