Stack-up is a simple tool written in JavaScript that allows you to run multiple programs concurrently in the terminal. It is designed to be configurable through a json file, enabling you to specify the programs you want to run, their working directories, and commands.
You can use stack-up without installing it globally by using npx:
npx @fneira/stack-up stack-up.jsonThis will download the latest version of stack-up and run it with the specified stack-up.json file.
You can also install stack-up globally to use it as a command line tool:
npm install -g @fneira/stack-upAfter installing it globally, you can run stack-up from any directory:
stack-up stack-up.jsonBefore using stack-up, ensure you have Node.js installed on your system. You can download it here.
- Clone this repository:
git clone https://github.com/Bubexel/stack-up.gitNavigate to the project directory:
cd stack-upInstall dependencies:
npm installTo use stack-up, you'll need to create a stack-up.json file or name you wish. This file will contain an array of objects, each representing a program you want to run concurrently. Here's an example of json file:
[
{
"name": "My program",
"enabled": true,
"workingDir": "/home/user/myprogram/",
"command": "npm run --prefix {{workingDir}} start"
},
{
"name": "Another program",
"enabled": true,
"workingDir": "/path/to/another/program/",
"command": "cd {{workingDir}} && node index.js"
}
]- name: A descriptive name for your program.
- enabled: Set to true to enable the program to run as default option, or false to disable it.
- workingDir: The working directory where the program should be executed from.
- command: The command to run the program. Use {{workingDir}} as a placeholder for the orkingDir.
You can add as many objects as needed to run multiple programs concurrently.
Once you have your stack-up.json file configured, you can run stack-up:
npm start my-stack-up-file.jsonIf your file name is stack-up.json, you can run it without specifying the file name:
stack-upThis will start all the programs specified in the stack-up.json file concurrently in the same terminal window using the concurrently library.
You can use the --direct or -d flag to execute the enabled programs immediately, without showing the interactive menu. This runs all enabled commands from your configuration file right away, skipping any prompts.
Example:
stack-up stack-up.json --director
stack-up stack-up.json -d- Ferran Neira
This project is licensed under the MIT License - see the LICENSE file for details.