Quickstart
Install ThinkThen, set your key, and ask your first question about a customer message.
1. Install ThinkThen
Section titled “1. Install ThinkThen”On macOS or Linux:
curl -fsSL https://thinkthen.dev/install.sh | shIn Windows PowerShell:
irm https://thinkthen.dev/install.ps1 | iexOpen a new terminal, then check that it worked:
thinkthen --versionOutput
thinkthen 0.2.0
Installation covers Homebrew, Cargo and downloads.
2. Set your key
Section titled “2. Set your key”ThinkThen sends each question to TypeSafe's System One service, which bills your TypeSafe account for each call. Get a key on the TypeSafe keys page, then set it in your shell:
export THINKTHEN_API_KEY='your key'In Windows PowerShell:
$env:THINKTHEN_API_KEY = 'your key'To use OpenAI or your own server instead, see Configuration.
3. Ask a question
Section titled “3. Ask a question”Pipe in the text, and put the question in quotes:
echo 'Please refund my order.' | thinkthen decide 'Does the customer request a refund?'Output
true
true means yes: the message asks for a refund. If you see usage.key-missing instead, the key isn't set in this shell.
4. Act on the answer
Section titled “4. Act on the answer”--check turns the answer into the exit code, so a script can branch on it. Here the answer is yes, so the script sends the message to the refunds queue:
message='Please refund my order.'if echo "$message" | thinkthen decide --check \ 'Does the customer request a refund?' > /dev/nullthen echo 'send to the refunds queue'else status=$? case "$status" in 1|3) ;; *) exit "$status" ;; esacfiOutput
send to the refunds queue
In Windows PowerShell, $LASTEXITCODE holds the exit code:
'Please refund my order.' | thinkthen decide --check ` 'Does the customer request a refund?' > $nullif ($LASTEXITCODE -eq 0) { 'send to the refunds queue'}Output
send to the refunds queue
Next steps
Section titled “Next steps”- decide: yes, no and not sure.
- The ten functions: pick the one that fits your question.
- File types: answer every row of a CSV file.
- Python SDK and the other SDKs: the same functions in your code.