smartpipe: semantic pipes for your terminal
Authors/Creators
Description
[1.4.0] — 2026-07-10
The identity release.
Knowledge graphs (the highlight)
The showcase: a full verb page with the modality matrix and a live-rendering Mermaid sample, a cookbook chapter written from real runs against the downloadable playground corpus, the README highlight with a screenshot of the case graph, agent SKILL recipes, and
graphon the welcome screen. Found en route: the playground download in the docs pointed at the source tarball (no media inside) - all three sites now fetch the actual 26 MB release asset.smartpipe graph --fastturns a corpus into a knowledge graph for exactly $0. A local zero-shot NER model (GLiNER-small over ONNX - no new dependencies, no torch, a one-time ~190 MB download like the local embedder) finds YOUR entity types (--entities "person, vessel, account"), entities co-occurring in a window become weighted edges, near-duplicate names fold into one node (disclosed), and every edge carries itssources- the files, pages, and minutes where it was seen. Zero model calls, pinned by test. Free transcripts (local whisper) mean audio and video speech join the graph; scans and images wait for the paid mode, counted out loud.Six ways out, all deterministic:
.graphml(Gephi),.dot(Graphviz),.mmd(Mermaid),nodes.csv+edges.csv(Neo4j/Kuzu), a self-contained interactive.html(search, weight slider, hover cards with clickablefile://evidence links), or a trailing/for an Obsidian vault of wikilinked entity notes.A focus prompt buys named relations.
smartpipe graph "people, orgs, and money flows" case/**/*extracts typed triples per chunk through the full multimodal ladders - vision, OCR, native video - with--entities/--relationscompiling to enums when you want a strict ontology. The cost plan prints BEFORE any spend (~810 extraction calls; belt is 500 - the graph will be partial), a terminal decline exits clean at zero calls, and a belted run drains to a valid partial graph at exit 1, never a fake success.The hybrid ladder:
--name-top 200. The free pass finds the candidates; the model names only the strongest links - one call per edge, and if the belt runs out the remainder keeps its honestco-occurslabel, disclosed. Free graph in seconds; name the top edges for cents.Bring your own edges. Records with
{source, target}or{subject, relation, object}on stdin skip extraction entirely - canonicalize, fold, serialize. Your ownextendpipeline is the power path.
The item — one law for everything in a pipe
Nested field paths, everywhere you read.
where 'user.plan == "pro"',sort --by metrics.score,chart items[0].category,summarize 'avg(metrics.score) by user.plan', and"Is {user.plan} worth it?"in prompts - one grammar (a.b.c,items[0],a.b['weird key']) across all five surfaces. A column literally nameduser.planalways wins over the traversal, so CSV headers with dots keep working. Extraction names stay flat - paths are for reading, and the error says so.Dates are a type, and they come back ISO.
{due date}and{ts datetime}join the brace grammar. However the model phrases it ("Jan 15, 2026", "15/01/2026"), the field canonicalizes toYYYY-MM-DD/ full ISO-8601 - offsets preserved, never invented; genuinely ambiguous slash-dates read month-first and say so on stderr. Downstream just works:where 'due >= "2026-01-01"'compares temporally,sort --by dueorders by instant, andsummarize 'count() by bin(due, 1d)'buckets date-only values.The model sees your data framed, not dumped. Every item payload now arrives inside an
<input>fence - records rendered as clean YAML-ish (the__plumbing excluded), text as itself. The instruction can no longer blur into the data, and the fence is the foundation the planned request-batching builds on.CSV is a first-class row format.
--as csv(and.csv/.tsvextension defaults - tab dialect for.tsv) reads the header row as field names and streams every data row as a record, with per-cell int → float → string coercion and multi-line quoted cells handled. A ragged row is a loud error naming the file and physical line; rows carry__source {"as": "csv", "line": N}. Works on stdin too, and.semfiles gain theaskey.Malformed model replies repair for free before they cost money. A structured reply that fails to parse now passes through a deterministic fixer first - code fences, JSON-island extraction, Python-repr literals, trailing commas, quote fixes, all validated by an actual parse - and only escalates to the paid model-repair round trip when that fails. Disclosed once per run:
note: N replies repaired deterministically (fences/commas/quotes).The
__metadata spine. Tool metadata lives in a reserved double-underscore namespace that rides every record:__source(path plus HOW the item was cut - file, lines, jsonl, pages, minutes, segment index),__media(one transport object for bytes crossing a pipe),__score(top_k and join similarity),__rank(top_k),__snapshot(top_k --stream markers),__distance(outliers),__invalid/__error/__raw(kept failures). Known fields round-trip through saved files; unknown__fields warn once and carry. User data owns everything up to one leading underscore - which is why the last single-underscore stragglers moved: pre-1.4top_k/outlierswrote_score/_rank/_snapshot/_distance, and those spellings stay readable for one release (CSV/TSV still sort them into the trailing columns) but are never written again. In the same sweep,cluster --explodeoverwriting an existingclusterfield became a disclosed overwrite (one stderr warning) instead of a silent one.top_k ranks can no longer collide. Ranking keyed on each item's source index, so two page-1 records from different PDFs fought over one slot and a result silently vanished. Ranks are now run-scoped ordinals in arrival order, in both the embedded and precomputed-vector paths.
Records in, records out. A plain-prompt
mapover records now returns a record ({"result": …}plus the spine) instead of bare prose - structure and provenance survive transformation. Text lines still leave as text.The
--asingestion dial (file|lines|jsonl) on every input verb. Auto defaults:.jsonlmeans rows (loud per-line errors on non-JSON), everything else means whole-document; stdin keeps per-line sniffing;--as fileslurps stdin whole (new). Media files refuse text granularities with signposts tosplit.The binary is the reader.
smartpipe report.pdf | …- a first argument that exists on disk streams items; verbs always win names,./namedisambiguates. Every input verb also takes positional FILE arguments;--insurvives as a hidden alias.write— the egress mirror. Items route to files by template ({name},{stem},{index}, any record field for content fan-out); egress mirrors ingress via the spine - whole-file items become files, line/row items reassemble into their sources in original order. Emits written paths so pipes continue. Text-only records leave as plain text.readable— the human door. The same YAML-ish renderer as the TTY preview, as an explicit pipe stage: nesting indented, lists bulleted, multi-line strings as block scalars, spine dimmed, long values truncated with counts (--fullto disable), media summarized (image/png (48 KB))- never base64. Piped machine output is untouched JSONL;
--barestrips the spine from it.
- never base64. Piped machine output is untouched JSONL;
Mixed streams are visible. A kind census notes mixed inputs;
where/summarizereport rows that had no fields;--strict-rowsturns the notes into errors. Multi-line plain output into a pipe warns that line framing is ambiguous (use--output json)..semfiles are strict about their rows now. A saved pipeline is a program, and a stray plain line in a record stream is a bug, not a shrug:.semruns default to--strict-rowsand fail at ingestion naming the exact line, before any spend. Opt out withstrict-rows = false(top-level or per-stage); ad-hoc terminal runs keep the permissive census. Eleven verbs that accepted--strict-rowswithout actually enforcing it now do, and a text-onlywherepredicate over a log no longer trips strict mode over "missing fields". A new docs page explains the granularity ladder (file → split → lines/rows) and when mixing happens.Synthesized records tell you what they summarize. join pairs carry
__sources(both parents' refs); reduce windows stamp{"as": "window", "span": [1, 100], "count": 100}, groups{"as": "group", "group": …, "count": N}; cluster and diff summary rows carry{"as": "cluster"|"diff", "count": N}. An audit trail for every row that speaks for other rows - and--barestrips all of it.
Judgment you can gate, retry, and keep
--keep-invalid(map/extend): after the repair retry fails, keep the failure as one JSON row (__invalid/__error/__raw) instead of a skip- dim one-liner at a TTY, full row when piped.
smartpipe schema- the free rungs: compile braces/DSL to JSON Schema,--check FILEvalidates rows (exit 0/1),--exampleprints a validating instance, bare stdin mode is a REPL.--dry-run(map/extend) prints the composed first request and exits before any model resolution.schema --checkstopped failing your own pipelines. The check is open-world now: rows from the documented extend workflow (original fields kept, spine aboard) pass instead of tripping "additional properties are not allowed" on every row, and?-marked fields may be absent, not just null. Extras earn one dim hint;--strictrestores the closed world for contract enforcement. The schema sent to models at extraction time is unchanged.- Nullability is declared.
?on any type (string?,number[]?, barefield?) compiles to a null union; bare fields mean scalar-or-scalar-list and never admit null (D48, shipped earlier in this cycle). - Circuit breaker +
fallback-model. Five consecutive transport failures stop the run with a provider-down screen (SMARTPIPE_BREAKERtunes; 0 disables) - or, with a configured fallback, the run switches chat models wholesale, re-runs the failed window on the successor, and the receipt splits counts per model. Embedding fallback is refused (one vector space per run). One fallback, no chains. - Deterministic rungs.
join --on 'left.K == right.K'alone is a free key-equality join (all kinds,--unmatched); with a prompt it becomes blocking - equality narrows pairs, the judge reasons within blocks, the receipt reports pairs avoided.distinct --exactfolds byte/value duplicates only (records canonicalized, media hashed by bytes) - zero model calls. Verb tables mark the free rungs.
The terminal behaves
- A real progress bar. When the total is knowable (file lists), the
status line becomes
[██████░░░░░░░░░] 41% · 205/500 · 12/s · ~25s left- fill and percent truncate so 100% is earned, the ETA appears once the first item completes, ASCII terminals get[=====>....], and multi-stage runs prefix the stage name. Streams keep the count-and-rate line: atail -fhas no percent. - Braces extract lists of objects.
{events {name string, when date, severity enum(low, high)}[]}pulls every event out of an item in one call, typed and validated - inner dates still canonicalize to ISO,--explode eventsturns the list into one row each. One level deep by design; deeper nesting faults free at parse time with the two-pass hint. - Result writes pause/erase/redraw the status line under an arbiter - the spinner can never interleave with output again. Only the final pipe stage (stdout a TTY) animates; mid-pipe stages stay line-atomic.
- Records render at the TTY as YAML-ish blocks. The welcome screen links docs, cookbook, and issues. The wizard offers to install shell completions (consented, idempotent).
chartre-platformed: plotext draws the terminal, matplotlib renders--save. TTY bars get color (cyan bars, green time-series); piped orNO_COLORoutput keeps the plain-ASCII contract byte-for-byte.--savenow writes SVG or PNG by extension (identity-styled, deterministic output); svgwrite - unmaintained since 2022 - leaves the tree. Both libraries ship in core per the no-extras rule; imports stay function-local so startup holds. The run receipt now readsrun: ↑40 ↓25 tok(arrows for in/out). The wizard validates model names before saving (two strikes, then a typed fault), prints completions before the paste-bait "Try it" line, prefers a sensible local default over alphabetical luck (cloud tags compete equally), and speaks in the same color voice as the other commands with a menu of detected local tags and provider-prefixed cloud examples.- Exit 141 is now deliberate, and the -13 flake is dead. smartpipe used
to arm the default SIGPIPE handler, so a downstream
| headkilled it by raw signal - and, one run in a few hundred, a stray EPIPE on asyncio's own self-pipe killed a healthy run mid-teardown, skipping the receipt (the CI flake that delayed rc3). SIGPIPE now stays ignored; a closed stdout surfaces as BrokenPipeError and exits a silent, deliberate 141 with every finally honored. (click 8.4's own EPIPE-to-exit-1 trap is defused on the way.) One visible delta:kill -PIPEno longer terminates smartpipe; pipeline behavior is unchanged. - A files-then-stdin wait has a name. Chaining positional files into a
stdin read used to end in a silent hang when nothing was piped. All three
chain paths now say once, on stderr:
note: files done - now reading stdin (pipe data or close it; files-only: add < /dev/null). - Docs bug, live-caught:
cluster | chartdrew flat bars. The summary rows are one-per-cluster, so charting them counts every theme once. The README quick-tour step, theclusterhelp epilog, and the.sempipeline example now routecluster --explode membersintochart cluster --top 8, which draws real sizes.
Every example, run for real
mapandextendrecords finally carry their provenance. The__sourcespine - the law said it rides every record - was being dropped by braces extraction: a reader-stamped row went in with{"path", "as", "line"}and came out with only the extracted fields. Every record leavingmap/extendnow carries__source(incoming spines adopted verbatim, fresh ones stamped from the item's provenance), which also means the terminal preview now shows the dim file-and-line origin under each block.--barestill strips it.- Docs truth sweep (owner-reported): four
echo "... $1250"examples silently shell-expanded to "250" - single-quoted; text files are declared one-item-per-line at first use; "everything outside the braces is the instruction" stated wherever braces are taught; typed braces are the norm across the examples; the playground corpus is linked from README, docs home, and the cookbook; the demo video plays on the docs front page. - Row cuts keep their rows through
filterandtop_k. The grep-l contract (match whole files, get paths back) leaked onto--as jsonl/--as linesrows read from a positional file: every matching ROW came out as the filename. Both verbs now key path-back on the whole-file cut; rows pass through as records. Found by a zero-context agent driving smartpipe purely from SKILL.md; pinned in tests both ways. - The docs were audited by executing them: all 236 example blocks
(README, docs, SKILL files, CLI help) inventoried, statically checked,
and ~105 run verbatim against a generated corpus of real-format files.
Three code bugs surfaced and are fixed with pinning tests:
- Quoted globs reach the reader.
smartpipe 'logs/*.jsonl'- a documented form - exited 64 ("no verb"); unexpanded glob tokens now route to reader mode, and an unmatched glob errs loudly. - Video is refused pre-send on wires that can't watch. The
ChatGPT-login (codex) and anthropic adapters silently dropped video
parts and sent prompt-only requests - the model answered "no video
provided", no degraded note fired, and video-RAG examples embedded
that refusal prose as vectors. Both wires now raise before sending,
so the documented ladder (
degraded: … video → frames+audio) actually engages. - 7 broken and 12 misleading example sites corrected against observed
behavior (SKILL files now run verbatim; the
.semkey table is re-derived from the runtime's own validation errors;__scorespelling; stale "oversized items are refused" claims rewritten for auto-chunking).
- Quoted globs reach the reader.
The terminal shows your media
- Every block at the terminal gets a number. The human view opens
each record block with a cyan
#N- so "look at object 5" is a thing you can say. The ordinal is the one handle every output is guaranteed to have (provenance can repeat across rows - fifty pages of one PDF share a path - or be absent on plain text). Display only: piped output is byte-identical. - Media previews at the human view. At a terminal (and through
readable), the first media part of an item now renders under its summary line: images as color thumbnails, video as a three-frame strip sampled at 10/50/90% of its duration (never frame zero - intros are black), audio as a peak-envelope waveform. Audio and video that still live on disk get a clickable▶ play (0:42, 2.1 MB)link (OSC 8 - opens your system player in iTerm2/kitty/WezTerm/Ghostty/Windows Terminal). Piped output, JSONL, NO_COLOR, and--bareare byte-identical to before - previews exist only where a human is looking.smartpipe config media-previews offturns them off.
Documents parse where they enter, vectors stay honest
- The
ocr-modelrole: a document parser at ingestion. Setocr-model = "mistral/mistral-ocr-latest"in config.toml (the setup flow's OCR stage stamps it;SMARTPIPE_OCR_MODELand--ocr-modeloverride per run) and ingested PDFs and images parse through it - one item per page on thepagescut, markdown as the text, disclosed per row and metered as a paid conversion. Mistral refs ride the dedicated/v1/ocrwire (live-verified, whole PDFs in one call); any other model ref works as chat-vision with extract-the-text framing, soollama/llavais a free local OCR. Parse failures fall back to the local extraction ladder, disclosed, never fatal. Unset = exactly the old behavior. - Reader mode does what you configured.
smartpipe scan.pdfused to be pinned "zero model calls" even when you had set an ocr-model - the reader now honors the role with the same per-row disclosure, local fallback, and--max-callsbelt as the verbs (plus a preflight note when more than 20 files will parse). No ocr-model configured = the same free path as always, pinned by a zero-HTTP-calls test. Found en route: the mistral OCR wire was never counted by--max-callsanywhere - it is belted now. - The
media-embed-modelrole: one joint space for pixels and prose. Text keepsembed-model; media routes to the joint-space model (jina-clip-v2 and friends). If a run would mix two vector spaces, the geometry fence stops it with exit 64 BEFORE any spend, naming both models and both fixes. A text query now ranks an image corpus in the joint space - that is the point. - Embed rows carry their provenance. Output rows are now
{"text", "vector", "__embedder", "__source"}- the spine like every other verb, plus the model that made the vector.top_krefuses a corpus whose stamp disagrees with the query's embedder (the same-dimensions-different-model trap), and reads old-style rows for one release. Two bugs died en route: records piped from the reader embedded their serialized JSON instead of their content text, and--max-callssilently demoted pixels to captions by stripping the media-embedding capability.
Setup that reads the room
Rich now backs
config showanddoctor. It is a deliberate core dependency under the no-extras policy, imported only while those human-facing screens render so--help, pipes, andNO_COLORkeep their existing contracts.The interactive config wizard can go backward. Model, embedding, OCR, and final review screens expose explicit Back rows; returning to a stage restores its pre-stage checkpoint, and typed model prompts accept
back,b,no, orninstead of accidentally savingollama/n.Discarding config is terminal and interruption is ordinary. Choosing discard no longer opens the shell-completion prompt after saying "Not saved"; Ctrl-C or EOF at any Click prompt exits 130 instead of showing the internal-bug screen.
auth loginnow connects every provider, not just ChatGPT. Pick from the full list - OpenAI appears twice because it really is two wires (API key vs ChatGPT login, and the login wire has no embeddings) - paste your key at a masked prompt after the create-a-key URL, and it validates live before storing (with an honest "store anyway - the provider may be having a bad minute" escape). Keys live at~/.local/share/smartpipe/auth.json, owner-only permissions from the first byte, masked everywhere they surface, and the environment variable always wins.auth listshows what's connected and which source is live;auth logoutremoves.Setup walks three questions in order: text model, embeddings, document OCR. Every stage shows every provider - connected ones badged, unconnected ones connectable inline without leaving the flow. The embedding stage only lists wires that embed; OCR is optional and skippable in one keypress. At the end, one consented verification pass (~5 tiny requests) probes what your models can actually do - and if the basic text check fails, smartpipe reports a setup fault instead of pretending your model lacks modalities. Results feed the capability chips you see in every picker from then on, alongside a public model registry and your own declarations for self-hosted models.
The schema workshop.
smartpipe schemawith no arguments at a terminal opens a small interactive draft loop - your schema pinned up top as colored braces, commands scrolling below:/add name type,/drop,/test data.jsonl(per-field coverage bars against your real rows),/example(a synthetic instance),/save(writes schema.json and prints the paste-ready braces and--schemalines). Zero model calls by construction - iterate freely, commit when the bars are green. Paste any{braces}string to replace the draft. Piped and argument invocations are unchanged.smartpipe configis now a provider-first picker. Detect what's already connected (API keys in the environment, a ChatGPT login, local Ollama), pick a provider, pick from its LIVE model catalog - arrow keys on a real terminal, a numbered prompt everywhere else. Undetected providers show the exactexport ..._API_KEY=line (smartpipe never prompts for or stores a key). Catalogs cache for a day; a failed fetch degrades to typed input with provider-prefixed examples. Picking a provider auto-pairs a coherent embedding model (announced, and never overwrites one you chose yourself), and one y/N question adds a backupfallback-modelfor provider outages. After adoctor --probe, catalog entries carry capability chips (sees, hears - probed 2d ago)- probed facts, never claims.
smartpipe use- setup is one word now.use gemini(oruse claude-opus-4-8,use ollama/qwen3:8b) stamps a coherent bundle in one shot: the model, its paired embedder, and the captions posture, each line disclosed with a ✓ and a reason. No credential for the named provider = a clean refusal that names the exactauth logincommand, nothing stamped. Bareuseopens the interactive flow.smartpipe usinganswers "what am I running?" with every setting, its value, and WHERE it came from (flag, env, config file, default) in one aligned grid. The config.toml you get is signed by its door -# stamped by: smartpipe use (2026-07-10T06:38Z)- so a mystery config explains itself. The old setter subcommands (config model,config embed-model, …) and profiles are gone; an old config with profile keys loads with one warning and cleans itself on the next save.The no-model dead end offers a hand. At a real terminal, the no-model error now ends with
run setup now? [Y/n]- accept, walk the same setup flow, and it closes with "saved - rerun your command". Scripts and CI see byte-identical output to before (the offer is TTY-gated), and the exit code stays honest.
Getting it and keeping it current
- One-line install on every platform.
curl -LsSf https://prabal-rje.github.io/smartpipe/install.sh | sh(macOS/Linux) and theinstall.ps1analog for Windows PowerShell, both published at the docs-site root. The script uses Homebrew when present, otherwise bootstraps uv and runsuv tool install smartpipe-cli;SMARTPIPE_VERSIONpins a version; it ends with a loudsmartpipe --versionverify. brew/uv/pipx/pip remain as explicit alternatives. - The installers survive the real world. Rerunning the one-liner
upgrades in place instead of erroring (brew-, uv-, and
otherwise-managed installs each get the right move); the uv bootstrap
falls back to
wgetwhencurlis missing; Alpine/musl systems get a wheels warning before anything installs; Rosetta-translated macOS shells get an arch hint; GitHub Actions runners get~/.local/binappended toGITHUB_PATH. Footguns adopted from studying opencode's installer.install.shstays readable POSIX sh at 96 lines. smartpipe update. Detects how smartpipe was installed (homebrew, uv tool, pipx, or pip - fingerprinted from the executable path), shows the exact upgrade command, asks consent (--yesskips), runs it, and reports honestly. Unrecognized installs get the per-channel commands instead of a guess.- A calm update notice. At most once a day smartpipe checks PyPI in a
background thread (2 s cap, silent on any failure) and - on a later
run, at a terminal, never in CI, never on stdout - prints one dim line:
note: smartpipe X.Y.Z is available (you have A.B.C) - run: smartpipe update. Rc users aren't nagged about older stables. Off switches:SMARTPIPE_NO_UPDATE_CHECK=1orsmartpipe config update-check off. The welcome screen's utility list now includesupdate.
Docs: a shape, not a pile
- New Learn track (
docs/learn/1…6),concepts/the-item.md(the five laws),concepts/feeding-smartpipe.md(the ingestion chapter), nav regrouped Learn/Verbs/Concepts/Cookbook/Reference, index as mode-router, every example reconciled to the new syntax with outputs from tests, qa/ flows extended (a live walk of which caught and fixed a real write round-trip bug).
Notes
Files
prabal-rje/smartpipe-v1.4.0.zip
Additional details
Related works
- Is supplement to
- Software: https://github.com/prabal-rje/smartpipe/tree/v1.4.0 (URL)
Software
- Repository URL
- https://github.com/prabal-rje/smartpipe