From .prompt to result.
Five steps, a couple of minutes. Everything below runs on Node 18+; provider calls read a key from PROMPTEL_API_KEY or the provider-native env var.
npm install promptel - 01
Install promptel
promptel ships on npm and runs on Node.js 18 or newer. Add it to any project — or run the CLI without installing.
$ npm install promptel - 02
Write a .prompt file
Author the prompt in the DSL: typed params, a body, and a technique block. Params are declared with types and defaults so the executor can refuse a prompt that does not bind.
# summarizer.prompt prompt Summarizer { params { text: string style?: string = "concise" } body { text`Summarize the following in a ${params.style} way: ${params.text}` technique { chainOfThought { step("Read") { text`Identify the key claims` } step("Compress"){ text`State them in two sentences` } } } } constraints { maxTokens: 200; temperature: 0.2 } } - 03
Run it from code
executePrompt takes the source, the params, and options. Choose the provider at call time — the same file runs against OpenAI, Anthropic, or Groq.
import { executePrompt } from 'promptel'; import { readFileSync } from 'node:fs'; const src = readFileSync('summarizer.prompt', 'utf8'); const result = await executePrompt(src, { text: article }, { provider: 'openai' }); console.log(result); - 04
Or run it from the CLI
The promptel CLI executes a prompt against a provider and can write structured results to a file — handy for evals and CI.
$ promptel -f summarizer.prompt -p openai \ --params '{"text":"..."}' -o result.json - 05
Convert between DSL and YAML
The DSL and YAML surfaces are equivalent. Convert either direction with one CLI flag when tooling prefers YAML for schema validation or codegen.
$ promptel --convert yaml -f summarizer.prompt -o summarizer.yml
That's the loop
Read the full docs, browse the feature reference, or see how teams use it.