Question about Running a Shell Script

I am trying to automate running a Node app but it is not working

These are the contents of a Shell script called in my Node project directory:


cd /Users/richardkaplan/github-repositories/pubmed-pack

npx coda execute  /Users/richardkaplan/github-repositories/pubmed-pack/pack.ts PubMed 27919949

If open the terminal then from the pubmed-pack directory I can run the script file fine

However if I go to KM and try to execute the script I get an error saying "npx not found"

Execute a Shell Script.kmactions (793 Bytes)


1 Like

Execute a Shell Script provides a pristine vanilla shell
(not the customized one used by
so you need to specify the full path to the executable.

Path in Shell Scripts [Keyboard Maestro Wiki]

use the incantation:

which npx


to find the full path.

See also:

Replicate $PATH From Your Environment to Keyboard Maestro - Macro Library - Keyboard Maestro Discourse


Oh, yes, I remember discovering this the hard way. And then discovering it again. And again.

1 Like