Skip to content

Installation

Choose the command for shell scripts, a language package for your program, or an extension for your database. The language packages and database archives include their matching engine; you do not install the command first.

Use ThinkThen from Get it from Installation and first call
The command One-line installer, Homebrew, Cargo or a release archive Command installation
Python thinkthen on PyPI, with pandas and Polars accessors Python guide
pandas The Python package with its pandas extra pandas guide
Polars The Python package with its Polars extra Polars guide
TypeScript or JavaScript thinkthen on npm TypeScript guide
Go github.com/botassembly/thinkthen/sdk/go/thinkthen Go guide
Java io.github.botassembly:thinkthen-java on Maven Central Java guide
Kotlin io.github.botassembly:thinkthen-kotlin on Maven Central Kotlin guide
C# Botassembly.ThinkThen on NuGet C# guide
R thinkthen on R-universe R guide
Ruby thinkthen gem on RubyGems Ruby guide
Rust thinkthen on crates.io Rust guide
Swift Swift package from GitHub Swift guide
C the C archive from the release C guide
C++ the C++ and C archives from the release C++ guide
Zig the Zig archive from the release Zig guide
DuckDB The DuckDB release archive DuckDB guide
SQLite The SQLite release archive SQLite guide
PostgreSQL The PostgreSQL release archive PostgreSQL guide

Go and Swift resolve a versioned source dependency. Use the version in their guides rather than a moving branch. Swift Package Manager works without a Swift Package Index listing.

The release files include the C, C++, Zig and database archives. Choose the archive for the machine that will run your program or database. C, C++, Zig, DuckDB and SQLite archives are supplied for Linux x86-64, Linux arm64, macOS on Apple silicon and Windows x86-64. Follow each guide's compiler and runtime requirements.

These are the Linux x86-64 downloads; choose the corresponding platform file on the release page for another machine:

Archive Download
C C archive
C++ C++ archive, together with the C archive above
Zig Zig archive
DuckDB DuckDB archive
SQLite SQLite archive
PostgreSQL PostgreSQL archive

Download SHA256SUMS too. Check the archive and verify its origin before loading or linking it. Substitute your archive's file name in the checksum commands below.

  • DuckDB: use DuckDB 2.0.0 and allow unsigned extensions. Load the verified extension by its absolute path. ThinkThen is not in DuckDB's community repository; INSTALL thinkthen FROM community does not install it.
  • SQLite: use SQLite 3.41.0 or later with extension loading enabled. Load the library once per connection with .load in the shell or your application's extension-loading API.
  • PostgreSQL: use PostgreSQL 18 on Linux x86-64 or arm64 with glibc 2.28 or later. Copy the library and extension files into PostgreSQL's directories, set the key in the server environment, then create the extension in each database. The guide gives the administrator commands. Install from the release archive; PGXN is not a distribution route for this release.

The command installation steps follow. After installation, set your key as the quickstart or your language's guide shows.

On macOS or Linux:

Terminal window
curl -fsSL https://thinkthen.dev/install.sh | sh

In Windows PowerShell:

Terminal window
irm https://thinkthen.dev/install.ps1 | iex

The installer downloads the newest release, checks its checksum, and puts thinkthen in .local/bin in your home folder. It adds that folder to your PATH for new terminals, and prints the line to run in the current one.

To install somewhere else, set THINKTHEN_INSTALL_DIR to the folder first. To leave your shell profile alone, set THINKTHEN_NO_MODIFY_PATH=1.

Open a new terminal and run:

Terminal window
thinkthen --version

Output

thinkthen 0.2.0

If the shell answers command not found, the folder that holds thinkthen isn't on your PATH. Run the line the installer printed, or open a new terminal.

ThinkThen runs on macOS 15 on Apple silicon, on Linux x86-64 and arm64 with glibc 2.28 or later, and on Windows x86-64; tested on Windows Server 2022.

Windows PowerShell 5.1 sends piped text as ASCII, so it turns each accented or non-Latin character into ? before ThinkThen reads it. 漢字 café arrives as ?? caf?. ThinkThen can't tell, so it answers the changed text, and you pay for that question. PowerShell also garbles such text when it reads the output of ThinkThen into a variable or another command.

Run this line in each session before you pipe text, or add it to your $PROFILE:

Terminal window
$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::new()

On macOS on Apple silicon, or on Linux:

Terminal window
brew install botassembly/thinkthen/thinkthen

Homebrew also installs the manual page.

With Rust 1.95.0 or later, on any platform:

Terminal window
cargo install thinkthen --version 0.2.0

Cargo builds the command from source and puts it in ~/.cargo/bin.

The 0.2.0 release holds one file for each platform, and a SHA256SUMS file to check them with:

  • thinkthen-0.2.0-linux-x86_64.tar.gz
  • thinkthen-0.2.0-linux-arm64.tar.gz
  • thinkthen-0.2.0-macos-arm64.tar.gz
  • thinkthen-0.2.0-windows-x86_64.zip

