Skip to content

blocr is a commandline tool for Windows that lets you define named blocks of commands, each running in its own terminal instance. You can start or terminate all commands in a block with a single command.

License

Notifications You must be signed in to change notification settings

marcuwynu23/blocrun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blocrun

Stars Badge Forks Badge Issues Badge License Badge

A simple CLI tool to define and control groups of commands using block syntax in a `BLOCFILE`. It lets you start and stop named command groups with automatic PID tracking and process control.

✨ Features

  • Block-based grouping of commands
  • Easily run or kill a named group of tasks
  • Track background or sustained processes (e.g. GUI apps, dev servers)
  • Command-type prefix system for flexible control

📦 Installation

npm install -g blocrun

📂 File Structure

Create a BLOCFILE in your project root. This file defines blocks of commands:

dev {
  @ code .
  % vite
  $ echo "Development server launched"
}

build {
  % npm run build
}

🔣 Prefix Symbols

Symbol Description Tracked
@ Sustained (servers, terminal commands, etc) ✅ Yes
% Tracked but auto-closing jobs (e.g. build) ✅ Yes
$ One-off commands (not tracked e.g. gui app) ❌ No

🚀 Usage

Run a block

blocrun run <block-name>

Example:

blocrun run dev

If the block is already running, it will not run again.


Kill a block

blocrun kill <block-name>

This command:

  • Terminates all tracked processes for the block
  • Cleans up the .blocks PID tracking file

📁 File Summary

  • BLOCFILE — Your command block definitions
  • .blocks — Internal file storing tracked PIDs

📘 Full Example: BLOCFILE

dev {
  @ code .
  % npm run dev
  $ echo "Started successfully"
}

build {
  % vite build
}

💡 When to use each symbol

  • @ — GUI or server that should stay alive (cmd /k, VSCode, etc.)
  • % — Script or tool that ends on its own (e.g. vite build)
  • $ — Logging or setup scripts you don’t need to track

🧠 Why use blocrun?

  • Simpler than shell scripts
  • Safer than PM2 for dev use
  • Works on Windows/macOS/Linux
  • Better UX for managing grouped tasks

🧩 License

License here.

About

blocr is a commandline tool for Windows that lets you define named blocks of commands, each running in its own terminal instance. You can start or terminate all commands in a block with a single command.

Resources

License

Stars

Watchers

Forks

Packages

No packages published