cross-platform library to execute commands in a new shells
npm install newshell
> When you have many cli apps that takes the whole terminal, it's useful to run them all with a single command
- 👯♂️ Attempts to use the current terminal
- 🌏 Cross-platform
- 📄 Runs js files with node
- 🗃 Opens the new shell in current working directory
- 🎛 Supports spliting with iterm2
#### Run a command in a new shell
> prints "hello world" in a new shell window
``sh`
newshell "echo 'hello world'"
> The new shell will run in the same working directory.
`shSee for yourself 👀
newshell pwd
`
> You can run multiple shells
`sh`
newshell "npx tsc --watch" "npx jest --watch"
`sh`
newshell --file "./script.sh"
> Supports running node for javascript files
`sh`
newshell --file "./script.js"
> has the same capabilities of the cli
`ts`
command(script: string, options: Options): void
`ts`
type Options = {
env?: Record
split?: boolean = false;
splitDirection?: string = "verticaly";
terminalApp?: string | undefined = $TERM_PROGRAM;
};
> similar to --file
`ts`
file(scriptPath: string): void
- Run npm scripts in a new terminal (and resolve bins from the node_modules/.bin directory)child_process.fork`)
- Controll the focus of the terminal window
- Pass environment parameters from the CLI
- Manage IPC with the other terminal window (similar to