imake

command module
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 24 Imported by: 0

README

imake

An interactive make companion, two tools in one binary:

  • imake — a TUI that lists your Makefile targets; pick one and run it.
  • imake <group> — a k9s-inspired task runner: define named command groups in imake.yml, run them concurrently, watch their logs side by side, and click or press Enter to drop into any task's shell.

Install

go install github.com/gshireesh/imake@latest

Or from a checkout:

make install

Task runner

Create an imake.yml (or imake.yaml) describing named command groups. A task is either a plain command string or an object with lifecycle hooks:

dev:
  ui: cd discover && pnpm dev
  backend:
    command: cd backend && go run cmd/main.go
    before: echo "starting backend..."
    timeout: 10000            # ms; kills the command if it runs longer
    on_timeout: echo "timed out"
    on_error: echo "failed"
    on_success: echo "ok"
    after: echo "done"
    restart_policy: on-failure  # always | on-failure | never (default)
    keep_shell: true            # drop into an interactive shell after the command

Then run the group:

imake dev

Each task runs on its own pty behind a real terminal emulator (midterm), so full-screen child TUIs — turbo, vite, vim, htop, fancy shell prompts — render correctly instead of turning into escape-code soup. The left panel lists tasks with live status ( running, interactive shell, ok, failed, stopped); the right panel shows the selected task's live screen. Scrolling up switches the pane to a line-based history buffer (copy mode); b or scrolling to the bottom returns to the live screen.

Keys & mouse
Input Action
/, j/k, wheel over sidebar move selection
/h, /l collapse / expand the group under the cursor
click task row select task (click a group header to toggle it)
Enter, i, click log panel attach — keys go to the task's shell
Esc, Ctrl+\ detach
wheel over logs, u/d, U/D, t/b scroll / page / top / bottom
r run / restart the selected task (stops it first if running)
x stop the selected task
q, Ctrl+C quit (stops all tasks)

With keep_shell: true the task ends in a real interactive shell ($SHELL), so attaching gives you a prompt in that task's context — handy for rerunning dev servers, inspecting state, or poking at a failed build.

Lifecycle

Per run, a task executes: beforecommand (with optional timeout) → on_success/on_error/on_timeoutafter → optional keep_shell shell. restart_policy: always reruns the cycle when it ends; on-failure reruns only after a failure or timeout.

Tasks sharing a group are shown under a collapsible ▾ group header, and tasks are nested under the dependency they wait for with tree connectors (├──/└──), so the sidebar reads like tree output.

Tasks with triggers: manual show as and wait until you press r. Tasks with depends_on show as and start automatically once every dependency has finished with success (manual tasks always need r). Dependency cycles and unknown names are rejected at startup.

Plain mode

imake -p <group> skips the TUI and streams all tasks with name-prefixed output — useful for CI logs. Lifecycle hooks other than command are ignored in plain mode.

See examples/simple, examples/lifecycle, examples/manual and examples/grouped for configs.

Makefile TUI

Run imake with no arguments in a directory containing a Makefile: arrow keys to select a target, Enter to run it, Ctrl-C to quit. Target docs (text after ##) show in the help pane.

Debugging

Set IMAKE_DEBUG=/tmp/imake.log to write key/message traces while the task runner TUI is open.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL