Skip to content

πŸ›  Run multiple terminals (or iTerm split panes) at once

Notifications You must be signed in to change notification settings

iamssen/multiplerun

Folders and files

NameName
Last commit message
Last commit date
Jul 23, 2024
Jul 23, 2024
Jul 23, 2024
Jan 19, 2019
Jul 23, 2024
Jul 23, 2024
Jul 23, 2024
Jul 23, 2024
Feb 20, 2021
Jul 23, 2024
Jul 23, 2024
Jan 22, 2025
Jan 22, 2025
Jul 23, 2024
Jul 23, 2024

Repository files navigation

Run multiple terminals (or iTerm split panes) at once

If you have installed iTerm.app on your Mac. Your iTerm will opened like this.

iTerm example

If you don't have iTerm, those commands will be executed via default terminal app (cmd.exe or Terminal.app)

Usage

And add config

test:
  - echo multiplerun!
  - - echo hello
    - echo world
npx multiplerun test

Usage on package.json

npm install multiplerun --save-dev

And add config to your package.json

{
  "name": "some-package",
  "scripts": {
    "multiplerun-test": "multiplerun test"
  },
  "multiplerun": {
    "test": ["echo multiplerun!", ["echo hello", "echo world"]]
  }
}
npm run multiplerun-test

Run in script

import multiplerun from 'multiplerun';

multiplerun(['echo multiplerun!', ['echo hello', 'echo world']]);

API

export type Command = { command: string; wait: number; cwd: string };

export type Commands = (Command | Command[])[];

export type ConfigCommand =
  | string
  | { command: string; wait?: number; cwd?: string };

export type ConfigCommands = (ConfigCommand | ConfigCommand[])[];

export type Options = {
  cwd?: string;
};
function multiplerun(commands: ConfigCommands, options?: Options);