maki
A cross-platform fuzzy Makefile task finder and runner.
Features
- Fuzzy search - Quickly find and run Makefile targets using an interactive fuzzy finder
- Syntax-highlighted preview - See target contents with syntax highlighting before running
- Variable prompting - Automatically detects required variables and prompts for values
- Cross-platform - Works on Linux, macOS, and Windows
- Smart caching - Caches parsed Makefiles using SHA256 checksums for instant subsequent lookups
- Comment extraction - Automatically extracts target descriptions from comments
- JSON output - Machine-readable output for scripting and integrations
- Recursive scanning - Find Makefiles in subdirectories
Installation
From crates.io
From source
Build from source
# Binary will be at ./target/release/maki
Usage
Interactive Mode (default)
Simply run maki in a directory with a Makefile to start the interactive fuzzy finder:
Use the arrow keys to navigate, type to filter, and press Enter to run the selected target.
Commands
# Interactive fuzzy search (default)
# List all targets
# Run a specific target directly
# Interactive picker (explicit)
Options
| Flag | Description |
|---|---|
-f, --file <FILE> |
Use a custom Makefile |
--all |
Include private targets (starting with _) |
--patterns |
Include pattern rules (e.g., %.o: %.c) |
--json |
Output results as JSON |
--no-ui |
Skip the fuzzy finder UI |
-r, --recursive |
Scan subdirectories for Makefiles |
--dry-run |
Print command without executing |
--cwd <DIR> |
Set the working directory |
--no-cache |
Skip the cache and re-parse Makefiles |
Examples
# List all targets in JSON format
# Include private targets (those starting with _)
# Run a target without actually executing it
# Use a custom Makefile
# Scan all subdirectories for Makefiles
# Force re-parsing (skip cache)
Variable Prompting
Maki automatically detects when a target requires variables and prompts you to enter them.
How It Works
-
From comments - Define hints in your target's comment using
VAR=value|value2|value3:# Bump version (usage: make bump V=patch|minor|major) :When you select this target, maki shows a fuzzy-select menu with the options:
patch,minor,major. -
From recipe - Maki also scans recipe lines for
$(VAR)or${VAR}patterns:# Deploy the application :When you select this target, maki prompts you to enter values for
ENVandVERSION. -
Combined - You can mix both approaches:
# Deploy (usage: make deploy ENV=dev|staging|prod) :This gives you a fuzzy-select for
ENV(with options) and a text prompt forVERSION.
Example Workflow
$ maki
> bump
Selected: bump
? Select value for V:
patch
> minor
major
Running: make bump V=minor
Built-in Variables
Maki automatically ignores common Make built-in variables like CC, CFLAGS, LDFLAGS, $@, $<, $^, etc.
Caching
Maki caches parsed Makefiles to improve performance. The cache:
- Uses SHA256 checksums to detect file changes
- Is stored in your system's cache directory:
- macOS:
~/Library/Caches/maki/ - Linux:
~/.cache/maki/ - Windows:
%LOCALAPPDATA%\maki\
- macOS:
- Is automatically invalidated when the Makefile content changes
- Can be bypassed with
--no-cache
Target Detection
Maki detects targets using the pattern:
target_name: [dependencies]
Comment Extraction
Maki extracts descriptions from:
-
Inline comments using
##:: ## Build the project -
Preceding comments:
# Build the project with optimizations :
Skipped Lines
Maki automatically skips:
- Variable assignments (
VAR := value,VAR ?= value,VAR += value) - Target-specific variables (
target: VAR := value) - Pattern rules (unless
--patternsis used) - Private targets starting with
_(unless--allis used) - Comment lines
- Blank lines
JSON Output
The --json flag outputs targets in this format:
Development
Building
Running Tests
Running with Debug Output
Project Structure
src/
├── main.rs # Application entry point
├── cli.rs # CLI argument parsing (clap)
├── target.rs # Target struct definition
├── makefile.rs # Makefile parsing logic
├── fuzzy.rs # Fuzzy finder UI (skim)
├── executor.rs # Task execution
├── prompt.rs # Variable prompting (dialoguer)
└── cache.rs # SHA-based caching
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE for details.