Skip to content

jochumdev/mpgr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpgr – mise project manager

mpgr is a small (~100 LoC) Bash wrapper around mise-en-place that provides a central task overlay for many projects.
Tasks live in one place. Projects stay separated. mpgr maps shared tasks onto any project directory using mise’s monorepo mode.

mpgr depends only on mise and uses its experimental_monorepo_root feature.
An example layout is included; typically you copy it to ~/.config/mpgr.


How it works

Each project directory inside your workspace contains:

  • a small mise.toml (usually 2 lines)
  • a mise-tasks/ directory (symlinks to shared tasks)
  • a project identifier path (e.g. dotfiles/hypr, customer-a/ca-project-1)

mpgr scans the workspace and runs tasks for one or many projects.
Tasks run inside the project’s real working directory via MPGR_PROJECT_DIR.


Minimal project setup

Create a directory under your mpgr workspace, then add a minimal mise.toml:

[env]
MPGR_PROJECT_DIR = { value = "{{ env.HOME }}/.config/nvim" }

Add a mise-tasks/ directory and point it to your shared tasks.

Example:

~/.config/mpgr/
  mpgr               # wrapper script
  dotfiles/hypr      # project descriptor (NOT the real code)
    mise.toml
    mise-tasks/ -> ~/git/mpgr/tasks/v0/

Example workspace layout

~/.config/mpgr/
  dotfiles/
    neovim
    hypr
    sway
  customer-a/
    ca-project-1
    ca-project-2
  customer-b/
    ca-project-1
    ca-project-2
  opensource/
    games/
      ta/rl
      bar/bar

Projects may be nested arbitrarily; mpgr treats all leaf directories with a mise.toml as projects.


Usage

Info

Show mpgr + mise info:

mpgr run all info

Editor task

Run editor for a single project:

mpgr run "dotfiles/hypr" editor

Run in its own terminal:

mpgr run "dotfiles/hypr" editor -t

Run for all projects:

mpgr run all editor -t
# or
mpgr run "..." editor -t

Verbose editor info:

mpgr run all editor -v

Debugging

MPGR_VERBOSE=true mpgr run all info
MPGR_TRACE=true   mpgr run all info

Install

Quick install

git clone --depth 1 https://github.com/jochumdev/mpgr.git
repo_dir="$(cd mpgr && pwd)"

cp -pfr mpgr/example ~/.config/mpgr

sed -i -e "s|\$MPGR_WORKSPACE/../mpgr|$repo_dir/mpgr|" ~/.config/mpgr/mpgr

ln -s ~/.config/mpgr/mpgr ~/.local/bin/mpgr

Manual install

Clone:

git clone --depth 1 https://github.com/jochumdev/mpgr.git
mr="$PWD/mpgr"

Copy example workspace:

cp -pfr mpgr/example ~/.config/mpgr
ws="$HOME/.config/mpgr"

Patch wrapper path:

sed -i -e "s|\$MPGR_WORKSPACE/../mpgr|$mr/mpgr|" "$ws/mpgr"
grep "\$MPGR_WORKSPACE/../mpgr" "$ws/mpgr" && echo "FAILED"

Expose wrapper:

ln -s "$ws/mpgr" ~/.local/bin/mpgr

Adjust tasks and project definitions as needed.


Environment variables

Global

Var Default Description
MPGR_TRACE false Trace mode (enables verbose output)
MPGR_VERBOSE false Verbose logging
MPGR_WORKSPACE script-dir mpgr workspace (defaults to directory containing the wrapper)
MPGR_HOME script-dir Directory where mpgr itself lives (~/.config/mpgr by default)
MPGR_PROJECT_DIR "" Real working directory of the project

Task-specific

Var Task Description
MPGR_EDITOR tasks/v0/editor Editor to run
MPGR_TERMINAL tasks/v0/editor Optional terminal tool

Future ideas

  • Portable rewrite (Go/Rust)
  • Autocomplete
  • Dry-run mode
  • CRUD operations for projects
  • CRUD operations for tasks
    mpgr task.{add,create,update,delete} "ta/rl" "mpgr:v0/existing"
  • mpgr self-update (git pull)
  • Community-task source manager

Contributing

PRs and feedback welcome.

License

The Unlicense

About

Workspace-level task manager using mise. One overlay, many projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages