← Browse

Getting started

ttrek manages Tcl packages and their native dependencies in a project environment.

Install the command-line tool

curl --proto '=https' --tlsv1.2 -sSf https://ttrek.sh/init | sh

Open a new terminal after installation so your shell picks up the executable.

Install build tools

Before installing packages on Ubuntu/Debian:

sudo apt update
sudo apt install build-essential cmake bash curl git patch pkg-config perl tar gzip ca-certificates

build-essential supplies GCC, G++ and Make. For a newer CMake, use sudo snap install cmake --classic and include /snap/bin on PATH. ttrek install and ttrek update report missing external tools before changing the project environment. Individual package recipes may need additional tools.

Create a project

mkdir my-app
cd my-app
ttrek init -y
ttrek sync
ttrek install -y tcl tjson

ttrek.json records direct dependencies. ttrek-lock.json records the resolved versions and registry selection. Packages install under ttrek-venv/local. Keep application data outside ttrek-venv.

Run Tcl in the project environment

ttrek run tclsh9.1

At the Tcl prompt:

package require tjson
puts [package present tjson]

Use ttrek install -y to install a project's declared dependencies. See Managing packages and Registries for version selection and private packages.