frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Runprompt – run .prompt files from the command line

https://github.com/chr15m/runprompt
38•chr15m•2h ago
I built a single-file Python script that lets you run LLM prompts from the command line with templating, structured outputs, and the ability to chain prompts together.

When I discovered Google's Dotprompt format (frontmatter + Handlebars templates), I realized it was perfect for something I'd been wanting: treating prompts as first-class programs you can pipe together Unix-style. Google uses Dotprompt in Firebase Genkit and I wanted something simpler - just run a .prompt file directly on the command line.

Here's what it looks like:

--- model: anthropic/claude-sonnet-4-20250514 output: format: json schema: sentiment: string, positive/negative/neutral confidence: number, 0-1 score --- Analyze the sentiment of: {{STDIN}}

Running it:

cat reviews.txt | ./runprompt sentiment.prompt | jq '.sentiment'

The things I think are interesting:

* Structured output schemas: Define JSON schemas in the frontmatter using a simple `field: type, description` syntax. The LLM reliably returns valid JSON you can pipe to other tools.

* Prompt chaining: Pipe JSON output from one prompt as template variables into the next. This makes it easy to build multi-step agentic workflows as simple shell pipelines.

* Zero dependencies: It's a single Python file that uses only stdlib. Just curl it down and run it.

* Provider agnostic: Works with Anthropic, OpenAI, Google AI, and OpenRouter (which gives you access to dozens of models through one API key).

You can use it to automate things like extracting structured data from unstructured text, generating reports from logs, and building small agentic workflows without spinning up a whole framework.

Would love your feedback, and PRs are most welcome!

Comments

dymk•1h ago
Can the base URL be overridden so I can point it at eg Ollama or any other OpenAI compatible endpoint? I’d love to use this with local LLMs, for the speed and privacy boost.
jedbrooke•53m ago
https://github.com/chr15m/runprompt/blob/main/runprompt#L9

seems like it would be, just swap the openai url here or add a new one

cedws•55m ago
Can it be made to be directly executable with a shebang line?
_joel•43m ago
it already has one - https://github.com/chr15m/runprompt/blob/main/runprompt#L1

If you curl/wget a script, you still need to chmod +x it. Git doesn't have this issue as it retains the file metadata.

vidarh•12m ago
I'm assuming the intent was to as if the *.prompt files could have a shebang line.

   #!/bin/env runprompt
   ---
   .frontmatter...
   ---
   
   The prompt.
Would be a lot nicer, as then you can just +x the prompt file itself.
cootsnuck•50m ago
This is pretty cool. I like using snippets to run little scripts I have in the terminal (I use Alfred a lot on macOS). And right now I just manually do LLM requests in the scripts if needed, but I'd actually rather have a small library of prompts and then be able to pipe inputs and outputs between different scripts. This seems pretty perfect for that.

I wasn't aware of the whole ".prompt" format, but it makes a lot of sense.

Very neat. These are the kinds of tools I love to see. Functional and useful, not trying to be "the next big thing".

orliesaurus•37m ago
Why this over md files I already make and can be read by any agent CLI ( Claude, Gemini, codex, etc)?
swah•17m ago
Thats pretty good, now lets see simonw's one...
__MatrixMan__•16m ago
It would be cool if there were some cache (invalidated by hand, potentially distributed across many users) so we could get consistent results while iterating on the later stages of the pipeline.

Show HN: Runprompt – run .prompt files from the command line

https://github.com/chr15m/runprompt
38•chr15m•2h ago•9 comments

Show HN: MkSlides – Markdown to slides with a similar workflow to MkDocs

https://github.com/MartenBE/mkslides
26•MartenBE•3h ago•5 comments

Show HN: ZigFormer – An LLM implemented in pure Zig

3•habedi0•32m ago•0 comments

Show HN: SyncKit – Offline-first sync engine (Rust/WASM and TypeScript)

https://github.com/Dancode-188/synckit
10•danbitengo•2h ago•2 comments

