2.3 KiB
2.3 KiB
workflow-miner
A Rust CLI + zsh plugin that automatically discovers recurring multi-step command workflows from your Atuin shell history.
The Problem
Developers repeat multi-step command sequences daily — debug cycles, deploy flows, environment setup — but no tool detects or remembers them. Everything today is either single-command prediction (McFly) or manually authored runbooks (Just, Task, Make). The gap between "I keep doing this manually" and "I should write a script for this" remains wide open.
How It Works
- Ingest — Reads Atuin's SQLite history database (read-only) with full context: command, cwd, session, exit code, duration, timestamps
- Abstract — Normalizes commands for pattern matching (
git commit -m "fix typo"→git commit -m <arg>) - Mine — Applies PrefixSpan sequential pattern mining to find recurring command sequences across sessions
- Score — Ranks workflows by frequency, recency, consistency, and context specificity
- Surface — Exports as Justfile recipes, JSON/YAML catalogs, interactive TUI dashboard, or inline zsh suggestions
Planned Features
wfm scan— Mine workflows from Atuin historywfm list— List discovered workflows, ranked by relevancewfm show <id>— Inspect a workflow in detailwfm suggest— Context-aware "what should I do next?" suggestionswfm export justfile|json|yaml— Export workflows as reusable recipeswfm tui— Interactive dashboard for browsing and managing workflowswfm describe— Optional LLM-powered naming and descriptions (fully local by default)- zsh plugin — Inline suggestions via keybinding or ambient mode
Status
Early design phase. See docs/ for architecture and research notes.
Prior Art
- ShRec (Huawei, 2024) — Proved sequential pattern mining on shell history extracts real workflows. Research only, not shipped as a tool.
- Atuin — Shell history storage layer this project builds on.
- McFly — Neural net single-command prediction. No multi-step workflows.
- PrefixSpan — The sequential pattern mining algorithm at the core.
License
TBD