Each file holds the command, its manual page thinkthen.1, and its licenses. The command isn't signed, so check the download before you run it.

These steps download the x86-64 file, check it, unpack it, and put thinkthen on your PATH for this shell. On arm64, write arm64 in place of x86_64.

Terminal window
v=0.2.0
url=https://github.com/botassembly/thinkthen
url=$url/releases/download/v$v
file=thinkthen-$v-linux-x86_64.tar.gz
curl -fsSLO "$url/$file"
curl -fsSLO "$url/SHA256SUMS"
sha256sum --check --ignore-missing SHA256SUMS
mkdir "thinkthen-$v"
tar -xzf "$file" -C "thinkthen-$v"
export PATH="$PWD/thinkthen-$v:$PATH"

The check prints the file name and OK. Anything else means the download is damaged or altered, so download it again. To find thinkthen in new shells, add its folder to PATH in your shell profile.

In Terminal:

Terminal window
v=0.2.0
url=https://github.com/botassembly/thinkthen
url=$url/releases/download/v$v
file=thinkthen-$v-macos-arm64.tar.gz
curl -fsSLO "$url/$file"
curl -fsSLO "$url/SHA256SUMS"
grep " $file\$" SHA256SUMS | shasum -a 256 --check
mkdir "thinkthen-$v"
tar -xzf "$file" -C "thinkthen-$v"
export PATH="$PWD/thinkthen-$v:$PATH"

The check prints the file name and OK. If macOS then blocks thinkthen because it isn't signed, clear the download mark from the folder:

Terminal window
xattr -dr com.apple.quarantine "thinkthen-$v"

Download the zip and SHA256SUMS into one folder. In PowerShell, in that folder, check the zip:

Terminal window
$zip = 'thinkthen-0.2.0-windows-x86_64.zip'
$sums = Get-Content .\SHA256SUMS
$line = $sums | Where-Object { $_.EndsWith(" $zip") }
$want = "$line".Split(' ')[0]
$got = (Get-FileHash $zip -Algorithm SHA256).Hash
if ($want -and $got -eq $want) { 'OK' } else { 'No match' }

On No match, download the zip again. On OK, unpack it and put it on your PATH for this session:

Terminal window
Unblock-File $zip
Expand-Archive $zip .\thinkthen-0.2.0
$env:Path = "$PWD\thinkthen-0.2.0;$env:Path"

Unblock-File clears the download mark. Windows policy can still block a command that isn't signed.

A checksum shows a file arrived whole. To check that it also came from the ThinkThen release build, use the GitHub command line tool:

Terminal window
gh attestation verify FILE \
--repo botassembly/thinkthen \
--signer-workflow \
botassembly/thinkthen/.github/workflows/release-prepare.yml

Write the path to your download in place of FILE. Use the file only when the command reports success.

Upgrade the same way you installed:

  • One-line installer: run it again. It replaces the command with the newest release.
  • Homebrew: brew upgrade thinkthen.
  • Cargo: run cargo install thinkthen --version with the new version number.
  • Download: download the new file, check it, and unpack it in place of the old folder.
  • One-line installer on macOS or Linux: delete thinkthen and thinkthen.install.json from ~/.local/bin, or from the folder you chose. Then delete the line that ends in # thinkthen PATH from your shell profile. thinkthen.install.json lists the profiles the installer changed.
  • One-line installer on Windows: delete thinkthen.exe and thinkthen.install.json from .local\bin in your home folder, then remove that folder from your user Path in the Environment Variables settings.
  • Homebrew: brew uninstall thinkthen.
  • Cargo: cargo uninstall thinkthen.
  • Download: delete the folder you unpacked.

thinkthen completions SHELL prints a script that lets your shell finish ThinkThen commands when you press Tab. It works for bash, elvish, fish, powershell and zsh. These are the first lines of the bash script:

Terminal window
thinkthen completions bash | sed -n '1,4p'

Output

_thinkthen() {
    local i cur prev opts cmd
    COMPREPLY=()
    if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then

Save the script where your shell loads it. For bash:

Terminal window
dir=~/.local/share/bash-completion/completions
mkdir -p "$dir"
thinkthen completions bash > "$dir/thinkthen"

For zsh, save it in a folder on your fpath:

Terminal window
mkdir -p ~/.zfunc
thinkthen completions zsh > ~/.zfunc/_thinkthen

Then add fpath=(~/.zfunc $fpath) to ~/.zshrc, above the line that runs compinit.

For fish:

Terminal window
dir=~/.config/fish/completions
mkdir -p "$dir"
thinkthen completions fish > "$dir/thinkthen.fish"

Open a new terminal to use them.

Homebrew installs the manual page, so man thinkthen works. The download files hold it as thinkthen.1. After the one-line installer or Cargo, write it yourself:

Terminal window
thinkthen man > thinkthen.1
man ./thinkthen.1

To read it with man thinkthen from any folder, copy thinkthen.1 into a man1 folder on your MANPATH.

Quickstart: set your key and ask your first question.