Install¶
Install script¶
install.sh installs tt 3 from its GitHub release on Linux (x86_64 and
arm64) and on macOS with Apple silicon:
$ curl -fsSL https://raw.githubusercontent.com/tarantool/tt/v3/install.sh | sh
The script takes the newest stable tt 3 release, or the newest pre-release
while there is none, checks the archive against checksums.txt of the
release and puts tt into ~/.local/bin, or into /usr/local/bin when run
by root. When the directory is not on PATH, the script says how to add it.
wget -qO- <url> | sh works as well.
Options go after sh -s --:
$ curl -fsSL https://raw.githubusercontent.com/tarantool/tt/v3/install.sh | sh -s -- --version 3.0.0-alpha.1 --dir /usr/local/bin
-v,--version <version>- the release to install, such as3.0.0-alpha.1.TT_VERSIONsets it too.-c,--commit <commit>- build tt from a commit of the repository instead of installing a release; see below.TT_COMMITsets it too. It excludes--version.-d,--dir <dir>- the directory to putttinto.TT_INSTALL_DIRsets it too.--openssl- install thett-opensslbuild, whose TLS uses the OpenSSL of the machine instead of Go. A release has it for Linux only.-h,--help- list the options.
GITHUB_TOKEN, when set, is sent to the GitHub API the script lists the
releases with: an unauthenticated client may hit its rate limit.
--version skips the lookup.
Build from a commit¶
--commit builds tt 3 of a commit with go build, so it needs git and
Go. It takes a hash, full or short, a branch or
a tag; the commit of a pull request, which no branch has, by its full hash:
$ curl -fsSL https://raw.githubusercontent.com/tarantool/tt/v3/install.sh | sh -s -- --commit 1508ce93
The binary is built as mage build builds it and reports the version
git describe gives the commit:
$ tt version
Tarantool CLI version 3.0.0-alpha.1, linux/amd64. commit: 1508ce9 (v3.0.0-alpha.1-20-g1508ce9)
A build runs wherever Go does, Intel macOS included, which has no release
build. With --openssl it needs a C compiler and the OpenSSL headers. A
commit of tt 2 is refused: it builds with submodules and code that mage
generates, as the
README of tt 2 tells.
Build from source¶
You need Go 1.27.4 or newer, Mage and Git.
$ git clone --branch v3 https://github.com/tarantool/tt
$ cd tt
$ mage build
$ ./tt version
Put the tt binary into a directory on PATH.
Preview note.
mage buildstamps tt with the versiongit describegives, and the nearest tag on thev3branch is a 2.x one, so the binary reports a 2.x version.tt newwritestt = ">=3.0.0"into a manifest, andtt package packthen refuses to bundle such a tt into an archive. To pack with a binary built from source, stamp it with a 3.x version:$ go build -ldflags "-X github.com/tarantool/tt/v3/cli/version.gitTag=3.0.0" -o tt ./cli
TLS backends¶
By default tt uses the pure-Go TLS backend and does not need OpenSSL.
TT_CLI_BUILD_SSL selects another one:
$ TT_CLI_BUILD_SSL=openssl mage build # OpenSSL, linked dynamically
$ TT_CLI_BUILD_SSL=openssl_static mage build # OpenSSL, linked statically
The static build needs the OpenSSL static libraries.
Shell completion¶
$ . <(tt completion bash)
zsh and fish are supported too. Completion offers the commands, external
modules, and the targets of tt instance commands: applications before the
: and their instances after it.
Bash completion needs the bash-completion package, loaded before the script
of tt. An interactive bash of most distributions loads it, once the package is
installed:
$ sudo apt-get install bash-completion # Debian, Ubuntu
$ sudo dnf install bash-completion # Fedora, RHEL
In a shell that has not loaded it, such as a minimal container image or
bash --norc, load it first:
$ . /usr/share/bash-completion/bash_completion
$ . <(tt completion bash)
Without it, Tab says tt: completion needs the bash-completion package and
completes nothing. In zsh, run compinit before loading the script.
Tarantool¶
tt does not need Tarantool to be installed: tt binary install tarantool
installs it into a project, for a user or system-wide (see
Manage binaries). Tarantool Community Edition 3.0
and newer is supported.
Runtime dependencies¶
- Git and Mage, for
tt binary install ttwhen it builds tt from source. - Git, CMake,
make, a C and C++ compiler, autoconf, automake, libtool, perl and patch, fortt binary install tarantoolwhen it builds Tarantool from source: on a platform with no prebuilt binary, Alpine Linux say, for a commit or a pull request, or with--source-build. tt checks them and names the packages that are missing (see Build dependencies). - The CA certificates of the system (
ca-certificates), for the downloads oftt binary installandtt binary search, orSSL_CERT_FILEorSSL_CERT_DIRset to a CA bundle. Without them tt says it cannot verify the certificate of the server. - A C compiler, for rocks and components with a C part.
curlorwget,zipandunzip, fortt rocks, which runs LuaRocks.
A prebuilt release of Tarantool or tt needs none of the build tools, Git
included, only the CA certificates:
tt binary install tarantool 3.9 finds the release among the prebuilt
binaries there are (see Choose a version).
Without Git, tt binary search tarantool and tt binary search tt list
only the releases with a prebuilt binary for the host (see
Search).