Show HN: Era – Open-source local sandbox for AI agents

https://github.com/BinSquare/ERA
47•gregTurri•11h ago•11 comments

Show HN: KiDoom – Running DOOM on PCB Traces

https://www.mikeayles.com/#kidoom
339•mikeayles•1d ago•49 comments

Show HN: Derusted – An open-source programmable HTTPS MitM proxy engine in Rust

https://github.com/kumarimlab/derusted
4•kumaras•3h ago•0 comments

Show HN: Safe-NPM – only install packages that are +90 days old

https://github.com/kevinslin/safe-npm
83•kevinslin•3d ago•53 comments

Show HN: I turned algae into a bio-altimeter and put it on a weather balloon

https://radi8.dev/blog/stratospore/
129•radeeyate•4d ago•13 comments

Show HN: I built an interactive HN Simulator

https://news.ysimulator.run/news
522•johnsillings•2d ago•213 comments

Show HN: PyTorch-World – Modular Library to Build and Train World Models

https://github.com/ParamThakkar123/pytorch-world
2•paramthakkar•6h ago•0 comments

Show HN: Env files aren't meant for storing secrets

https://github.com/BinSquare/envmap
2•binsquare•6h ago•0 comments

Show HN: Yolodex – real-time customer enrichment API

https://api.yolodex.ai
35•hazzadous•3d ago•22 comments

Show HN: MakeSkill – The Intelligent Skill Builder for Claude

https://makeskill.cc
9•thanhdongnguyen•12h ago•2 comments

Show HN: We built an open source, zero webhooks payment processor

https://github.com/flowglad/flowglad
385•agreeahmed•1d ago•213 comments

Show HN: Anthony Bourdain's Lost Li.st's

https://bourdain.greg.technology/
19•gregsadetsky•1d ago•5 comments

Show HN: I wrote a minimal memory allocator in C

https://github.com/t9nzin/memory
135•t9nzin•3d ago•32 comments

Show HN: OCR Arena – A playground for OCR models

https://www.ocrarena.ai/battle
214•kbyatnal•6d ago•62 comments

Show HN: Stun LLMs with thousands of invisible Unicode characters

https://gibberifier.com
200•wdpatti•3d ago•109 comments

Show HN: Cynthia – Reliably play MIDI music files – MIT / Portable / Windows

https://www.blaizenterprises.com/cynthia.html
86•blaiz2025•3d ago•33 comments

Show HN: Zephyr3D – TypeScript WebGPU/WebGL 3D engine with an in‑browser editor

https://zephyr3d.org
3•gavinyork•1d ago•0 comments

Show HN: Datamorph – A clean JSON ⇄ CSV converter with auto-detect

https://datamorphio.vercel.app
23•sumit_entr42•6d ago•9 comments

Show HN: White-Box-Coder – AI that self-reviews and fixes its own code"

https://github.com/EMMA019/WHITE-BOX-CODER
3•tarocha1019•18h ago•0 comments

Show HN: ChatIndex – A Lossless Memory System for AI Agents

16•LoMoGan•1d ago•5 comments

Show HN: Build the habit of writing meaningful commit messages

https://github.com/arpxspace/smartcommit
109•Aplikethewatch•4d ago•131 comments

Show HN: We cut RAG latency ~2× by switching embedding model

https://www.myclone.is/blog/voyage-embedding-migration/
25•vira28•2d ago•4 comments

Show HN: Wealthfolio 2.0- Open source investment tracker. Now Mobile and Docker

https://wealthfolio.app/?v=2.0
673•a-fadil•6d ago•213 comments

Show HN: Infinite scroll AI logo generator built with Nano Banana

https://durable.co/ai-logo-generator
3•rookhack•21h ago•0 comments

Show HN: Forty.News – Daily news, but on a 40-year delay

https://forty.news
438•foxbarrington•4d ago•179 comments

Show HN: Ghostty-Web – Ghostty in the Browser

https://github.com/coder/ghostty-web
11•jonayers_•23h ago•4 comments