# A Bash command that answers questions about text

Pipe text in, read the answer out, and branch on the exit code.

## Install

| Channel | Note |
| --- | --- |
| `curl -fsSL https://thinkthen.dev/install.sh \| sh` | Download script. |
| `brew install botassembly/thinkthen/thinkthen` | Homebrew, an option on a Mac. |

Set `THINKTHEN_API_KEY` in the environment.

## A first call

*The ticket asks for a refund. decide prints true and exits 0.*

```
question="Does the customer ask for a refund?"

cat <<'EOF' |
I renewed once this morning, but my card shows two charges.
Please refund the duplicate.
EOF
thinkthen decide "$question"
```

*Output*

```
true
```

*exit 0: yes*

Not sure comes back as `null`, and exit code 3. Branch on it and send those cases to a person.

## Run facts

`--facts` prints one line of run facts on standard error, after the answers.

## Jev, Liquid d1 and Ollama from Bash

`--backend NAME` names the backend for one run. `THINKTHEN_BACKEND` names it for every run in the shell. Each backend page shows its runs.

- [TypeSafe Jev](/install/backends/typesafe/): `--backend typesafe`
- [Liquid d1](/install/backends/liquid/): `--backend liquid`
- [Ollama](/install/backends/ollama/): `--backend ollama`

The configuration file's `backend` names a default backend for every run. The [Configuration](/install/configuration/#configuration-file) page shows the file.

### OpenAI Decisions API from Bash

OpenAI announced its Decisions API on 2026-09-29 in its [DevDay 2026 recap](https://openai.com/index/devday-2026-recap/). OpenAI has published no address, schema or price, so ThinkThen cannot call it. The [OpenAI Decisions API](/install/backends/openai/) page says what ThinkThen knows.

## What is different in Bash

- Standard input carries the evidence. Standard output carries the answer and nothing else.
- On one piece of evidence, the exit code is the answer. `if` and `case` read it directly.
- `--jobs` sets how many requests run at once.
- `--plan` prints the plan and needs no key.

On GitHub: [github.com/botassembly/thinkthen](https://github.com/botassembly/thinkthen)
