iterm2-tier
v0.1.7
Published
Tile multiple commands into iTerm2 split panes
Readme
tier
Tile multiple commands into iTerm2 split panes. Opens a new tab and runs each command in its own pane, arranged top to bottom.
Install
npm
npm install -g iterm2-tierFrom source
git clone https://github.com/koyeo/iterm2-tier.git
cd iterm2-tier
npm install
npm install -g .Usage
Basic (string format)
tier -c "npm run dev" -c "npm run test"JSON format
tier -c '{"exec":"npm run dev"}' -c '{"exec":"npm test","waitPort":3000}'JSON fields:
exec(required): command to executesleep(optional): delay N seconds before executingwaitPort(optional): wait for a port to become availablewaitFile(optional): wait for a file to appear before executing
Multiple wait conditions can be combined. Execution order: sleep → waitPort → waitFile → exec
Wait conditions
# Server starts first, tests wait for port 3000
tier -c '{"exec":"npm run dev"}' -c '{"exec":"npm test","waitPort":3000}'
# Delay 5 seconds
tier -c '{"exec":"npm run dev"}' -c '{"exec":"npm test","sleep":5}'
# Wait for build output
tier -c '{"exec":"npm run build"}' -c '{"exec":"npm start","waitFile":"dist/index.js"}'Config file (-f)
Load commands from a JSON file:
{
"dir": ".",
"commands": [
"htop",
{"exec": "npm run dev"},
{"exec": "npm test", "waitPort": 3000}
]
}dir(optional): working directory, relative paths resolve from the config file's locationcommands: array of commands (string or JSON object)
# Load from file
tier -f tier.json
# File + extra commands (file commands first, -c appended)
tier -f tier.json -c "htop"Working directory (-d)
tier -d /path/to/project -c "npm run dev" -c "npm test"Priority: CLI -d > config file dir > current directory.
Requirements
- macOS
- iTerm2
- Node.js >= 18
License
MIT
