Skip to main content
Version: 0.8

Install the Tecton CLI

note

This page is for the Tecton CLI on a terminal (typically on a laptop).

For installation information for the tecton package for use in interactive notebooks. Please refer to the instructions for your particular environment:

The Tecton CLI is primarily used for managing workspaces, applying feature repository changes to a workspace (via the tecton apply command), and creating API keys.

To set up the Tecton CLI on a terminal (typically on a laptop), follow these steps:

Install Python​

note
  • The Tecton CLI for Spark (Databricks and EMR) supports Python >=3.8.
  • The Tecton CLI for Snowflake supports Python >=3.8, <3.12.

If you are joining a team that already uses Tecton, install the version of the Tecton CLI and the same version of Python that are already in use in your organization.

New users should aim to install the most recent version of the Tecton CLI and of Python.

Python Environments​

Installing more than one Tecton CLI version into the same workspace can lead to inconsistent behavior. We recommend using Pyenv or Anaconda to manage your Tecton CLI and Python installations and environments:

Pyenv​

The popular Python version manager pyenv allows you to install different versions of Python, and the pyenv extension pyenv-virtualenv allows you to create a virtual environment using a specific Python version you've installed via pyenv. Once you've installed both packages, you can install Python 3.8 and create a virtual environment using it with the following commands. We use 3.8.12 as an example version of Python 3.8.

pyenv install 3.8.12
pyenv virtualenv 3.8.12 tecton
pyenv activate tecton

Anaconda​

Anaconda uses an alternative package manager to the standard Python pip package management, however it can install pip packages as well. Anaconda's package repository also has pre-compiled binaries for Python versions and popular libraries which are handy if you have trouble building Python using a Python version manager.

To install Python with Anaconda:

  1. Install Anaconda. You can also use the stripped down Miniconda installer.

  2. Create a new conda environment with Python 3.8:

    conda create -n tecton python=3.8 pip`.
    # Add `nomkl` after `pip` for x86 Anaconda installs on Mac M1 computers
  3. Activate the conda environment with: conda activate tecton

After completing your Pyenv or Anaconda installation, install the Tecton CLI.

Apple M1 (arm64) Silicon Considerations​

The Tecton CLI >= 0.4 supports Mac M1 machines without depending on the Rosetta2 library. The Tecton CLI pip dependencies have arm64 wheels except for grpcio. To use the Tecton CLI >= 0.4 on Mac M1 machines:

  1. Update your macOS to Monterey 12.1 or higher.
  2. Update to the latest version of the XCode Command Line Tools.
  3. Install and compile the grpcio dependencies.

Contact Tecton support if you encounter any difficulties installing Tecton >= 0.4 with Monterey >= 12.1 on Mac M1 machines.

Install the Tecton CLI​

The Tecton CLI is hosted on PyPI and you can install the latest version using pip. To learn more about the stable and beta Tecton CLI versions please see Release Notes.

The pip command to install the Tecton CLI depends on the data platform you are using, as follows.

Data PlatformCommand to Install Tecton CLINotes
Sparkpip install 'tecton[pyspark]'Tecton support for Spark 2 installations reached end of life on December 31, 2021.
Databrickspip install 'tecton[databricks-connect]'Supports databricks-connect users using Databricks as their Spark compute engine. See the Databricks Connect documentation for more information.
Snowflakepip install 'tecton[snowflake]'Support for Tecton on Snowflake, which uses the Snowflake compute engine.

Installation of the Tecton CLI when unit tests will be run​

If you are using Spark and you will be running unit tests, use one of the following commands, instead of pip install tecton, to install the Tecton CLI:

  • To install with Pyspark 3.1: pip install 'tecton[pyspark]'
  • To install with Pyspark 3.2: pip install 'tecton[pyspark3.2]'
  • To install with Pyspark 3.3: pip install tecton pyspark==3.3

Tecton CLI installation examples​

👉 To install the latest stable release (recommended):

pip install tecton

👉 To install the latest beta release:

pip install --pre tecton

👉 To install a specific version of the Tecton CLI:

pip install tecton==0.6.7

The PyPI Release History page has a complete list of the Tecton CLI versions, including beta versions.

Validate the Tecton CLI installation​

You can validate the installation using tecton version. If the installation succeeded, the output will contain the CLI version number and other information:

$ tecton version
Version: 0.5.7
Git Commit: a5ec28b4394217c27c93e9d1c4c8e721b48a4421
Build Datetime: 2022-04-11T21:19:14

Use the Tecton CLI to sign in to your deployment​

Connect the CLI to your Tecton deployment using tecton login, which automatically authenticates and sets credentials:

$ tecton login
Enter configuration. Press enter to use current value
Tecton Cluster URL [example: https://yourco.tecton.ai]: https://foo.tecton.ai
✅ Authentication successful!

Manual authentication​

If automatic authentication fails, use the --manual flag to generate a URL where an authentication code can be found.

$ tecton login --manual
Enter configuration. Press enter to use current value
Tecton Cluster URL [example: https://yourco.tecton.ai]: https://foo.tecton.ai
Requesting authorization for Tecton CLI via browser.
If browser doesn\'t open automatically, visit the following link: <go to this URL>
Paste the authentication code here:abcdef123456789
✅ Updated configuration at /Users/username/.tecton/config

Setting up Shell Completion​

The Tecton CLI supports shell completion (aka tab completion, autocomplete) for zsh, bash, and fish. For typical setups, shell completion can be set up as follows:

# Generate and save the Tecton auto-complete script.
tecton completion --zsh > ~/.tecton-complete.zsh

# Enable zsh auto-completion. (Not needed if you already have auto-complete enabled, e.g. are using oh-my-zsh.)
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc

# Add sourcing the script into your .zshrc.
echo '. ~/.tecton-complete.zsh' >> ~/.zshrc

Was this page helpful?

🧠 Hi! Ask me anything about Tecton!

Floating button icon