evoke

Examples · 04 of 06

Run the clear requests. Hold the rest for a person.

Triage a file of natural-language requests, one per line. A reflex is a small program you install and ask for in your words. A request runs when it names everything and evoke is sure enough for what it changes. The rest wait for a person, with a note of what is missing. A request that fits nothing runs nothing.

The request and the result

01

One line ran, one waits, one fits nothing.

A file of three requests, decided against the ops example's three reflexes. Recorded on 21 September 2026 against Jev, TypeSafe AI's model, which reads each sentence.

~/ops
$ node queue.ts < inbox.txt deployment.apps/checkout-api scaled queued · ask · "silence db-3" queued · abstain · "what is the weather like"
  1. 1A clear request runs. The first line named the service, the number and the environment. It changes something, so every answer had to be 0.9 or more. It cleared that bar, so run() ran it.
  2. 2A missing value waits for a person. «silence db-3» named no duration. The decision holds what is missing and why, so a person can answer later.
  3. 3A request that fits nothing runs nothing. A question about the weather fits no reflex, so nothing ran. The decision keeps the ranking for whoever reads the queue.

The operations

02

An app of eleven lines decides each request.

The app reads a line, decides, and runs only what is settled. The reflexes are the three from the ops example, in the same project directory.

inbox.txtyours
scale checkout to 6 in staging
silence db-3
what is the weather like
  1. 1decide() runs nothing. It returns a typed decision: run, confirm, ask or abstain. The app branches on it.
  2. 2Only run is acted on here. A confirm waits for a person too, since nothing in this app answers it. Your queue decides which person answers it.
  3. 3A decision is plain data. Keep it in any queue or table. Later, fill() answers an ask, and run(d, { confirmed: true }) runs a confirm. Both need a project built from the same reflexes and words.

One boundary

03

With no terminal, a question becomes an exit code.

The evoke command reads the same file, one request per line. With no terminal attached, as in a cron job, evoke cannot ask. A line that needs an answer prints the command to run yourself, and the run ends with exit code 3.

no terminal
$ evoke < inbox.txt
  scale service="checkout" env="staging" replicas="6"  0.90
deployment.apps/checkout-api scaled
  an ask needs a terminal  →  evoke "silence db-3"
  none 1.00 · 3 more under 0.01
[3]

Every other line is still answered, and evoke exits with the first code that is not zero. The weather line printed its ranking: none first, at 1.00. No flag answers a question for you. At your own terminal, evoke asks the question there instead. Piping requests into evoke, in the manual → How the bars decide what runs unattended →

Set it up

04

Feed a file of requests to the scale reflex.

This uses the project from the ops example, with its scale reflex and your words. The first request scales a real deployment, so point your words at one you may change.

  1. Write the requests

    Save three requests in ~/ops/inbox.txt, one per line: one that names everything, one that leaves out the environment, and one that fits no reflex.

    ~/ops/inbox.txtyours
    scale checkout to 6 in staging
    scale checkout to 3
    what is the weather like
  2. Try the file

    Each line is decided, and nothing runs. The first would run, the second asks for its environment, and the third fits nothing.

    evoke try < inbox.txt
  3. Run it at your terminal

    The first line scales for real. evoke asks at your terminal for the environment the second line lacks: answer only if that scale may run, or press Ctrl-D to decline. The third line prints its ranking.

    evoke < inbox.txt
  4. Or run it unattended, and keep every decision

    Where no terminal is attached, such as a cron job or CI, each request becomes one JSON line: what ran and its result, what is missing, or the ranking. The first line scales here too, and the run ends with exit code 3. A person works from the file.

    evoke --json < inbox.txt > decided.jsonl

Put your own requests in inbox.txt. Each one is decided against the reflexes in the project, so add yours with evoke add ./<name>.

In your app

05

The same file, from a Node application.

queue.ts loads ~/ops and decides each line. It runs only what is settled, and queues the rest. It needs Node 24.5 or newer, and ES modules.

npm init -y && npm pkg set type=module
npm install @evoke-build/evoke
node queue.ts < inbox.txt
  1. 1Save queue.ts in ~/ops. The first line scales for real. The other two print what the app would queue: an ask and an abstain.
  2. 2Replace the else branch with your queue. Store the decision, then show d.missing or d.contenders to a person.